feat: labs repo downloads aztec toolchain - #25049
Merged
Merged
Conversation
fcarreiro
marked this pull request as ready for review
July 29, 2026 16:26
nventuro
reviewed
Jul 29, 2026
fcarreiro
force-pushed
the
fc/labs-toolchain
branch
from
July 30, 2026 08:38
3aab85d to
5fb1791
Compare
fcarreiro
force-pushed
the
fc/labs-toolchain
branch
from
July 30, 2026 08:44
5fb1791 to
b65958b
Compare
fcarreiro
marked this pull request as draft
July 30, 2026 11:16
fcarreiro
force-pushed
the
fc/labs-downloads-toolchain
branch
3 times, most recently
from
July 30, 2026 11:51
9129ac7 to
2c9f2ff
Compare
nventuro
approved these changes
Jul 30, 2026
fcarreiro
force-pushed
the
fc/labs-downloads-toolchain
branch
from
July 30, 2026 16:27
2c9f2ff to
bf13e77
Compare
fcarreiro
marked this pull request as ready for review
July 30, 2026 16:28
fcarreiro
force-pushed
the
fc/labs-downloads-toolchain
branch
from
July 30, 2026 16:58
bf13e77 to
4471dfb
Compare
fcarreiro
added a commit
that referenced
this pull request
Aug 4, 2026
Merges `next` (b00c780) into `monorepo-split/labs`. > [!IMPORTANT] > This is a branch-sync merge — it should be merged with a **merge commit**, not squashed, so the shared history with `next` is preserved. ## Conflict resolutions Four files conflicted, all in territory where `next` just received the port of #25047/#25057 (via #25078) while labs had already evolved past it: - **`labs-aztec-toolchain/bootstrap.sh` + `README.md`** (add/add): took the labs side. `next`'s version is byte-identical to labs at #25047; labs has since moved to the download-based toolchain (#25049), which supersedes it. - **`noir-projects/labs/bootstrap.sh`**: took the labs side. Both sides carried the same #25047 changes (toolchain nargo path, protocol-fuzzer removal); labs additionally has the targeted partial-clone cache eviction, which is labs-specific (`protocol_types` resolves from a large aztec-packages git clone). - **`Makefile`**: - kept labs' commented-out `# labs-aztec-toolchain: noir bb-cpp-native` (labs already fulfilled `next`'s "comment this out when pinning binaries" TODO) and labs' TODO wording on the format-check dependency; - took `next`'s new `fnd-release` / `fnd-release-tests` targets; - took `next`'s split of `yarn-project:` deps into `noir-projects-labs labs-aztec-toolchain` plus the monorepo-extras line (total dependency set unchanged). ## Toolchain fix (semantic conflict caught by CI) The first CI run failed compiling `account/schnorr_initializerless_account_contract`: two `Return variable contains a constant value` errors pointing at the aztec-nr macro's `self.context.finish()`. Root cause: `next` switched the noir-contracts compile to `--deny-warnings`, relying on the macro-generated `#[allow(constant_return)]` to silence that one lint (replacing the old grep-allowlist in `bootstrap.sh`). Support for `#[allow(constant_return)]` only exists in Noir **v1.0.0-beta.26** — earlier compilers silently ignore the attribute and the warning becomes an error. The labs toolchain provisions the **pinned** noir release, and the pin was still `1.0.0-beta.25`, so CI compiled with a nargo that can't honor the allow. (Both parents were green: labs still had the grep-allowlist, and `next` builds nargo from its beta.26 submodule.) Fix, folded into the merge commit: - bumped `NOIR_VERSION` to `1.0.0-beta.26` in `labs-aztec-toolchain/bootstrap.sh` — reproduced the failure locally with the pinned beta.25 toolchain (identical toolchain hash `0d18d107bf07e280` to the CI run) and verified the same compile passes after the bump; - added `bootstrap.sh` itself to the toolchain `hash` function, so pin bumps and provisioning-logic changes move the cache key even before binaries are refreshed. Note: `BB_VERSION` stays at `6.0.0-nightly.20260729`, which was built against noir `75061fab` — two commits shy of the beta.26 tag (release stamp + an unrelated frontend fix), so the pairing skew is negligible. A future pin refresh can realign both to a newer nightly. ## Notes - Adopts `next`'s noir submodule bump to `40d6574f85` (v1.0.0-beta.26) — verified the pointer matches `origin/next` exactly. - Verified no conflict markers remain (`git diff --check` + full grep) and `make -n` passes for `fast full bench release yarn-project fnd-release-tests noir-projects`. - Supersedes the older sync attempt on `nchamo/labs-next-merge` (f0b50f9), which predates `next`'s current tip.
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.
Implements the labs-repo side of
labs-aztec-toolchain: instead of linking locally built binaries,build_labsprovisions the pinned toolchain from releases. Follows #25047 (merged). With the Makefile dependency onnoir bb-cpp-nativecommented out, the monorepo takes the same downloaded toolchain, sobuild_monorepois now unused — kept in case the foundation side wants it.Closes https://linear.app/aztec-labs/issue/A-1532/source-bbnargo-from-an-aztec-toolchain-directory-for-labs .
Provisioning (
build_labs)Pins at the top of the script:
BB_VERSION=6.0.0-nightly.20260729andNOIR_VERSION=1.0.0-beta.25. Every source URL is env-overridable (BBUP_URL,NOIRUP_URL,BB_AVM_URLS,NOIR_SOURCE_URL) for testing and mirroring, andNOIR_TAGcovers noir's two tag shapes (v<semver>for releases, unprefixed for nightlies).nextat build time and run withBB_PATH=<toolchain bin>+--no-modify-path.mainand run with an isolatedNARGO_HOME(noir releases ship the profiler next to nargo; no shell config or~/.nargois touched).barretenberg-avm-amd64-linux.tar.gzitself, barretenberg mirror first and aztec-packages as fallback, matching bbup's order. It is published for amd64 linux only, so elsewhere it is skipped rather than fatal — its consumers (AVM proving) only run there anyway.acvm_cliis not on crates.io.Every path cargo writes to lives under the run's
mktemp -dand dies with it —CARGO_HOME(so the fetched crates stay out of the user's registry cache),CARGO_TARGET_DIR, the--rootinstall prefix, and the extracted source. Three details behind that:rust-toolchain.toml. From anywhere else the ambient cargo is used, and a cargo older than noir's MSRV fails the build (hit for real with a 1.85 onPATH).RUSTFLAGSremaps the temp paths out of the binary. Left in, themktempname lands in the executable and every build of the same source produces different bytes, which would poison the pin hash and every downstream cache key derived frombootstrap.sh hash.GIT_COMMIT/GIT_DIRTYare passed in becausenoirc_driver's build script reads them from a git checkout, and a release tarball is not one.A build from scratch is ~5 minutes (~1.5 compiling, the rest fetching ~330 dependency crates that the isolated
CARGO_HOMEdiscards), so the built binary goes through the ci3 build cache underlabs-acvm-<noir version>-<platform>. The key carries the platform explicitly since, unlike keys derived fromcache_content_hash, it is otherwise just a version.Pin record and per-binary staleness
bin/.pinrecords the pinned versions and agit hash-objectcontent hash per binary, written only for those present — so an optional binary's absence is part of the record too.is_current <binary> <release key> <version>then answers for one binary: it exists, the recorded release matches the pin, and the recorded hash matches the actual contents. Matching versions alone would not catch a corrupted or swapped binary.Checks are per binary, feeding install flows that are coarser: bbup and noirup each provision a whole release in one shot, while bb-avm and acvm are provisioned individually. A corrupt
nargotherefore re-runs only noirup; a missingbb-avmre-downloads only its artifact. Where a binary cannot be provisioned on the machine (bb-avm off amd64 linux, acvm with no cargo),drop_unprovisionableremoves whatever sits in its place, so the record never attests contents from a different provisioning. Each installrm -fs its destination first: unpacking or copying onto a leftover symlink writes through it, into the linked build output.The record is written once before the acvm build and again at the end, so a failed source build does not cost the downloads that already succeeded; a stale acvm is dropped before that first write so an interrupted run cannot leave the record attesting contents that are about to be replaced.
noir_versionreads only the pin record: the binary reports its base cargo version, which cannot distinguish a nightly from the release it was cut from.hashcovers the three required binaries plus bb-avm/acvm when present — what the toolchain provides, including their absence, is part of its identity.bbup
install_bbruns bbup with--no-modify-path, which is not part of this PR: that flag and the idempotentupdate_shell_configgo in through #25060 againstnext. Until it lands,build_labswith the defaultBBUP_URLfails on the unknown flag (tested here via afile://override); once it does,BBUP_URLcan pin that commit instead of trackingnext.Docs
labs-aztec-toolchain/README.mddescribes what the component provisions and what consumers read from it; rootCLAUDE.mdnow states the$NARGOdefault per side (fnd/**submodule build,labs/**toolchain);noir-projects/labs/contract-snapshots/README.mdno longer points at the submodule build.Testing
Real downloads and builds:
bb-avm --version→6.0.0-nightly.20260729.git hash-object458823a1…),acvm version = 0.40.0. Afterwards: temp dir gone, no~/.cargo/bin/acvm, and the user's registry cache entry count unchanged.CACHE_LOCAL_DIR: miss → build → upload (12 MB → 4.4 MB), then hit → restored with its exec bit in 0.26s instead of ~5 min, pin recording the restored hash.Staleness scenarios, with stand-in installers so no release traffic was involved:
nargo→ only noirup; missingbb→ only bbup; missingnoir-profiler→ only noirup.setarch linux32) → bb-avm skipped and dropped; no cargo onPATH→ acvm skipped, dropped, and its hash absent from the record.acvm_hash, corrupt file removed) and the next run retries only acvm, without re-downloading bb or nargo.bin/taken over by downloads with all five pretend build outputs left byte-identical.Notes