diff --git a/.github/build.sh b/.github/build.sh index 5f14b3b84..64d76171e 100755 --- a/.github/build.sh +++ b/.github/build.sh @@ -9,6 +9,7 @@ if [[ -z ${BSH_HOST_PLATFORM-} ]]; then >&2 echo "BSH_HOST_PLATFORM not set"; if [[ -z ${BSH_HOST_LIBC-} ]]; then >&2 echo "BSH_HOST_LIBC not set"; exit 1; fi if [[ -z ${BSH_STATIC_DYNAMIC-} ]]; then >&2 echo "BSH_STATIC_DYNAMIC not set"; exit 1; fi if [[ -z ${BSH_DEBUG_RELEASE-} ]]; then >&2 echo "BSH_DEBUG_RELEASE not set"; exit 1; fi +if [[ -z ${BSH_LINT-} ]]; then >&2 echo "BSH_LINT not set"; exit 1; fi if [[ -z ${RELEASE_NAME-} ]]; then >&2 echo "RELEASE_NAME not set"; exit 1; fi if [[ -z ${RELEASE_TYPE-} ]]; then >&2 echo "RELEASE_TYPE not set"; exit 1; fi if [[ -z ${MOD_ID-} ]]; then >&2 echo "MOD_ID not set"; exit 1; fi @@ -119,7 +120,7 @@ if [[ -z ${BSH_NO_PACKAGES-} ]]; then fi ;; emscripten) - git clone https://github.com/emscripten-core/emsdk.git --branch 3.1.30 + git clone https://github.com/emscripten-core/emsdk.git --branch 3.1.72 cd emsdk ./emsdk install latest ./emsdk activate latest @@ -284,6 +285,9 @@ if [[ $BSH_HOST_PLATFORM == linux ]] && [[ $BSH_HOST_ARCH != aarch64 ]]; then meson_configure+=$'\t'-Db_pie=false c_link_args+=\'-no-pie\', fi +if [[ $SEPARATE_DEBUG == yes ]] && [[ $BSH_HOST_PLATFORM == emscripten ]]; then + c_link_args+=\'-gseparate-dwarf\', +fi stable_or_beta=no if [[ $RELEASE_TYPE == beta ]]; then meson_configure+=$'\t'-Dbeta=true @@ -488,10 +492,14 @@ else fi if [[ $SEPARATE_DEBUG == yes ]] && [[ $BSH_HOST_PLATFORM-$BSH_HOST_LIBC != windows-msvc ]]; then - $objcopy --only-keep-debug $strip_target $DEBUG_ASSET_PATH - $strip --strip-debug --strip-unneeded $strip_target - $objcopy --add-gnu-debuglink $DEBUG_ASSET_PATH $strip_target - chmod -x $DEBUG_ASSET_PATH + if [[ $BSH_HOST_PLATFORM == emscripten ]]; then + mv $APP_EXE.wasm.debug.wasm $DEBUG_ASSET_PATH # yeah >_> + else + $objcopy --only-keep-debug $strip_target $DEBUG_ASSET_PATH + $strip --strip-debug --strip-unneeded $strip_target + $objcopy --add-gnu-debuglink $DEBUG_ASSET_PATH $strip_target + chmod -x $DEBUG_ASSET_PATH + fi fi if [[ $BSH_HOST_PLATFORM == android ]]; then $JAVA_HOME_8_X64/bin/keytool -genkeypair -keystore keystore.jks -alias androidkey -validity 10000 -keyalg RSA -keysize 2048 -keypass bagelsbagels -storepass bagelsbagels -dname "CN=nobody" @@ -539,7 +547,7 @@ if [[ $BSH_HOST_PLATFORM == darwin ]]; then exit 1 fi elif [[ $PACKAGE_MODE == emscripten ]]; then - tar cvf $ASSET_PATH $APP_EXE.js $APP_EXE.worker.js $APP_EXE.wasm + tar cvf $ASSET_PATH $APP_EXE.js $APP_EXE.wasm elif [[ $PACKAGE_MODE == appimage ]]; then # so far this can only happen with $BSH_HOST_PLATFORM-$BSH_HOST_LIBC == linux-gnu, but this may change later case $BSH_HOST_ARCH in diff --git a/.github/prepare.py b/.github/prepare.py index 852a9d208..d7eaf6a0d 100755 --- a/.github/prepare.py +++ b/.github/prepare.py @@ -152,7 +152,7 @@ for arch, platform, libc, statdyn, bplatform, runso ( 'aarch64', 'android', 'bionic', 'static', 'linux', 'ubuntu-22.04', '.apk', 'check', None, None, None, 'debug', 0, False ), # priority = 0: rarely used debug build ( 'aarch64', 'android', 'bionic', 'static', 'linux', 'ubuntu-22.04', '.apk', 'publish', '.dbg', None, 'arm64-and-gcc-static', 'release', 10, True ), ( 'wasm32', 'emscripten', 'emscripten', 'static', 'linux', 'ubuntu-22.04', '.tar', 'check', None, None, None, 'debug', 0, False ), # priority = 0: rarely used debug build - ( 'wasm32', 'emscripten', 'emscripten', 'static', 'linux', 'ubuntu-22.04', '.tar', 'publish', None, 'emscripten', 'wasm32-ems-static', 'release', 10, False ), # I have no idea how to separate debug info on emscripten, TODO: enable lint once emscripten ships clang-tidy + ( 'wasm32', 'emscripten', 'emscripten', 'static', 'linux', 'ubuntu-22.04', '.tar', 'publish','.dbg.wasm','emscripten', 'wasm32-ems-static', 'release', 10, False ), # TODO: enable lint once emscripten ships clang-tidy ]: if priority < do_priority: continue diff --git a/meson.build b/meson.build index 5a3a0bb55..7447fd4f9 100644 --- a/meson.build +++ b/meson.build @@ -220,10 +220,8 @@ if host_platform == 'emscripten' '-s', 'USE_ZLIB=1', '-s', 'DISABLE_EXCEPTION_CATCHING=0', ] - if is_debug - project_link_args += [ '--source-map-base=./' ] - emcc_args += [ '-gsource-map' ] - endif + project_link_args += [ '--source-map-base=./' ] + emcc_args += [ '-gsource-map' ] project_link_args += emcc_args project_cpp_args += emcc_args else