Skip to content

Commit 88fdb08

Browse files
authored
[3.12] GH-116313: get WASI builds to run under wasmtime 18 w/ WASI 0.2/preview2 primitives (GH-116327) (GH-116373)
1 parent 23a9ba4 commit 88fdb08

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

.devcontainer/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ FROM docker.io/library/fedora:37
22

33
ENV CC=clang
44

5-
ENV WASI_SDK_VERSION=19
5+
ENV WASI_SDK_VERSION=20
66
ENV WASI_SDK_PATH=/opt/wasi-sdk
77

88
ENV WASMTIME_HOME=/opt/wasmtime
9-
ENV WASMTIME_VERSION=7.0.0
9+
ENV WASMTIME_VERSION=18.0.2
1010
ENV WASMTIME_CPU_ARCH=x86_64
1111

1212
RUN dnf -y --nodocs --setopt=install_weak_deps=False install /usr/bin/{blurb,clang,curl,git,ln,tar,xz} 'dnf-command(builddep)' && \
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Get WASI builds to work under wasmtime 18 w/ WASI 0.2/preview2 primitives.

Tools/wasm/wasm_build.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,10 @@ def _check_wasi():
316316
# workaround for https://github.com/python/cpython/issues/95952
317317
"HOSTRUNNER": (
318318
"wasmtime run "
319-
"--env PYTHONPATH=/{relbuilddir}/build/lib.wasi-wasm32-{version}:/Lib "
320-
"--mapdir /::{srcdir} --"
319+
"--wasm max-wasm-stack=8388608 "
320+
"--wasi preview2 "
321+
"--dir {srcdir}::/ "
322+
"--env PYTHONPATH=/{relbuilddir}/build/lib.wasi-wasm32-{version}:/Lib"
321323
),
322324
"PATH": [WASI_SDK_PATH / "bin", os.environ["PATH"]],
323325
},

configure

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1601,7 +1601,7 @@ then
16011601
dnl TODO: support other WASI runtimes
16021602
dnl wasmtime starts the proces with "/" as CWD. For OOT builds add the
16031603
dnl directory containing _sysconfigdata to PYTHONPATH.
1604-
[WASI/*], [HOSTRUNNER='wasmtime run --env PYTHONPATH=/$(shell realpath --relative-to $(abs_srcdir) $(abs_builddir))/$(shell cat pybuilddir.txt):/Lib --mapdir /::$(srcdir) --'],
1604+
[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)::/'],
16051605
[HOSTRUNNER='']
16061606
)
16071607
fi

0 commit comments

Comments
 (0)