[3.13] gh-135151: Fix incorrect packaging of pyconfig.h in Windows installer (GH-135180)

This commit is contained in:
Steve Dower 2025-06-05 23:03:38 +01:00 committed by GitHub
parent 922dc2ccb0
commit 728a881321
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 1 deletions

View 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
=====================

View file

@ -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.

View 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>