]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-95952: Require setting `HOSTRUNNER` when cross compiling for WASI (#138203)
authorBrett Cannon <brett@python.org>
Fri, 5 Sep 2025 22:48:16 +0000 (15:48 -0700)
committerGitHub <noreply@github.com>
Fri, 5 Sep 2025 22:48:16 +0000 (15:48 -0700)
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.

Misc/NEWS.d/next/Build/2025-08-27-11-32-02.gh-issue-95952.KSymc7.rst [new file with mode: 0644]
configure
configure.ac

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 (file)
index 0000000..0e4b461
--- /dev/null
@@ -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.
index bdeab8a6d126a31209e383aef6c6273464878e3f..7dd333690a3a2cd49d1d3ecbd429d1d4bd74034a 100755 (executable)
--- 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=''
    ;;
index 991fa40746be780a6cde5a962b7a9434b7a5d775..8fc8f1eced20cfc840d9ea16bfb4a47754c20917 100644 (file)
@@ -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