diff --git a/Misc/NEWS.d/next/Build/2026-08-13-12-57-27.gh-issue-155757._5cg0h.rst b/Misc/NEWS.d/next/Build/2026-08-13-12-57-27.gh-issue-155757._5cg0h.rst new file mode 100644 index 000000000000000..5113bc93d937015 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2026-08-13-12-57-27.gh-issue-155757._5cg0h.rst @@ -0,0 +1,3 @@ +Set the ``--argv0`` argument to wasmtime for WASI builds so the test suite +passes. Otherwise the calculated paths to the stdlib for frozen modules is +incorrect. diff --git a/Tools/wasm/wasm_build.py b/Tools/wasm/wasm_build.py index f6e262965665510..6582b570a816b54 100755 --- a/Tools/wasm/wasm_build.py +++ b/Tools/wasm/wasm_build.py @@ -318,6 +318,7 @@ def _check_wasi(): "wasmtime run " "--wasm max-wasm-stack=8388608 " "--wasi preview2 " + "--argv0 /{relbuilddir}/python.wasm " "--dir {srcdir}::/ " "--env PYTHONPATH=/{relbuilddir}/build/lib.wasi-wasm32-{version}:/Lib" ),