Skip to content

feat: merge-train/fairies - #25153

Open
AztecBot wants to merge 5 commits into
nextfrom
merge-train/fairies
Open

feat: merge-train/fairies#25153
AztecBot wants to merge 5 commits into
nextfrom
merge-train/fairies

Conversation

@AztecBot

@AztecBot AztecBot commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

BEGIN_COMMIT_OVERRIDE
chore(ci): dual-mode labs-aztec-toolchain provisioning and hashing (#25151)
END_COMMIT_OVERRIDE

fcarreiro and others added 3 commits August 10, 2026 10:10
…25151)

Unifies `labs-aztec-toolchain/bootstrap.sh` so one file serves the three
contexts that need it: the monorepo today, the standalone labs repo
after the split, and the foundation repo after the split (which deletes
the labs components, consumes them as a submodule, and runs labs e2e
against its own locally built bb/noir — the pre-split flow). Today the
next and monorepo-split/labs lines carry divergent copies of this file
that conflict on every sync merge; this converges them so the only
intended difference is one committed default.

## The mode protocol

A single variable selects the provisioning mode:

- **Foundation mode** (`FND_ROOT` non-empty): symlink the binaries built
inside the checkout at `FND_ROOT` (`barretenberg/cpp`, the `noir`
submodule), and derive the toolchain identity from that tree's source
hashes. This is `build_monorepo` + the #25111 hash, with the root
parameterized.
- **Pinned mode** (`FND_ROOT` empty): download released binaries at the
pinned `BB_VERSION`/`NOIR_VERSION` (the monorepo-split/labs flow:
bbup/noirup, cached acvm source build, `.pin` provenance record,
`check_pin_drift`), and derive the identity from this directory's
committed content.

The committed default on this line is `FND_ROOT=$(git rev-parse
--show-toplevel)` — foundation mode, today's behavior — so a bare
invocation keeps linking the local build. `AZTEC_TOOLCHAIN_FND_ROOT`
overrides either way: export it empty to force pinned mode, or point it
at a foundation checkout root (how the post-split foundation repo will
drive its labs submodule). The labs line will carry the same file with
an empty default (follow-up PR against monorepo-split/labs).

## Hash semantics

- **Foundation mode**: byte-identical inputs to the current
(post-#25111) hash — providers' source hashes plus observed optional
binaries. Verified the value is unchanged on this tree
(`ce12057b4ea229fb` before and after), so **no cache invalidation on
this line**.
- **Pinned mode**: `cache_content_hash "^labs-aztec-toolchain/"` plus
the declaratively expected optionals (bb-avm iff released for this
platform, acvm iff cargo exists). This replaces the labs line's current
byte-hashing of `bin/`, completing the identity/verification separation
#25111 started: the hash is a pure function of the committed tree
(computable on a fresh checkout — today `hash` fails until `build` has
run, which downstream hash compositions trip over), a corrupted `bin/`
can no longer mint a fresh valid-looking cache key (byte verification
stays in the `.pin` record at provision time), a pin bump still moves
the hash before any binary is refreshed, and a dirty toolchain dir
propagates `disabled-cache` instead of laundering it into a
stable-looking key.

## Other behavior notes

- Foundation-mode `build` now starts from an empty `bin/` and writes the
`.pin` record (previously labs-line-only), so switching between modes in
one checkout fully re-provisions, and `noir_version` can report the
exact submodule tag (e.g. `nightly-2026-07-31`) instead of nargo's base
cargo version; it falls back to the binary when no record exists.
- Pinned mode on this line is exercisable via the override but
`check_pin_drift` will legitimately fail while next's
Nargo.toml/docs/yarn-project pins differ from the labs line's — expected
until the split content converges.
- Call-site interface (`hash`, `build`, `noir_version`, `bin/*` paths)
is unchanged.

## Validation

- `bash -n` clean; fnd-mode `hash` byte-identical to the old script on
the same tree (`ce12057b4ea229fb`).
- Pinned-mode `hash` identical with `bin/` present and absent
(`bd71460d78038ae5`), returns `disabled-cache` on a dirty toolchain dir
locally, and fails (exit 1) under `CI=1` instead of hashing an empty
string.
- Foundation `build` run against this checkout's local bb/noir builds:
symlinks all five binaries, writes the pin record, hash stable across
re-provisioning.
- Invalid `AZTEC_TOOLCHAIN_FND_ROOT` fails with a clear message.

## Follow-up

- Apply the same file to `monorepo-split/labs` with an empty committed
`FND_ROOT` default (its toolchain hash value changes once:
contract/yarn-project caches on that line rebuild one time).
- After the split, the foundation repo's labs-e2e driver exports
`AZTEC_TOOLCHAIN_FND_ROOT=$(git rev-parse --show-toplevel)` before
entering the submodule; the committed default divergence disappears.

@ludamad ludamad left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Auto-approved

@AztecBot
AztecBot added this pull request to the merge queue Aug 10, 2026
@AztecBot

Copy link
Copy Markdown
Collaborator Author

🤖 Auto-merge enabled after 4 hours of inactivity. This PR will be merged automatically once all checks pass.

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants