Repository navigation
perf(build): skip the base package graph when no manifest changed - #13407
Merged
Merged
Conversation
nemoclaw-build changes reuses HEAD's package graph for the base unless a changed path can alter it, skipping a git archive and a cargo metadata run for most decisions. The change-selection tests build their committed fixture workspace once in CARGO_TARGET_TMPDIR and copy it per test.
cv
enabled auto-merge (squash)
October 18, 2026 04:53
Contributor
cv
added a commit
that referenced
this pull request
Oct 18, 2026
## Failure On #13412, all 27 `nemoclaw-build` `changes::` tests failed in CI with `git rev-parse HEAD: fatal: not a git repository`. Since #13407, these tests copy a fixture repository built once under Cargo's `CARGO_TARGET_TMPDIR`, reusing it whenever its `.git` directory exists. CI caches `target/`, which includes that directory. The failures fit a restored cache that kept `.git` but not the files inside it. The template then passed the check, but its copies weren't Git repositories. #13407's own CI had no cached template, so it passed. ## Decision A template is reused only if: - a completion marker, written inside `.git` after the base commit, exists; and - `git rev-parse --verify HEAD` succeeds in it. Otherwise it's removed and rebuilt. The marker lives inside `.git`, so copies don't see it as an untracked file. This adds one Git call per test, while still avoiding a Cargo and Git build of the fixture per test. ## Validation - A new test, `an_incomplete_template_is_not_reused`, checks that a template whose `.git` contains only the marker and an empty `objects` directory isn't reused. - All 27 `changes::` tests pass locally. - `cargo ci` passes locally: 1,554 unit tests and 153 lifecycle tests.
cv
added a commit
that referenced
this pull request
Oct 18, 2026
Closes #13310. ## Failure #13310 tracked `nemoclaw-build` integration tests exceeding the 8 s per-test budget on loaded CI runners. Two of its three parts are already fixed: - **`changes::*` on Linux:** #13407 cut the repeated Cargo and Git work. - **`bake::*` on Windows:** #13386 plans agent images only on Linux hosts. One test was left. `images::harnesses_missing_from_the_selected_platform_name_the_platforms_that_build_them` still ran `docker buildx bake --print` wherever buildx exists. On the latest `v1` Windows run it took 14.0 s, and the run reported it over budget. ## Decision Give it the same guard as `bake.rs`: agent images are Linux images, so the test plans them only on Linux hosts with buildx. On Windows and macOS it's skipped with the same message as `bake.rs`. Planning them there adds no coverage, and buildx is slow on Windows runners. Test-only; the budget is unchanged. ## Validation - The test still runs and passes on Linux (`images::*`: 4 passed). - `cargo ci` passes locally: 1,598 unit tests and 149 lifecycle tests.
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.
Part of #13310.
Failure
The
nemoclaw-buildchange-selection tests take 1.4 s locally, but on loaded CI runners they reached 11–14 s, past the 8 s budget, and failed unrelated PRs. Tracing one test showed the cause: every decision rancargo metadatatwice, once on HEAD and once on agit archiveof the base, and every fixture repository rancargo generate-lockfile,git init,addandcommit. On a busy runner, all those Cargo,rustcand Git processes stretch the test.Decision
nemoclaw-build changes: reuses HEAD's package graph for the base unless a changed path can alter it: aCargo.tomlorCargo.lock, a toolchain file, or anything under.cargo/. Only then does it extract the base and runcargo metadataagain. Decisions are unchanged; the existing tests for dependency, feature and lockfile changes cover the path that still builds both graphs. This also speeds up the real CI step that decides which jobs run.CARGO_TARGET_TMPDIR, keyed by a hash of its files, and each test copies it. Concurrent tests that both build it race to rename into place, and the loser discards its copy.The budget is unchanged.
Validation
Measured locally with nextest, at one thread unless noted:
changes::*(26 tests)cargo metadatagitprocesses inchanges::*nemoclaw-buildsuitecargo cipasses locally.Not addressed
bake::*andimages::*time out on Windows runners indocker buildxitself (bake --print,version), not in NemoClaw code. #13310 stays open for them.