From e47712c900ca2190c308b89b8e62dac25ce239ed Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Wed, 27 Aug 2025 11:03:26 -0700 Subject: [PATCH 1/3] GH-95952: Require setting `HOSTRUNNER` when cross compiling for WASI 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. --- configure | 6 ++++-- configure.ac | 7 +++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/configure b/configure index bdeab8a6d126a3..67e4ffd0605397 100755 --- a/configure +++ b/configure @@ -7903,8 +7903,10 @@ then : 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='' ;; diff --git a/configure.ac b/configure.ac index 991fa40746be78..c4f08550320ff2 100644 --- a/configure.ac +++ b/configure.ac @@ -1636,10 +1636,9 @@ then 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 From 6949eee58b104d8ecd13c56a82189259abc64703 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Wed, 27 Aug 2025 11:32:10 -0700 Subject: [PATCH 2/3] Add a news entry --- .../next/Build/2025-08-27-11-32-02.gh-issue-95952.KSymc7.rst | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Misc/NEWS.d/next/Build/2025-08-27-11-32-02.gh-issue-95952.KSymc7.rst diff --git a/Misc/NEWS.d/next/Build/2025-08-27-11-32-02.gh-issue-95952.KSymc7.rst b/Misc/NEWS.d/next/Build/2025-08-27-11-32-02.gh-issue-95952.KSymc7.rst new file mode 100644 index 00000000000000..0e4b4615342b24 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2025-08-27-11-32-02.gh-issue-95952.KSymc7.rst @@ -0,0 +1,5 @@ +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. From d9a79270086bcc30f9b9137f0ffe0aa5817306c5 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Wed, 27 Aug 2025 11:32:40 -0700 Subject: [PATCH 3/3] Use a hyphen --- configure | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 67e4ffd0605397..7dd333690a3a2c 100755 --- a/configure +++ b/configure @@ -7905,7 +7905,7 @@ fi ;; #( WASI) : - as_fn_error $? "HOSTRUNNER must be set when cross compiling to WASI" "$LINENO" 5 + as_fn_error $? "HOSTRUNNER must be set when cross-compiling to WASI" "$LINENO" 5 ;; #( *) : HOSTRUNNER='' diff --git a/configure.ac b/configure.ac index c4f08550320ff2..8fc8f1eced20cf 100644 --- a/configure.ac +++ b/configure.ac @@ -1637,7 +1637,7 @@ then AS_VAR_IF([host_cpu], [wasm64], [AS_VAR_APPEND([HOSTRUNNER], [" --experimental-wasm-memory64"])]) ], [WASI], [ - AC_MSG_ERROR([HOSTRUNNER must be set when cross compiling to WASI]) + AC_MSG_ERROR([HOSTRUNNER must be set when cross-compiling to WASI]) ], [HOSTRUNNER=''] )