Skip to content

Commit b002dba

Browse files
authored
Add symlink creation for pybuilddir.txt
1 parent b76f1f9 commit b002dba

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

Tools/wasm/wasi/__main__.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,10 @@ def configure_wasi_python(context, working_dir):
368368
file.write(f'#!/bin/sh\nexec {host_runner} {python_wasm} "$@"\n')
369369
exec_script.chmod(0o755)
370370
log("🏃", f"Created {exec_script} (--host-runner)... ")
371+
pybuilddir_txt = working_dir / "pybuilddir.txt"
372+
if not pybuilddir_txt.exists():
373+
os.symlink(CHECKOUT / "pybuilddir.txt", pybuilddir_txt)
374+
log("📝", f"Symlinked {pybuilddir_txt} to normal location")
371375
sys.stdout.flush()
372376

373377

@@ -399,6 +403,11 @@ def clean_contents(context):
399403
if LOCAL_SETUP.read_bytes() == LOCAL_SETUP_MARKER:
400404
log("🧹", f"Deleting generated {LOCAL_SETUP} ...")
401405

406+
pybuilddir_txt = working_dir / "pybuilddir.txt"
407+
if pybuilddir_txt.exists():
408+
log("🧹", f"Deleting {pybuilddir_txt} ...")
409+
pybuilddir_txt.unlink()
410+
402411

403412
def build_steps(*steps):
404413
"""Construct a command from other steps."""
@@ -421,8 +430,6 @@ def main():
421430
"--wasm max-wasm-stack=16777216 "
422431
# Enable thread support; causes use of preview1.
423432
# "--wasm threads=y --wasi threads=y "
424-
# Set argv0 to the Python process
425-
"--argv0 {PYTHON_WASM} "
426433
# Map the checkout to / to load the stdlib from /Lib.
427434
"--dir {HOST_DIR}::{GUEST_DIR} "
428435
# Set PYTHONPATH to the sysconfig data.

0 commit comments

Comments
 (0)