From b4e52db23f16609eff3feb8592a2152b9797dcb4 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Fri, 14 Aug 2026 06:42:35 -0700 Subject: [PATCH] [3.12] GH-155757: Set `--argv0` for wasmtime (GH-155758) (cherry picked from commit 06ba5f48e0ebdb8cfec0f251c61fb10831b23617) Co-authored-by: Brett Cannon --- .../next/Build/2026-08-13-12-57-27.gh-issue-155757._5cg0h.rst | 3 +++ Tools/wasm/wasm_build.py | 1 + 2 files changed, 4 insertions(+) create mode 100644 Misc/NEWS.d/next/Build/2026-08-13-12-57-27.gh-issue-155757._5cg0h.rst 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 78c749b88038689..7061954d839d2d2 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" ),