summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.devcontainer/Dockerfile2
-rw-r--r--Misc/NEWS.d/next/Build/2024-03-04-12-43-42.gh-issue-116313.cLLb8S.rst1
-rw-r--r--Tools/wasm/wasi.py6
-rwxr-xr-xTools/wasm/wasm_build.py6
-rwxr-xr-xconfigure2
-rw-r--r--configure.ac2
6 files changed, 12 insertions, 7 deletions
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
index 9f808af..3657564 100644
--- a/.devcontainer/Dockerfile
+++ b/.devcontainer/Dockerfile
@@ -6,7 +6,7 @@ ENV WASI_SDK_VERSION=20
ENV WASI_SDK_PATH=/opt/wasi-sdk
ENV WASMTIME_HOME=/opt/wasmtime
-ENV WASMTIME_VERSION=14.0.4
+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/wasi.py b/Tools/wasm/wasi.py
index 1e75db5..efb005e 100644
--- a/Tools/wasm/wasi.py
+++ b/Tools/wasm/wasi.py
@@ -283,8 +283,10 @@ def main():
# The 8388608 value comes from `ulimit -s` under Linux
# which equates to 8291 KiB.
"--wasm max-wasm-stack=8388608 "
- # Enable thread support.
- "--wasm threads=y --wasi threads=y "
+ # Use WASI 0.2 primitives.
+ "--wasi preview2 "
+ # Enable thread support; causes use of preview1.
+ #"--wasm threads=y --wasi threads=y "
# Map the checkout to / to load the stdlib from /Lib.
"--dir {HOST_DIR}::{GUEST_DIR} "
# Set PYTHONPATH to the sysconfig data.
diff --git a/Tools/wasm/wasm_build.py b/Tools/wasm/wasm_build.py
index c0b9999..47a0abb 100755
--- a/Tools/wasm/wasm_build.py
+++ b/Tools/wasm/wasm_build.py
@@ -329,8 +329,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 4a980fe..c758749 100755
--- a/configure
+++ b/configure
@@ -7655,7 +7655,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 103c249..80d0a7e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1537,7 +1537,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