Repository navigation
Description
Problem
The compiler is self-hosted, but its last line of defence is still the Zend cold seed: when no native compiler can build the tree, bin/build --seed runs the compiler's own src/ under php. That keeps src/ tied to what Zend can execute, so the compiler cannot use its own superset features (Manticore\Ds containers, #[TypeDef] over them, inline generics) in its own source — exactly the code that would benefit most (symbol tables, id sets, node maps).
Today the seed is reached in four situations:
- a bootstrap gap in CI (the cached compiler and the published
main-<platform>image both fail to build the tree); - a commit that adds a feature and uses it in
src/in the same merge — the previous generation cannot build it, and the seed hides that; - the release build, which cold-seeds from source;
- a clean clone or a platform with no cache and no published image.
Once src/ stops being Zend-runnable, each of these becomes a dead end.
Proposal
Bootstrap from a pinned previous release (stage0), the way Go and Rust do, and demote the Zend seed from "fallback" to "optional while it still works".
- A file in the repository names the bootstrap compiler: the oldest release able to build this tree.
bin/buildwith no usable local compiler, and CI on a cache miss, fetch that release instead of seeding (the install script and release artefacts already exist).- The release build starts from stage0 too.
- Rule, written into
AGENTS.md: a feature ships in release N;src/may use it only after the pin is raised to N. A merge that needs a newer compiler than the pin fails in CI with a message saying so. - First application: release the
Manticore\Dswork (Native fixed-layout containers: SplFixedArray on a native buffer and Manticore\Ds typed arrays #92, Manticore\Ds, next parts: check hoisting, typed element reprs, growable and byte buffers, SPL family on the native buffer #101), raise the pin to it, then letsrc/use the containers.
Out of scope
Removing the Zend seed outright; rewriting any part of src/ onto the new containers (follow-up work, measured on the self-build peak memory and front-end time); reproducible-from-source builds without walking the release chain.
Acceptance criteria
- A pinned bootstrap version lives in the repository and is the single source both
bin/buildand CI read. - A clean clone builds with
bin/buildand nophpinstalled. - CI on a cold cache, for every platform in the matrix, builds from the pinned release, not from Zend.
- The release workflow builds from the pinned release.
- A change that uses a feature newer than the pin fails CI with an explicit bootstrap error, not a silent seed.
-
AGENTS.mddescribes the two-step rule (ship the feature, raise the pin, then use it) in place of the cold-seed fallback. - The pin has been raised once end to end (the Ds release), and the next
mainbuilds from it on every platform.
Risks
- Rebuilding everything from source alone means walking the chain of releases.
- A broken or withdrawn release in the chain blocks every build without a cache; release artefacts become critical infrastructure.
Activity
Bootstrap from the pinned release instead of the Zend cold seed (#112)