Skip to content

Commit dbe1bed

Browse files
committed
Manually cherry-pick 180d58c
1 parent c5c5160 commit dbe1bed

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

Platforms/WASI/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
def main():
1515
default_host_runner = (
16-
f"{WASMTIME} run "
16+
"{WASMTIME} run "
1717
# Set argv0 so that getpath.py can auto-discover the sysconfig data directory.
1818
"--argv0 {ARGV0} "
1919
# Map the checkout to / to load the stdlib from /Lib.

Platforms/WASI/_build.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -337,22 +337,9 @@ def configure_wasi_python(context, working_dir):
337337

338338
wasi_build_dir = working_dir.relative_to(CHECKOUT)
339339

340-
python_build_dir = BUILD_DIR / "build"
341-
lib_dirs = list(python_build_dir.glob("lib.*"))
342-
assert len(lib_dirs) == 1, (
343-
f"Expected a single lib.* directory in {python_build_dir}"
344-
)
345-
lib_dir = os.fsdecode(lib_dirs[0])
346-
python_version = lib_dir.rpartition("-")[-1]
347-
sysconfig_data_dir = (
348-
f"{wasi_build_dir}/build/lib.wasi-wasm32-{python_version}"
349-
)
350-
351-
# Use PYTHONPATH to include sysconfig data which must be anchored to the
352-
# WASI guest's `/` directory.
353340
args = {
354341
"WASMTIME": "wasmtime",
355-
"PYTHONPATH": f"/{sysconfig_data_dir}",
342+
"ARGV0": f"/{wasi_build_dir}/python.wasm",
356343
"CHECKOUT": os.fsdecode(CHECKOUT),
357344
"WASMTIME_CONFIG_PATH": os.fsdecode(HERE / "wasmtime.toml"),
358345
}

0 commit comments

Comments
 (0)