]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] GH-116313: get WASI builds to run under wasmtime 18 w/ WASI 0.2/preview2 primi...
authorBrett Cannon <brett@python.org>
Tue, 5 Mar 2024 22:05:42 +0000 (14:05 -0800)
committerGitHub <noreply@github.com>
Tue, 5 Mar 2024 22:05:42 +0000 (22:05 +0000)
(cherry picked from commit 88fdb082d98104dd5612b06397f4c764a0936616)

Misc/NEWS.d/next/Build/2024-03-04-12-43-42.gh-issue-116313.cLLb8S.rst [new file with mode: 0644]
Tools/wasm/wasm_build.py
configure
configure.ac

diff --git a/Misc/NEWS.d/next/Build/2024-03-04-12-43-42.gh-issue-116313.cLLb8S.rst b/Misc/NEWS.d/next/Build/2024-03-04-12-43-42.gh-issue-116313.cLLb8S.rst
new file mode 100644 (file)
index 0000000..6150154
--- /dev/null
@@ -0,0 +1 @@
+Get WASI builds to work under wasmtime 18 w/ WASI 0.2/preview2 primitives.
index 63812c6f3153f24aedb52322dffc9df86ba85fdf..78c749b8803868905fbb2ddc9221731308be2c89 100755 (executable)
@@ -316,8 +316,10 @@ WASI = Platform(
         # workaround for https://github.com/python/cpython/issues/95952
         "HOSTRUNNER": (
             "wasmtime run "
-            "--env PYTHONPATH=/{relbuilddir}/build/lib.wasi-wasm32-{version}:/Lib "
-            "--mapdir /::{srcdir} --"
+            "--wasm max-wasm-stack=8388608 "
+            "--wasi preview2 "
+            "--dir {srcdir}::/ "
+            "--env PYTHONPATH=/{relbuilddir}/build/lib.wasi-wasm32-{version}:/Lib"
         ),
         "PATH": [WASI_SDK_PATH / "bin", os.environ["PATH"]],
     },
index cb3db60f9c23223b4a6a3e5d170379f4e234d049..a1ad0ae25101cde21198549fd84051aa95e91f7a 100755 (executable)
--- a/configure
+++ b/configure
@@ -6961,7 +6961,7 @@ fi
 fi
      ;; #(
               WASI/*) :
-    HOSTRUNNER='wasmtime run --env PYTHONPATH=/$(shell realpath --relative-to $(abs_srcdir) $(abs_builddir))/$(shell cat pybuilddir.txt) --mapdir /::$(srcdir) --' ;; #(
+    HOSTRUNNER='wasmtime run --wasm max-wasm-stack=8388608 --wasi preview2 --env PYTHONPATH=/$(shell realpath --relative-to $(abs_srcdir) $(abs_builddir))/$(shell cat pybuilddir.txt):/Lib --dir $(srcdir)::/' ;; #(
   *) :
     HOSTRUNNER=''
    ;;
index bbe7f891e7dd29e4193e229e8a131fea4d3c2afa..7b4000fa9c340d949698dcfecb6475eb41fc2027 100644 (file)
@@ -1580,7 +1580,7 @@ then
     dnl TODO: support other WASI runtimes
     dnl wasmtime starts the proces with "/" as CWD. For OOT builds add the
     dnl directory containing _sysconfigdata to PYTHONPATH.
-    [WASI/*], [HOSTRUNNER='wasmtime run --env PYTHONPATH=/$(shell realpath --relative-to $(abs_srcdir) $(abs_builddir))/$(shell cat pybuilddir.txt) --mapdir /::$(srcdir) --'],
+    [WASI/*], [HOSTRUNNER='wasmtime run --wasm max-wasm-stack=8388608 --wasi preview2 --env PYTHONPATH=/$(shell realpath --relative-to $(abs_srcdir) $(abs_builddir))/$(shell cat pybuilddir.txt):/Lib --dir $(srcdir)::/'],
     [HOSTRUNNER='']
   )
 fi