]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-135151: Fix incorrect packaging of pyconfig.h in Windows installer (GH...
authorSteve Dower <steve.dower@python.org>
Thu, 5 Jun 2025 22:03:38 +0000 (23:03 +0100)
committerGitHub <noreply@github.com>
Thu, 5 Jun 2025 22:03:38 +0000 (23:03 +0100)
Doc/howto/free-threading-extensions.rst
Misc/NEWS.d/next/Windows/2025-06-05-13-52-36.gh-issue-135151.4PfNZQ.rst [new file with mode: 0644]
Tools/msi/dev/dev_files.wxs

index 882e39416a2d4bc687135916feeef575ea091c4e..c7d1c00cd17d40f3a50c13268a9fc45b723470aa 100644 (file)
@@ -23,6 +23,14 @@ You can use it to enable code that only runs under the free-threaded build::
     /* code that only runs in the free-threaded build */
     #endif
 
+.. note::
+
+   On Windows, this macro is not defined automatically, but must be specified
+   to the compiler when building. The :func:`sysconfig.get_config_var` function
+   can be used to determine whether the current running interpreter had the
+   macro defined.
+
+
 Module Initialization
 =====================
 
diff --git a/Misc/NEWS.d/next/Windows/2025-06-05-13-52-36.gh-issue-135151.4PfNZQ.rst b/Misc/NEWS.d/next/Windows/2025-06-05-13-52-36.gh-issue-135151.4PfNZQ.rst
new file mode 100644 (file)
index 0000000..06039a8
--- /dev/null
@@ -0,0 +1,3 @@
+Avoid distributing modified :file:`pyconfig.h` in the traditional installer.
+Extension module builds must always specify ``Py_GIL_DISABLED`` when
+targeting the free-threaded runtime.
index 4357dc86d9d3564ea4de88b3b0befc8802437b50..d7c8e9007e40a484bf0261ca51ce886b9be73d46 100644 (file)
@@ -3,7 +3,8 @@
     <Fragment>
         <ComponentGroup Id="dev_pyconfig">
             <Component Id="include_pyconfig.h" Directory="include" Guid="*">
-                <File Id="include_pyconfig.h" Name="pyconfig.h" Source="pyconfig.h" KeyPath="yes" />
+                <!-- gh-135151 Always use the unmodified header for the installer. -->
+                <File Id="include_pyconfig.h" Name="pyconfig.h" Source="!(bindpath.src)PC\pyconfig.h.in" KeyPath="yes" />
             </Component>
         </ComponentGroup>
     </Fragment>