summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2024-03-05 21:35:02 (GMT)
committerGitHub <noreply@github.com>2024-03-05 21:35:02 (GMT)
commit88fdb082d98104dd5612b06397f4c764a0936616 (patch)
treeb97cf0d80fa58f208adc90c9791c93643c2f185a
parent23a9ba45ae59217b53bb656fe040ed3817c09998 (diff)
downloadcpython-88fdb082d98104dd5612b06397f4c764a0936616.zip
cpython-88fdb082d98104dd5612b06397f4c764a0936616.tar.gz
cpython-88fdb082d98104dd5612b06397f4c764a0936616.tar.bz2
[3.12] GH-116313: get WASI builds to run under wasmtime 18 w/ WASI 0.2/preview2 primitives (GH-116327) (GH-116373)
-rw-r--r--.devcontainer/Dockerfile4
-rw-r--r--Misc/NEWS.d/next/Build/2024-03-04-12-43-42.gh-issue-116313.cLLb8S.rst1
-rwxr-xr-xTools/wasm/wasm_build.py6
-rwxr-xr-xconfigure2
-rw-r--r--configure.ac2
5 files changed, 9 insertions, 6 deletions
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
index efbdcd4..3657564 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 0000000..6150154
--- /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 c994705..f6e2629 100755
--- a/Tools/wasm/wasm_build.py
+++ b/Tools/wasm/wasm_build.py
@@ -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"]],
},
diff --git a/configure b/configure
index e962a6a..938b6c6 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 384718d..b3eaaa9 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