[Homebrew/Python] Build CPython and its standard library inside the core tap - #124
Draft
brandonpayton wants to merge 9 commits into
Draft
[Homebrew/Python] Build CPython and its standard library inside the core tap#124brandonpayton wants to merge 9 commits into
brandonpayton wants to merge 9 commits into
Conversation
brandonpayton
changed the base branch from
main
to
homebrew/close-shell-demo-recipes-qk044
July 29, 2026 04:08
brandonpayton
force-pushed
the
packaging/python-schema3-qk044
branch
from
July 29, 2026 04:08
84c1c5b to
bfd066e
Compare
brandonpayton
force-pushed
the
homebrew/close-shell-demo-recipes-qk044
branch
3 times, most recently
from
July 29, 2026 12:13
e705a19 to
a9bddb5
Compare
brandonpayton
force-pushed
the
packaging/python-schema3-qk044
branch
from
July 29, 2026 15:03
bfd066e to
fe690f8
Compare
brandonpayton
changed the base branch from
homebrew/close-shell-demo-recipes-qk044
to
main
July 29, 2026 15:03
brandonpayton
force-pushed
the
packaging/python-schema3-qk044
branch
from
July 29, 2026 15:04
fe690f8 to
848fe93
Compare
Consume the SDK config-site path that the privileged Kandelo runner derives from its sealed platform projection. Reject any build-script assignment so Formula-controlled recipe code cannot redirect shared target facts back to broad repository authority. Refresh the attested recipe records and Formula manifest identity.
The current recipe runner projects fork instrumentation directly and withholds the broad Kandelo checkout. Use that executable, remove the obsolete checkout-derived prefix map, and lock the expanded compiler wrapper checks into Python's authenticated recipe manifest.
The protected recipe runner already supplies an attested LLVM projection. Use its exact paths for CPython native generators instead of adding Homebrew LLVM, whose prefix-config symlink correctly falls outside the closed native dependency projection.
cp -a preserves the sealed sysroot directory modes. Make the recipe-owned lib copy writable before adding CPython’s required WASI emulation archives, while leaving the publisher-owned source untouched.
CPython supports --with-build-python from any interpreter with the same major and minor version. Use the sealed python@3.13 dependency for that role instead of treating the Kandelo target LLVM as a native compiler.
brandonpayton
force-pushed
the
packaging/python-schema3-qk044
branch
from
July 29, 2026 16:14
6026b83 to
21a1b07
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Python still depends on Kandelo's legacy package registry for its source
build. That prevents the core tap from owning the complete recipe and
blocks retirement of the registry entry.
Cross-compiling CPython also requires a native Python from the same
major/minor release. That interpreter must be a declared, sealed build
input. An ambient host Python would make the bottle depend on whichever
tool happened to be installed on the CI runner.
What changed
checksum-verified upstream source.
python@3.13as the native build interpreter, usingCPython's supported
--with-build-pythoncontract.Cellar/python@3.13/<version>keg, be read-only, and report version3.13.
contracts.
python,python3, andpython3.13.both Node and Chromium.
Python remains wasm32-only. This change does not add a language-specific
VFS image; lazy image composition can select the Python bottle.
Closed build boundary
The Kandelo runner seals the native Homebrew keg and its complete
dependency closure before the recipe starts. The recipe then verifies
that
python3.13did not fall back to/usror another ambient path.The runner also supplies target configuration and fork instrumentation
from the exact Kandelo revision chosen by the publisher. Formula or
recipe code cannot substitute a checkout or a different tool.
The recipe copies the read-only sysroot into private working storage and
opens only that copy before adding CPython's required WASI emulation
archives.
Inline
WHYcomments preserve these non-obvious authority andreproducibility decisions.
Validation
brew style Formula/python.rbreports no offenses.git diff --checkpasses.Dry-run investigation established three separate packaging boundaries:
loader.
The recipe now uses the declared native
python@3.13dependency insteadof attempting that invalid compiler bootstrap. The first attempt of dry
run
30469839479, on runner image20260726.254.1, rejected therunner's unconditional
/usrprojection before the recipe started.That is runner-instance evidence, not a stable runner contract; this PR
does not weaken the rejection or expose more host state.
The exact retry and exact-head control
30471174839, both on runnerimage
20260720.247.2, crossed that boundary. The control installed thedeclared
Cellar/python@3.13/3.13.14_1keg, passed the keg-pathassertion, and built the target bottle: 750 files and 28 MB in 3 minutes
39 seconds.
Both builds then reached the shared Formula runtime and failed before
Python executed because
programs/dash.wasmhad no matching selectedpackage projection. They used Kandelo commit
85d2efc, which predatesthe central resolver fix in Automattic/kandelo#1136. Further expensive
retries are parked until Automattic/kandelo#1138 lands and the tap
rotates trust to its new exact publisher commits.
The existing bottle block remains last-green evidence until an exact
protected build replaces it. This draft must still pass the live Node
and Chromium Formula lifecycle before merge.