Skip to content

Fix missing Include/pyconfig.h in 3.13 Windows onedirs#284

Merged
dwoz merged 1 commit intosaltstack:mainfrom
dwoz:fix-pyconfig-3.13-windows
May 4, 2026
Merged

Fix missing Include/pyconfig.h in 3.13 Windows onedirs#284
dwoz merged 1 commit intosaltstack:mainfrom
dwoz:fix-pyconfig-3.13-windows

Conversation

@dwoz
Copy link
Copy Markdown
Contributor

@dwoz dwoz commented May 4, 2026

Python <= 3.12 ships PC/pyconfig.h. Python 3.13+ replaced that file with PC/pyconfig.h.in and MSBuild generates the real header into the build output directory. The previous code skipped the copy entirely on 3.13 ("if 3.13 not in ..."), so the produced tarballs had Python.h but no pyconfig.h next to it -- every C extension build against the onedir failed with "fatal error C1083: Cannot open include file: 'pyconfig.h'".

Replace the version-string check with a layout-driven copy that mirrors CPython's PC/layout/main.py: when PC/pyconfig.h.in exists, take the generated header from the PCbuild output directory; otherwise take the checked-in PC/pyconfig.h. Raise if neither is found, so a future regression cannot silently ship broken tarballs.

Add unit tests for both branches plus the missing-file error paths.

Python <= 3.12 ships PC/pyconfig.h. Python 3.13+ replaced that file with
PC/pyconfig.h.in and MSBuild generates the real header into the build
output directory. The previous code skipped the copy entirely on 3.13
("if 3.13 not in ..."), so the produced tarballs had Python.h but no
pyconfig.h next to it -- every C extension build against the onedir
failed with "fatal error C1083: Cannot open include file: 'pyconfig.h'".

Replace the version-string check with a layout-driven copy that mirrors
CPython's PC/layout/main.py: when PC/pyconfig.h.in exists, take the
generated header from the PCbuild output directory; otherwise take the
checked-in PC/pyconfig.h. Raise if neither is found, so a future
regression cannot silently ship broken tarballs.

Add unit tests for both branches plus the missing-file error paths.
@dwoz dwoz merged commit 26fa381 into saltstack:main May 4, 2026
59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant