Skip to content

gh-136267: Use the target configuration in build-details.json - #161529

Open
itamaro wants to merge 1 commit into
python:mainfrom
itamaro:gh-136267-target-build-details
Open

itamaro wants to merge 1 commit into
python:mainfrom
itamaro:gh-136267-target-build-details

Conversation

@itamaro

@itamaro itamaro commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

With --with-build-python, generate-build-details.py runs on an interpreter other than the one being built. abi.flags, suffixes.extensions, abi.stable_abi_suffix and supports_isolated_interpreters came from sys and importlib, so they described the build interpreter. This reads them from sysconfig instead. The suffix list is rebuilt the way dynload_shlib.c builds it, and a test checks the result against importlib.machinery.EXTENSION_SUFFIXES on native builds.

Also sets abi.extension_suffix and abi.stable_abi_suffix for static libpython builds. PEP 739 requires them whenever extension modules are supported; they were only emitted with a shared libpython (rust-cross/manylinux-cross#165).

Tested with ./configure --disable-gil --with-build-python=<GIL-enabled debug python> && make build-details.json: the file now has ["t"] and the free-threaded suffix list instead of the build interpreter's ["d"] and its list.

Written with assistance from Claude Fable 5.1

With --with-build-python, generate-build-details.py runs on a different
interpreter than the one being built. abi.flags, suffixes.extensions,
abi.stable_abi_suffix and supports_isolated_interpreters came from sys and
importlib, so they described the build interpreter. Read them from
sysconfig instead. The extension suffix list is rebuilt the same way
Python/dynload_shlib.c builds it; a test checks that the result matches
importlib.machinery.EXTENSION_SUFFIXES on native builds.

Also set abi.extension_suffix and abi.stable_abi_suffix for static
libpython builds. They were only set with a shared libpython, but
extension modules work either way and PEP 739 requires them.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@itamaro
itamaro requested a review from brettcannon November 7, 2026 04:33
@itamaro itamaro added build The build process and cross-build needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Nov 7, 2026
@itamaro
itamaro marked this pull request as ready for review November 7, 2026 06:07
@itamaro
itamaro requested a review from FFY00 as a code owner November 7, 2026 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review build The build process and cross-build needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant