Skip to content

Link only bootstrap modules into CPython build helpers - #1395

Draft
zaniebot wants to merge 1 commit into
astral-sh:mainfrom
zaniebot:bootstrap-module-build-helpers
Draft

zaniebot wants to merge 1 commit into
astral-sh:mainfrom
zaniebot:bootstrap-module-build-helpers

Conversation

@zaniebot

@zaniebot zaniebot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

On a native CPython 3.12 build with MODULE_BUILDTYPE=static, Programs/_freeze_module fails to link because _testinternalcapi references _Py_Get_Getpath_CodeObject. The function is defined in Modules/getpath.o, which depends on a header generated by the freezer. Backport python/cpython#160537 to link the build helpers with the modules in Modules/Setup.bootstrap. This removes the host-freezer workaround and keeps _testinternalcapi in the shipped interpreter.

Exclude helper-only object files from the distribution to avoid duplicate symbols and entry points when downstream consumers relink the interpreter. Cross builds continue to freeze modules with the matching host Python.

@zaniebot
zaniebot force-pushed the bootstrap-module-build-helpers branch from 0fe56bc to c395e85 Compare October 23, 2026 23:51
@zaniebot
zaniebot force-pushed the bootstrap-module-build-helpers branch from c395e85 to 8a037c7 Compare October 23, 2026 23:54

This branch has not been deployed

No deployments
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