Skip to content

gh-136267: Read the target version from patchlevel.h in build-details.json - #161532

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

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

Conversation

@itamaro

@itamaro itamaro commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

With --with-build-python, the build Python can differ from the target in patch version or release serial, but language.version_info, implementation.version and implementation.hexversion came from the running interpreter. This reads them from Include/patchlevel.h, the same way the Doc build does, with a fallback to sys.version_info when the header is not there.

Written with assistance from Claude Fable 5.1

…etails.json

With --with-build-python, the build Python can differ from the target in
patch version or release serial, but version_info and hexversion came from
the running interpreter. Read them from Include/patchlevel.h instead,
falling back to sys.version_info when the header is not there.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@itamaro
itamaro requested a review from brettcannon November 7, 2026 06:09
@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 15:58
@itamaro
itamaro requested a review from FFY00 as a code owner November 7, 2026 15:58
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