Repository navigation
fix(hooks): make the warm build and the gate agree on their flags - #3627
Merged
Merged
Conversation
The post-merge `build` step exists to warm the cache the pre-merge `insta`
gate reuses, but its flags never matched that gate's. Cargo fingerprints
RUSTFLAGS alongside the feature set, so building with `--all-features` and
no `-D warnings` produced a disjoint set of artifacts the gate then rebuilt
from scratch.
Matching the flags also drops nine targets nothing runs: seven criterion
benches, plus the `git-wt` and `mock-stub` unittest binaries that
`--all-targets` resurrects despite `test = false` on both. `git_wt.rs` is
`include!("main.rs")`, so its 58 MB of tests duplicated `wt`'s exactly. The
step now links 8 test binaries instead of 17, and the clippy step above
still type-checks the rest under `--all-targets --all-features`.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Target selection isn't a fingerprint input, so `--all-targets` doesn't compromise the match with the gate: the lib, `wt` and `integration` units get the same hashes either way, and the gate still compiles nothing afterwards. Keeping it builds the benches, so a merge still checks that everything links. The `git-wt` duplicate stays gone regardless. Its target declares `required-features = ["cli", "git-wt"]`, so dropping `--all-features` excludes it on its own. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The warm build and the gate it warms have to agree on RUSTFLAGS and the feature set, since cargo fingerprints both. They can agree at either feature set; `--all-features` is the one that's obvious to oversee, and it keeps every target building. So the whole change is now adding RUSTFLAGS to the warm build and moving the gate to `--all-features`. The test set is unchanged at 4607, since the extra features gate a bench and a binary whose tests are `test = false`. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
max-sixty
marked this pull request as ready for review
July 28, 2026 19:50
worktrunk-bot
approved these changes
Jul 28, 2026
Merged
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.
The
post-mergebuildstep exists to warm the cache thepre-mergeinstagate reuses. Its flags never matched that gate's, so it warmed nothing.Cargo fingerprints RUSTFLAGS alongside the feature set, so the two lines produced disjoint artifacts:
integrationhashpost-merge build:--all-features, no RUSTFLAGSf4f93b9e202ea20bRUSTFLAGS='-D warnings' --features shell-integration-tests742b05e128bc5d53Measured: the gate used to recompile worktrunk from scratch (28.6s) right after the warm build had finished building the same crate. With matched flags it compiles nothing (0.16s).
They can agree at either feature set.
--all-featuresis the one that's obvious to oversee, and it keeps every target building, so both lines use it.The test set is unchanged at 4607 either way: the extra features gate a bench (
real-repo-benches, which nextest never runs) and thegit-wtbinary, whose unit tests aretest = falsebecausegit_wt.rsisinclude!("main.rs")and they'd be byte-identical duplicates ofwt's.Verification
wt hook post-merge --yes buildproduces the gate's exact artifact hashes, after whichcargo nextest list --all-featurescompiles nothing.cargo nextest listreports 4607 tests under both feature sets.pre-commit run --files .config/wt.tomlpasses.Context
This came out of asking why
cargo test --no-run --all-targets --locked --all-featuresreports 17 test binaries, given we follow matklad's guidance that eachtests/*.rsfile relinks the library. We do follow it: oneintegrationbinary plus one documented exception (cancel_background, which latches process-wide state). The 17 was the widest build in the repo, not the test build.🤖 Generated with Claude Code