diff --git a/util/runtime.sh b/util/runtime.sh index 806ef819e..5a49d36c7 100755 --- a/util/runtime.sh +++ b/util/runtime.sh @@ -145,6 +145,18 @@ if check_target "$TARGET_DIR"; then exit 0 fi +# overrides + +case $OSTYPE in + darwin*) + if [[ "$RUNTIME" = "wasmtime" ]]; then + # must be built with the 'posix-signals-on-macos' feature + notice "installing wasmtime on macOS, forcing 'build' mode" + MODE="build" + fi + ;; +esac + notice "installing $RUNTIME in $TARGET_DIR..." BUILD_SCRIPT=$NGX_WASM_DIR/util/runtimes/$RUNTIME.sh diff --git a/util/runtimes/wasmtime.sh b/util/runtimes/wasmtime.sh index a7eca2ef0..0b906c6a1 100755 --- a/util/runtimes/wasmtime.sh +++ b/util/runtimes/wasmtime.sh @@ -108,6 +108,11 @@ build_wasmtime() { cargo_target_dir="target/release" fi + if [ "$(uname -s)" = "Darwin" ]; then + # See https://github.com/bytecodealliance/wasmtime/issues/6785 + args+="--features wasmtime/posix-signals-on-macos" + fi + if [ "$clean" = "clean" -a -d $cargo_target_dir ]; then rm -rf $cargo_target_dir fi