https://github.com/python/cpython/commit/4637a1fcbd52d89b0561b588485e6240eac7b07d
commit: 4637a1fcbd52d89b0561b588485e6240eac7b07d
branch: 3.11
author: Brett Cannon <[email protected]>
committer: brettcannon <[email protected]>
date: 2024-03-05T22:05:42Z
summary:
[3.11] GH-116313: get WASI builds to run under wasmtime 18 w/ WASI 0.2/preview2
primitives (GH-116327) (GH-116373) (GH-116384)
(cherry picked from commit 88fdb082d98104dd5612b06397f4c764a0936616)
files:
A Misc/NEWS.d/next/Build/2024-03-04-12-43-42.gh-issue-116313.cLLb8S.rst
M Tools/wasm/wasm_build.py
M configure
M 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
index 00000000000000..61501549060024
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2024-03-04-12-43-42.gh-issue-116313.cLLb8S.rst
@@ -0,0 +1 @@
+Get WASI builds to work under wasmtime 18 w/ WASI 0.2/preview2 primitives.
diff --git a/Tools/wasm/wasm_build.py b/Tools/wasm/wasm_build.py
index 63812c6f3153f2..78c749b8803868 100755
--- a/Tools/wasm/wasm_build.py
+++ b/Tools/wasm/wasm_build.py
@@ -316,8 +316,10 @@ def _check_wasi():
# 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"]],
},
diff --git a/configure b/configure
index cb3db60f9c2322..a1ad0ae25101cd 100755
--- 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=''
;;
diff --git a/configure.ac b/configure.ac
index bbe7f891e7dd29..7b4000fa9c340d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]