diff --git a/CHANGELOG.md b/CHANGELOG.md index a8c494a8d..985b0cdd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [v0.0.6] - TBD -Uses libvips v8.14.5, compiled with Emscripten v3.1.47. +Uses libvips v8.14.5, compiled with Emscripten v3.1.48. ## [v0.0.5] - 2023-04-27 diff --git a/Dockerfile b/Dockerfile index 7b91a78bd..9598c650f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # https://github.com/emscripten-core/emsdk -FROM docker.io/emscripten/emsdk:3.1.47 +FROM docker.io/emscripten/emsdk:3.1.48 # Path settings ENV \ @@ -25,7 +25,7 @@ RUN \ # Emscripten patches RUN \ - curl -Ls https://github.com/emscripten-core/emscripten/compare/3.1.47...kleisauke:wasm-vips-3.1.47.patch | patch -p1 -d $EMSDK/upstream/emscripten && \ + curl -Ls https://github.com/emscripten-core/emscripten/compare/3.1.48...kleisauke:wasm-vips-3.1.48.patch | patch -p1 -d $EMSDK/upstream/emscripten && \ emcc --clear-cache && embuilder build sysroot --force # Rust diff --git a/build.sh b/build.sh index f6ccffcce..411ed525d 100755 --- a/build.sh +++ b/build.sh @@ -498,11 +498,6 @@ node --version # Building for both Node.js and web, prepare NPM package stage "Prepare NPM package" - # Ensure compatibility with Deno (classic workers are not supported) - # TODO(kleisauke): Remove when Emscripten 3.1.48 is released - https://github.com/emscripten-core/emscripten/pull/20452 - sed -i 's/new Worker(\([^()]\+\))/new Worker(\1,{type:"module"})/g' $SOURCE_DIR/lib/vips-es6.js - sed -i 's/new Worker(\(new URL([^)]\+)\)/new Worker(\1,{type:"module"}/g' $SOURCE_DIR/lib/vips-es6.js - # The produced binary should be the same across the different variants (sanity check) expected_sha256=$(sha256sum "$SOURCE_DIR/lib/vips.wasm" | awk '{ print $1 }') for file in vips-es6.wasm vips-node.wasm vips-node-es6.wasm; do @@ -527,13 +522,9 @@ node --version sed -i 's/var Module/const require = createRequire(import.meta.url);&/' $SOURCE_DIR/lib/vips-node.worker.mjs # Print the target features section - PYTHONPATH="$(dirname $(which emcc))" python3 - << EOF -from tools import webassembly - -with webassembly.Module('$SOURCE_DIR/lib/vips.wasm') as m: - features = [f[1] for f in m.parse_features_section() if f[0] == '+'] - print('Used Wasm features:', ' '.join(features)) -EOF + echo -n "Used Wasm features: " + $EMSDK/upstream/bin/wasm-opt --mvp-features --print-features -o /dev/null $SOURCE_DIR/lib/vips.wasm | \ + sed 's/^--enable-//' | paste -sd' ' # Copy dynamic loadable modules module_dir=$(printf '%s\n' $TARGET/lib/vips-modules-* | sort -n | tail -1) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 975f4c10a..3ff7f8959 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -135,6 +135,7 @@ set(MAIN_LINK_OPTIONS -sFORCE_FILESYSTEM -sEXPORTED_RUNTIME_METHODS=FS,ENV,deletionQueue,addFunction,bigintToI53Checked -sEXCEPTION_STACK_TRACES + -sBINARYEN_EXTRA_PASSES=--emit-target-features ) set_target_properties(${TARGETS}