From e7cfada3725d0083186e69f4b40263c1e0c37836 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Mon, 5 Oct 2026 12:20:55 -0700 Subject: [PATCH] GH-158878: Stop creating `Modules/Setup.local` as part of building for WASI This makes it so the build process no longer needs to modify the source checkout itself. --- ...-10-05-12-15-57.gh-issue-158878.KWLqLy.rst | 2 ++ Platforms/WASI/_build.py | 24 ------------------- Platforms/WASI/_shared.py | 4 ---- 3 files changed, 2 insertions(+), 28 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2026-10-05-12-15-57.gh-issue-158878.KWLqLy.rst diff --git a/Misc/NEWS.d/next/Build/2026-10-05-12-15-57.gh-issue-158878.KWLqLy.rst b/Misc/NEWS.d/next/Build/2026-10-05-12-15-57.gh-issue-158878.KWLqLy.rst new file mode 100644 index 00000000000000..961e4db00efd0c --- /dev/null +++ b/Misc/NEWS.d/next/Build/2026-10-05-12-15-57.gh-issue-158878.KWLqLy.rst @@ -0,0 +1,2 @@ +Stop creating an empty Modules/Setup.local file as it no longer seems to be +required to statically link the extension modules. diff --git a/Platforms/WASI/_build.py b/Platforms/WASI/_build.py index fff7e3f9f8cdad..f73f112bdf9eb1 100644 --- a/Platforms/WASI/_build.py +++ b/Platforms/WASI/_build.py @@ -25,11 +25,6 @@ import _shared -LOCAL_SETUP_MARKER = ( - b"# Generated by Platforms/WASI .\n" - b"# Required to statically build extension modules." -) - WASMTIME_VAR_NAME = "WASMTIME" WASMTIME_HOST_RUNNER_VAR = f"{{{WASMTIME_VAR_NAME}}}" @@ -147,18 +142,6 @@ def call(command, *, context=None, quiet=False, **kwargs): @subdir("build_python_path", clean_ok=True) def configure_build_python(context, working_dir): """Configure the build/host Python.""" - if context.setup_local_path.exists(): - if context.setup_local_path.read_bytes() == LOCAL_SETUP_MARKER: - _shared.log("๐Ÿ‘", f"{context.setup_local_path} exists ...") - else: - _shared.log( - "โš ๏ธ", - f"{context.setup_local_path} exists, but has unexpected contents", - ) - else: - _shared.log("๐Ÿ“", f"Creating {context.setup_local_path} ...") - context.setup_local_path.write_bytes(LOCAL_SETUP_MARKER) - configure = [os.path.relpath(context.checkout / "configure", working_dir)] if context.args: configure.extend(context.args) @@ -300,13 +283,6 @@ def clean_contents(context): _shared.log("๐Ÿงน", f"Deleting {context.cross_build_path} ...") shutil.rmtree(context.cross_build_path) - if context.setup_local_path.exists(): - if context.setup_local_path.read_bytes() == LOCAL_SETUP_MARKER: - _shared.log( - "๐Ÿงน", f"Deleting generated {context.setup_local_path} ..." - ) - context.setup_local_path.unlink() - @subdir("build_python_path") def pythoninfo_build_python(context, working_dir): diff --git a/Platforms/WASI/_shared.py b/Platforms/WASI/_shared.py index ee1a65859a1a4d..6c4cb156739d51 100644 --- a/Platforms/WASI/_shared.py +++ b/Platforms/WASI/_shared.py @@ -40,10 +40,6 @@ def _pybuilddir(self, build_path): relative_dir = (build_path / "pybuilddir.txt").read_text().strip() return build_path / relative_dir - @functools.cached_property - def setup_local_path(self): - return self.checkout / "Modules" / "Setup.local" - @functools.cached_property def host_triple(self): if self._host_triple: