Skip to content

Commit

Permalink
chore(runtime) build Wasmtime with 'posix-signals-on-macos' on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaultcha committed Nov 8, 2023
1 parent 2f4d4aa commit 3c1dd1a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions util/runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions util/runtimes/wasmtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3c1dd1a

Please sign in to comment.