Skip to content

chore: port of #25057 and #25047 to next - #25078

Merged
nchamo merged 3 commits into
merge-train/fairiesfrom
fc/fairies-labs-toolchain
Aug 3, 2026
Merged

nchamo merged 3 commits into
merge-train/fairiesfrom
fc/fairies-labs-toolchain

Conversation

@fcarreiro

@fcarreiro fcarreiro commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Port of #25057 and #25047 to merge-train/fairies, cherry-picked in the order they landed on the labs line (0f8d8ad, then b556724). Both picks are line-identical to the originals; the conflicts were only against fairies-side context.

  • chore: remove protocol fuzzer #25057 removes the protocol fuzzer (noir-projects/labs/protocol-fuzzer/ and its format-check/pre-commit hook entries).
  • feat: abstract labs noir/bb toolchain #25047 makes labs-side components (noir-projects/labs, boxes, docs, aztec-up, parts of yarn-project tests) take their bb/nargo/noir-profiler/bb-avm/acvm binaries from labs-aztec-toolchain/bin instead of reaching into the monorepo build trees directly. On the monorepo the toolchain bootstrap symlinks to the existing build outputs, so nothing is rebuilt or downloaded.

Closes https://linear.app/aztec-labs/issue/A-1559/backport-prs-to-next .

Part of simplification towards the monorepo split.

This is not regularly used. It can be brought back if needed. If you
every DO bring it back, note that you DO NOT NEED THE AVM TRANSPILER.
The code can be adapted so that it uses `bb aztec_process` instead,
which executes the transpiler internally (statically linked).
Components on the labs side of the repo (`noir-projects/labs`, `boxes`,
`docs`, `yarn-project`, `aztec-up`) consumed `bb`/`nargo` directly from
the monorepo build outputs (`barretenberg/cpp/build/bin`,
`noir/noir-repo/target/release`). A split labs repo cannot depend on
those paths or on the source trees that produce them. This PR introduces
a single component that owns "where do the toolchain binaries come
from", so consumers reference one stable location in both worlds.

Part of
https://linear.app/aztec-labs/issue/A-1532/source-bbnargo-from-an-aztec-toolchain-directory-for-labs
.

- `bootstrap.sh` populates `bin/` with `bb`, `nargo` and
`noir-profiler`. On the monorepo these are symlinks to the local build
outputs; in the labs repo (`REPO_ORG=labs`) provisioning is a TODO.
- `hash` command: content hash of the three binaries via `git
hash-object`, consumed as `AZTEC_TOOLCHAIN_HASH` in downstream cache
keys.
- `noir_version` command: reads the release version from the nargo
binary itself (`nargo --version`). Compatible with `noirup -v`, which
normalizes the missing `v` prefix; note a nargo built from a nightly
reports the base version of the release it was cut from.
- New Makefile target depending on `noir` + `bb-cpp-native` (monorepo
only), wired into `noir-contracts`, `aztec-nr`, `boxes`, `docs`,
`yarn-project` and `aztec-up`.

`BB`/`NARGO`/`PROFILER_PATH` now default to
`labs-aztec-toolchain/bin/*`, and labs cache keys use
`AZTEC_TOOLCHAIN_HASH` in place of `BB_HASH`/`NOIR_HASH`:

- `noir-projects/labs/{noir-contracts,aztec-nr,contract-snapshots}`, the
labs aggregate bootstrap, `bootstrap_just_one_contract.sh`,
protocol-fuzzer `setup-local.sh`, and the shared
`noir-projects/scripts/run_test.sh`
- `boxes` (bootstrap + `scripts/run_test.sh`), `docs`, `docs/examples`,
and aztec-nr docs generation
- `yarn-project/aztec` (CLI test env) and the ivc-integration bb path
constants

`bootstrap_just_one_contract.sh` also had a latent bug fixed along the
way: its relative nargo/bb paths were one directory short since the
`labs/` reorg.

- No longer shells out to the root `bootstrap.sh versions`. A local
`versions` function derives `noir` from the toolchain binary and
measures `foundry`/`node` from the host. The keys nothing consumed
(cmake, clang, zig, rustc, wasi-sdk) are dropped.
- The verdaccio fake-publish flow now uses a throwaway npm cache
(`npm_config_cache=$(mktemp -d)`). With a warm `~/.npm`, transient
registry errors made npm fall back to stale `localhost:4873` packuments,
so `deploy_npm`'s already-published check silently skipped packages and
the priming step later failed with E404.

- Implement `build_labs` (binary provisioning inside the labs repo);
monorepo behavior is unchanged until then.
- `fnd/` (protocol) flows intentionally keep referencing the monorepo
build outputs.
@fcarreiro
fcarreiro force-pushed the fc/fairies-labs-toolchain branch from e7aecf5 to 3e483ff Compare August 3, 2026 09:55
@fcarreiro fcarreiro changed the title feat: abstract labs noir/bb toolchain (fairies) chore: port of #25057 and #25047 to next Aug 3, 2026
@fcarreiro
fcarreiro marked this pull request as ready for review August 3, 2026 09:59
@fcarreiro
fcarreiro requested review from a team, LeilaWang, charlielye and nventuro as code owners August 3, 2026 09:59
@nchamo
nchamo merged commit b445019 into merge-train/fairies Aug 3, 2026
12 checks passed
@nchamo
nchamo deleted the fc/fairies-labs-toolchain branch August 3, 2026 15:56
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.
rangozd pushed a commit to rangozd/aztec-packages that referenced this pull request Aug 5, 2026
BEGIN_COMMIT_OVERRIDE
chore: port of AztecProtocol#25057 and AztecProtocol#25047 to next (AztecProtocol#25078)
chore: split make targets into foundation and labs (AztecProtocol#25079)
END_COMMIT_OVERRIDE
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.

2 participants