diff options
author | Brett Cannon <brett@python.org> | 2024-03-05 08:18:53 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-05 08:18:53 (GMT) |
commit | 7af063d1d85f965da06a65eca800f4c537d55fa5 (patch) | |
tree | 2c0e03620125639779d8133c81579a8cba33323f /Tools | |
parent | 6cddc731fb59edb66b64b7a8dbd9e281309a8384 (diff) | |
download | cpython-7af063d1d85f965da06a65eca800f4c537d55fa5.zip cpython-7af063d1d85f965da06a65eca800f4c537d55fa5.tar.gz cpython-7af063d1d85f965da06a65eca800f4c537d55fa5.tar.bz2 |
GH-116313: get WASI builds to run under wasmtime 18 w/ WASI 0.2/preview2 primitives (#116327)
* GH-116313: get WASI builds to run under wasmtime 18 w/ WASI 0.2/preview2 primitives
* Add the configure changes
* Update `wasm_build.py`
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/wasm/wasi.py | 6 | ||||
-rwxr-xr-x | Tools/wasm/wasm_build.py | 6 |
2 files changed, 8 insertions, 4 deletions
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"]], }, |