Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Stop creating an empty Modules/Setup.local when doing WASI builds as it's
unnecessary.
18 changes: 4 additions & 14 deletions Tools/wasm/wasi/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
CROSS_BUILD_DIR = CHECKOUT / "cross-build"
BUILD_DIR = CROSS_BUILD_DIR / "build"

LOCAL_SETUP = CHECKOUT / "Modules" / "Setup.local"
LOCAL_SETUP_MARKER = "# Generated by Tools/wasm/wasi.py\n".encode("utf-8")

WASMTIME_VAR_NAME = "WASMTIME"
WASMTIME_HOST_RUNNER_VAR = f"{{{WASMTIME_VAR_NAME}}}"

Expand Down Expand Up @@ -140,12 +137,6 @@ def build_python_is_pydebug():
@subdir(BUILD_DIR, clean_ok=True)
def configure_build_python(context, working_dir):
"""Configure the build/host Python."""
if LOCAL_SETUP.exists():
print(f"👍 {LOCAL_SETUP} exists ...")
else:
print(f"📝 Touching {LOCAL_SETUP} ...")
LOCAL_SETUP.write_bytes(LOCAL_SETUP_MARKER)

configure = [os.path.relpath(CHECKOUT / 'configure', working_dir)]
if context.args:
configure.extend(context.args)
Expand Down Expand Up @@ -215,6 +206,10 @@ def configure_wasi_python(context, working_dir):
"https://github.com/WebAssembly/wasi-sdk and/or "
"specify via $WASI_SDK_PATH or --wasi-sdk")

setup_local = CHECKOUT / "Modules" / "Setup.local"
if setup_local.exists():
print(f"⚠️ {setup_local.relative_to(CHECKOUT)} exists")

config_site = os.fsdecode(CHECKOUT / "Tools" / "wasm" / "wasi" / "config.site-wasm32-wasi")

wasi_build_dir = working_dir.relative_to(CHECKOUT)
Expand Down Expand Up @@ -296,11 +291,6 @@ def clean_contents(context):
print(f"🧹 Deleting {CROSS_BUILD_DIR} ...")
shutil.rmtree(CROSS_BUILD_DIR)

if LOCAL_SETUP.exists():
with LOCAL_SETUP.open("rb") as file:
if file.read(len(LOCAL_SETUP_MARKER)) == LOCAL_SETUP_MARKER:
print(f"🧹 Deleting generated {LOCAL_SETUP} ...")


def main():
default_host_runner = (f"{WASMTIME_HOST_RUNNER_VAR} run "
Expand Down
Loading