Skip to content

Commit 4637a1f

Browse files
authored
[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 88fdb08)
1 parent 8675e7f commit 4637a1f

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed
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

+4-2
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

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -1580,7 +1580,7 @@ then
15801580
dnl TODO: support other WASI runtimes
15811581
dnl wasmtime starts the proces with "/" as CWD. For OOT builds add the
15821582
dnl directory containing _sysconfigdata to PYTHONPATH.
1583-
[WASI/*], [HOSTRUNNER='wasmtime run --env PYTHONPATH=/$(shell realpath --relative-to $(abs_srcdir) $(abs_builddir))/$(shell cat pybuilddir.txt) --mapdir /::$(srcdir) --'],
1583+
[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)::/'],
15841584
[HOSTRUNNER='']
15851585
)
15861586
fi

0 commit comments

Comments
 (0)