Repository navigation
feat(build): first make targets as ci3 steps, with a build plan (spike) - #25906
Draft
charlielye wants to merge 29 commits into
Draft
charlielye wants to merge 29 commits into
charlielye wants to merge 29 commits into
Conversation
avm-transpiler (native and cross), l1-contracts-src, -verifier and -artifacts, and noir-protocol-circuits become ci3 steps: keyed from their own inputs and the keys of their make prerequisites, and cached by ci3 rather than by wrappers in their bootstrap scripts. The rest of the Makefile is unchanged, run through ci3/step_legacy so steps can depend on it (keyed by each project's ./bootstrap.sh hash). - l1-contracts-src no longer depends on noir or the circuits: only the verifier does, through the noir-protocol-circuits step's key. - l1-contracts-prep is what ran outside build_src's cache wrapper (constants, solc, npm, libraries): it always runs, and the l1-contracts steps run after it. - avm-transpiler and l1-contracts' `./bootstrap.sh` with no command builds through make, so it still caches. - build and build_and_test print the build plan first (ci3/step_plan); `./bootstrap.sh plan [goal]` prints it alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
avm-transpiler's steps now write their binary and library to ci3-out/<target> (ci3's $STEP_OUT), which is what is cached, and barretenberg's presets link the library from there. The Makefile no longer lists their output paths. l1-contracts keeps listing them for now: forge's out/ and cache/ are working directories that each build continues from and the tests read in place. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ff, tests kind Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous commit uses step_tests but left the ci3 gitlink behind. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The protocol circuits, mock circuits and protocol contracts stay `never` steps: they cache per item, and those items are now keyed by the nargo and bb that build them as ci3 hands them in ($CI3_KEY_NOIR, $CI3_KEY_BB_CPP_NATIVE) rather than by noir's and barretenberg's bootstrap hashes. Each item keeps its own content key (nargo's program hash for a circuit, the bytecode for a VK, the sources for a contract). - noir-protocol-circuits-variants is a step whose outputs stay in place (nargo reads the generated workspace there), and a prerequisite of what reads them; the circuits build no longer regenerates them. - noir-projects-fnd-format-check is a cached check. The builds no longer rely on it to warm nargo's dependency cache: each fetches its dependencies first (nargo fetch, retried), as nargo serializes concurrent fetches. - fnd-artifacts-stage is a step whose dists stay in place, for the labs portals and the release. - fnd-release, fnd-genesis, noir-projects-fnd and noir-projects are step groups. - The test targets prefix their commands with $STEP_KEY. The circuits' and contracts' tests read sources, not build output, so their builds are order-only prerequisites. - ./bootstrap.sh with no command (and fnd's build) runs the make targets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
l1-contracts - l1-contracts-src builds into its $STEP_OUT (FOUNDRY_OUT/FOUNDRY_CACHE_PATH), with the sources' modification times zeroed in forge's cache so the same sources give the same outputs. build_verifier continues from it: it copies src's out/ and cache/ into place and points forge's cache at them, which forge otherwise takes as a reason to recompile everything. - l1-contracts-verifier and -artifacts keep their transitional output paths: out/ and cache/ are forge's working directories that the tests, the deploy scripts and l1-artifacts read in place, generated/ is a source directory (the @generated remapping), and l1-artifacts is a yarn workspace read in place. - l1-contracts-solc and -prep are never steps; solc's key is the solc version foundry.toml pins. - l1-contracts-tests is keyed by $STEP_KEY, from its own inputs (scripts, fixtures, solhint config), the verifier's outputs and noir-protocol-circuits; the HonkVerifier comparison also folds in the circuits' verifier's content. The hand-rolled hash remains only as `./bootstrap.sh hash` (scripts/labs_fnd_hashes.sh) and bench_cmds' key, both outside make. docs - docs (the site into $STEP_OUT, plus the aztec.js reference and orphaned-URL checks), docs-examples (nargo's target/ in place), docs-checks (keyed by the whole tree: they check repository paths exist), and the never step docs-prep for the aztec-node checkout and node_modules. The #include_code inputs come from docs/scripts/include_code_patterns.sh; the variables that change the site are KEY_ENV. - docs-tests and the new docs-examples-tests key their tests with $STEP_KEY; a test that reads a page or a line folds its own patterns into that key. The docs and examples `hash` commands are gone. Leftovers: claude-tests, scripts-tests and labs-patches-tests key their tests with $STEP_KEY (labs-patches- tests with the labs gitlink as KEY_SALT, and only ordered after labs-patched); labs-patched is a never step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…steps bb-crs (never: the CRS lives in ~/.bb-crs), bb-bbup (a group: nothing to build), bb-ts-packages, bb-ts, bb-bin, bb-bin-cross-copy, bb-rs, bb-acir, bb-docs and bb-sol become ci3 steps, keyed from their inputs and their make prerequisites rather than from chained ./bootstrap.sh hash calls, and cached by ci3 rather than by wrappers in their bootstrap scripts. Their test targets get INPUTS, and their test commands are prefixed with $STEP_KEY. - barretenberg/ts: bb-ts-packages-build generates, installs and compiles the packages (cached in place: yarn workspaces read through node module resolution); bb-ts-packages then installs node_modules every run (npm_install_deps caches it), so the packages are usable whether or not they came from the cache. bb-ts caches bb.js/dest in place. ipc-codegen is no longer a prerequisite: the generator runs from source, an input. - acir_tests splits into bb-acir-programs (the compiled programs, in place), bb-acir-deps (node_modules, every run) and bb-acir-js (the browser app and bb.js harness), grouped as bb-acir. - bb-docs is a check (nothing reads build/); bb-docs-deps installs its node_modules every run. - bb-rs no longer depends on bb-ts (it generates its client from the schema itself), but is now keyed by bb's build, whose libbb-external.a it links: its hash covered neither. - bb-sol: l1-contracts-solc is order-only (foundry.toml's path names the solc version), so l1-contracts changes no longer rebuild it. - Test targets depend on what the tests run: bb-ts-tests and bb-acir-tests on the packages (bb, wasm), bb-sol-tests and bb-rs-tests on bb-cpp-native. - hash commands removed from acir_tests, bbup, docs, rust, sol and barretenberg/bootstrap.sh. barretenberg/ts and bb.js keep theirs (computed on demand) for scripts/labs_fnd_hashes.sh; bb.js and sol benches still hash, as benchmarks are not steps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e native packages as ci3 steps Their builds and tests are keyed and cached by ci3 from the make graph; the bootstraps build unconditionally, and `./bootstrap.sh` (and `build`) runs their targets through make. - noir: one step (nargo/noir-execute/noir-profiler and the JS packages) on the transitional path list, since nargo and noir/packages are read in place by many scripts and the labs toolchain. The release check is its own always-run target (noir-release-check), so it still runs when noir is cached. - ipc-runtime: path list (ts/dest, ts/build, the C++ test binary): consumers portal into ipc-runtime/ts. Its cross builds install the addon into $STEP_OUT, which copy_cross.sh now reads. - ipc-codegen: builds only the echo example harness its tests run, on the path list. - constants-codegen: path list (dest, inputs; labs portals into it); its inputs now include constants.nr, which its build embeds. - lmdblib installs its library and test binary into $STEP_OUT. kvdb and wsdb compile lmdblib's sources, so they take them as inputs; wsdb takes bb's wsdb-ref sources, ipc-runtime's C++ and ipc-codegen's generator as inputs, and depends on ipc-runtime's built TS package rather than on ipc-codegen. Their TS packages stay in place. - Test commands are keyed by $STEP_KEY. kvdb's installs its node_modules itself, which a restored build lacks. - `hash` stays for every project here: other projects' bootstraps and scripts/labs_fnd_hashes.sh still call it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the hand-rolled hashes they kept Benchmark commands are listed by <project>-benches make targets (ci3 step_benches) and keyed by $STEP_KEY, as tests are; bootstrap.sh bench_cmds collects them through make. labs-use-local is a never step whose prerequisites are the providers labs consumes: scripts/labs_fnd_hashes.sh records what ci3 hands it for each (output hash or key) instead of chaining every project's ./bootstrap.sh hash. The hash commands of kvdb, lmdblib, wsdb, constants-codegen, genesis, ipc-codegen, l1-contracts, barretenberg/ts, bb.js and noir-projects/fnd are gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every bb-cpp-* target is a step, keyed from the make graph instead of barretenberg/cpp's hand-rolled hash. - The presets' cmake build dirs stay where they are (build/bin/bb is read all over the repo, and local builds continue from them): each preset's step caches its bin/lib in place (the transitional path list). - bb's inputs now name what it reads of other projects: ipc-runtime's C++ sources and avm-transpiler's header, rather than chaining their hashes. avm-transpiler's library comes from the avm-transpiler-native step. - The objects warm-ups, the format check and the syntax checks are steps that record a pass. The warm-ups and the format check are order-only prerequisites, and the cross builds run after one another order-only: none reads another's outputs. - The downloads (chonk inputs, iOS SDK, Android sysroot) cache themselves: `never` steps keyed by their scripts. - bb's binaries are stamped with a version derived from their own contents rather than the commit, so the cached outputs are the same wherever the same binary is built and the steps after bb are cut off when it comes out unchanged. bin/dist (stripped, with a release's version) is staged after the step, outside its outputs. - bb-cpp-release-dir writes the release tarballs to its $STEP_OUT; barretenberg/ts reads them there. - The test commands are keyed by their step ($STEP_KEY), and `./bootstrap.sh test` lists them through make. - barretenberg/bootstrap.sh's unused `hash` is gone. barretenberg/cpp keeps its `hash` for the projects that still chain it, and for the bench commands. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ped outputs keyed by RELEASE_VERSION barretenberg/cpp's benches are a step_benches target like the rest, so the bb, avm-transpiler, ipc-runtime and noir hash commands, which only chained into each other, are gone: no bootstrap computes a hand-rolled build hash any more. Targets whose outputs carry the release version key on RELEASE_VERSION (REF_NAME when it is a semver, else empty) rather than REF_NAME, which is a branch name on every other build. avm-transpiler and bb.js key on AVM_TRANSPILER, which turns their build off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… not their committed sources Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # Makefile # barretenberg/ts/bootstrap.sh # ipc-runtime/ts/scripts/copy_cross.sh
… pin ci3 to name missing outputs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ntry (#25855) The install rewrote it on every build, which left bb-acir-deps' inputs dirty and so bb-acir-js uncached. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Flakey Tests🤖 says: This CI run detected 1 tests that failed, but were tolerated due to a .test_patterns.yml entry. |
This branch has not been deployed
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.
Spike, using aztec-labs-eng/ci3#38 (ci3 is pinned to that branch): the first Makefile targets become ci3 steps, keyed and cached from the make graph, and every build starts with a plan of what will be restored, what will build, and why.
Converted
avm-transpiler-native,-cross-*noir-repogitlinkl1-contracts-srcl1-contracts-verifiernoir-protocol-circuitsandl1-contracts-src$hashfor all threel1-contracts-artifactsl1-contracts-verifier's key$hashfor all threenoir-protocol-circuitsnever; it still caches per circuit, but has a key for the steps above./bootstrap.shwith no command goes through make, so it still caches.l1-contracts-prepholds what used to run outsidebuild_src's cache wrapper (constants, solc, npm,lib/). It always runs, and the steps run after it.ci3/step_legacyand is unchanged. Steps that depend on it are keyed by its./bootstrap.sh hash../bootstrap.sh plan [goal]prints the plan;buildandbuild_and_testprint it first. A plan failure never stops the build.Tried locally
New keys mean the first CI run of each converted target is a cold build.
🤖 Generated with Claude Code