diff --git a/Misc/NEWS.d/next/Build/2025-07-23-10-13-22.gh-issue-137049.FsfJWk.rst b/Misc/NEWS.d/next/Build/2025-07-23-10-13-22.gh-issue-137049.FsfJWk.rst new file mode 100644 index 00000000000000..022a861d7b4181 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2025-07-23-10-13-22.gh-issue-137049.FsfJWk.rst @@ -0,0 +1,2 @@ +Stop creating an empty Modules/Setup.local when doing WASI builds as it's +unnecessary. diff --git a/Tools/wasm/wasi/__main__.py b/Tools/wasm/wasi/__main__.py index 54ccc95157d57d..16f9e7e12b920f 100644 --- a/Tools/wasm/wasi/__main__.py +++ b/Tools/wasm/wasi/__main__.py @@ -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}}}" @@ -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) @@ -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) @@ -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 "