https://github.com/python/cpython/commit/eab2d16b0b5497ed008286e510e219d6758bfa14
commit: eab2d16b0b5497ed008286e510e219d6758bfa14
branch: main
author: Brett Cannon <[email protected]>
committer: brettcannon <[email protected]>
date: 2026-10-05T16:09:17-07:00
summary:

GH-158878: Stop creating `Modules/Setup.local` as part of building for WASI 
(GH-158879)

This makes it so the build process no longer needs to modify the source 
checkout itself.

files:
A Misc/NEWS.d/next/Build/2026-10-05-12-15-57.gh-issue-158878.KWLqLy.rst
M Platforms/WASI/_build.py
M Platforms/WASI/_shared.py

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 000000000000000..961e4db00efd0c6
--- /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 fff7e3f9f8cdada..f73f112bdf9eb17 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 ee1a65859a1a4d1..6c4cb156739d511 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:

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to