Skip to content

Commit

Permalink
[3.11] GH-116313: get WASI builds to run under wasmtime 18 w/ WASI 0.…
Browse files Browse the repository at this point in the history
…2/preview2 primitives (GH-116327) (GH-116373) (GH-116384)

(cherry picked from commit 88fdb08)
  • Loading branch information
brettcannon committed Mar 5, 2024
1 parent 8675e7f commit 4637a1f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
@@ -0,0 +1 @@
Get WASI builds to work under wasmtime 18 w/ WASI 0.2/preview2 primitives.
6 changes: 4 additions & 2 deletions Tools/wasm/wasm_build.py
Expand Up @@ -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"]],
},
Expand Down
2 changes: 1 addition & 1 deletion configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -1580,7 +1580,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) --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
Expand Down

0 comments on commit 4637a1f

Please sign in to comment.