gh-133779: Revert Windows generation of pyconfig.h and go back to a static header. (GH-133966)

Extension builders must specify Py_GIL_DISABLED if they want to link to the free-threaded builds.
This was usually the case already, but this change guarantees it in all circumstances.
This commit is contained in:
Steve Dower 2025-05-19 11:35:22 +01:00 committed by GitHub
parent d55e11b804
commit 986c367028
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 63 additions and 78 deletions

View file

@ -3,7 +3,7 @@
<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" />
<File Id="include_pyconfig.h" Name="pyconfig.h" Source="!(bindpath.src)PC\pyconfig.h" KeyPath="yes" />
</Component>
</ComponentGroup>
</Fragment>

View file

@ -108,6 +108,8 @@ def compile_c_extension(
extra_compile_args.append("-DPy_BUILD_CORE_MODULE")
# Define _Py_TEST_PEGEN to not call PyAST_Validate() in Parser/pegen.c
extra_compile_args.append("-D_Py_TEST_PEGEN")
if sys.platform == "win32" and sysconfig.get_config_var("Py_GIL_DISABLED"):
extra_compile_args.append("-DPy_GIL_DISABLED")
extra_link_args = get_extra_flags("LDFLAGS", "PY_LDFLAGS_NODIST")
if keep_asserts:
extra_compile_args.append("-UNDEBUG")