https://github.com/python/cpython/commit/88fdb082d98104dd5612b06397f4c764a0936616
commit: 88fdb082d98104dd5612b06397f4c764a0936616
branch: 3.12
author: Brett Cannon <[email protected]>
committer: brettcannon <[email protected]>
date: 2024-03-05T13:35:02-08:00
summary:
[3.12] GH-116313: get WASI builds to run under wasmtime 18 w/ WASI
0.2/preview2 primitives (GH-116327) (GH-116373)
files:
A Misc/NEWS.d/next/Build/2024-03-04-12-43-42.gh-issue-116313.cLLb8S.rst
M .devcontainer/Dockerfile
M Tools/wasm/wasm_build.py
M configure
M configure.ac
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
index efbdcd402cdf67..365756458bba30 100644
--- a/.devcontainer/Dockerfile
+++ b/.devcontainer/Dockerfile
@@ -2,11 +2,11 @@ FROM docker.io/library/fedora:37
ENV CC=clang
-ENV WASI_SDK_VERSION=19
+ENV WASI_SDK_VERSION=20
ENV WASI_SDK_PATH=/opt/wasi-sdk
ENV WASMTIME_HOME=/opt/wasmtime
-ENV WASMTIME_VERSION=7.0.0
+ENV WASMTIME_VERSION=18.0.2
ENV WASMTIME_CPU_ARCH=x86_64
RUN dnf -y --nodocs --setopt=install_weak_deps=False install
/usr/bin/{blurb,clang,curl,git,ln,tar,xz} 'dnf-command(builddep)' && \
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 c9947057a90754..f6e26296566551 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 e962a6aed12d27..938b6c6252406a 100755
--- a/configure
+++ b/configure
@@ -7720,7 +7720,7 @@ then :
fi
;; #(
WASI/*) :
- HOSTRUNNER='wasmtime run --env PYTHONPATH=/$(shell realpath --relative-to
$(abs_srcdir) $(abs_builddir))/$(shell cat pybuilddir.txt):/Lib --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 384718db1f08d9..b3eaaa92464915 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1601,7 +1601,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):/Lib
--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]