macOS by default doesn't have the requisite CLI tools to make a default value easy. Plus Tools/wasm/wasi takes care of setting HOSTRUNNER.
--- /dev/null
+When cross-compiling for WASI, require that the HOSTRUNNER environment
+variable be explicitly set.
+
+This was needed as macOS lacks the appropriate CLI tools to set a reasonable
+default.
as_fn_append HOSTRUNNER " --experimental-wasm-memory64"
fi
;; #(
- WASI) :
- HOSTRUNNER='wasmtime run --wasm max-wasm-stack=16777216 --wasi preview2=n --env PYTHONPATH=/$(shell realpath --relative-to $(abs_srcdir) $(abs_builddir))/$(shell cat pybuilddir.txt):/Lib --dir $(srcdir)::/' ;; #(
+ WASI) :
+
+ as_fn_error $? "HOSTRUNNER must be set when cross-compiling to WASI" "$LINENO" 5
+ ;; #(
*) :
HOSTRUNNER=''
;;
HOSTRUNNER="$NODE"
AS_VAR_IF([host_cpu], [wasm64], [AS_VAR_APPEND([HOSTRUNNER], [" --experimental-wasm-memory64"])])
],
- dnl TODO: support other WASI runtimes
- dnl wasmtime starts the process with "/" as CWD. For OOT builds add the
- dnl directory containing _sysconfigdata to PYTHONPATH.
- [WASI], [HOSTRUNNER='wasmtime run --wasm max-wasm-stack=16777216 --wasi preview2=n --env PYTHONPATH=/$(shell realpath --relative-to $(abs_srcdir) $(abs_builddir))/$(shell cat pybuilddir.txt):/Lib --dir $(srcdir)::/'],
+ [WASI], [
+ AC_MSG_ERROR([HOSTRUNNER must be set when cross-compiling to WASI])
+ ],
[HOSTRUNNER='']
)
fi