Skip to content

Bootstrap from a pinned release instead of the Zend cold seed, so the compiler can use its own superset features #105

Closed

Description

@blacktrs

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".

  1. A file in the repository names the bootstrap compiler: the oldest release able to build this tree.
  2. bin/build with no usable local compiler, and CI on a cache miss, fetch that release instead of seeding (the install script and release artefacts already exist).
  3. The release build starts from stage0 too.
  4. 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.
  5. First application: release the Manticore\Ds work (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 let src/ 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/build and CI read.
  • A clean clone builds with bin/build and no php installed.
  • 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.md describes 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 main builds 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

  1. added
    enhancement
    on Oct 6, 2026
  2. added a commit that references this issue on Oct 7, 2026
    9b5e1ad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions