Repository navigation
cargo test does not compile on main: repair three #[cfg(test)] callers, and name the loop that would have caught them - #8941
Conversation
…loop that would have caught them `cargo test -p v1-compiler --lib` does not compile on main. Three errors, two commits, both today: 00d202e #8867 11:53:14 -0400 validate_compared_populations gained a 3rd parameter; two test callers still pass 2 71d7da4 #8873 13:25:54 -0400 SymbolIndex gained transparent_alias_rep; a cli_run.rs initializer was left stale NEITHER AUTHOR WAS CARELESS, and that is the finding. #8867 updated the definition AND both production callers in the same diff — all three are visible in its hunks. It missed only the `#[cfg(test)]` callers, because nothing showed them. `cargo check` and `cargo build` do not compile test targets; `--all-targets` does, and that was clippy's flag. Clippy left CI 2026-07-08 as zero-signal under a crate-wide allow; the Rust suite left CI 2026-07-11 and was kept as a local check. So nothing in this repository compiles `#[cfg(test)]`, and DESIGN's first "Building & checks" line is a command that cannot start. DURATION, measured rather than asserted: the suite COMPILED at 00d202e^ — `test result: ok. 0 passed; 568 filtered out`, and the 568 is the load-bearing number since the harness cannot enumerate without compiling. So this is hours, not months. An earlier draft of this message said every session running the local suite had been running a dead command; that was true only of sessions since 11:53 today. The short duration makes the incident smaller and the class no smaller: two independent commits broke it 92 minutes apart, which is evidence of rate. THE FIX. `&BTreeMap::new()` is legitimate filler here for a stated reason rather than because it compiles: both assertions are on the empty-population arms, and `validate_compared_populations` returns on `committed.is_empty()` / `emitted.is_empty()` BEFORE `hand_dir_shadows` is read, so no value of the third argument can change what those tests assert. `transparent_alias_rep` gets `rc_empty_map()`, matching what `empty_symbol_index` fills for that field. NOT RE-ADDING A GATE. Re-arming `--all-targets` or returning the suite to CI is the operator's call — it is their two rulings that compose into this, and a PR that fixed the sites and re-armed a gate would force one decision through a diff that needed only the other. This is the prerequisite either way: a gate re-added over a red tree lands red. VERIFIED by `cargo check --all-targets -p v1-compiler`, clean in 1m03s, re-run against this tree after merging current main rather than only against the tree the fix was written on. There is something almost too neat about the repair being verified by the mechanism whose removal made it necessary. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
The passing The run shows a later completion time because it was killed by the 21:32Z fleet event and re-run at 22:32. A re-run replays the merge ref the run was created with; it does not recompute Concretely: this PR has not been tested against current main, and nothing about the green says so. What this is not: a defect in this diff, and not a hold I am placing on the content. The diff is unchanged and previously reviewed. What it needs: a new run (not a re-run) against a merge ref computed after snappy-tern-856's #8953 lands — that PR installs the second regen pass #8691 was owed and unblocks five PRs. Re-running this one now would replay the same stale ref; pushing now would produce a real run that fails on main's inherited drift. I'd rather flag a green I can't stand behind than let it be read as a verdict. — sent from fierce-lynx-647 |
Nothing in this repository compiles
#[cfg(test)]That is the finding. The three-line fix below is its symptom, and filing this as routine test maintenance would lose the part that matters.
Two rulings, each correct alone, compose into a hole neither anticipated:
#![allow(clippy::all)]. It was also the only thing in CI running--all-targets, which is the only flag that compiles test targets.So the check DESIGN instructs every session to run does not compile on main, and no CI job can notice.
cargo checkandcargo build— the things authors and the required floor actually run — do not compile#[cfg(test)]at all.Neither author was careless, and that is the point
00d202e8a6f(#8867) gavevalidate_compared_populationsa third parameter. It updated the definition and both production callers in the same diff — all three are visible in its hunks. It missed only the two#[cfg(test)]callers, because the compiler never showed them.71d7da4e920(#8873) addedtransparent_alias_reptoSymbolIndexand did not touchcli_run.rsat all, leaving one initializer stale.An author who fixes every caller the compiler reports has done the reasonable thing. The feedback loop is what is missing, not the diligence.
Duration: hours, not months — measured, and it corrects my own first framing
00d202e8a6f^(before the first break)test result: ok. 0 passed; 568 filtered outorigin/maind4b6a81dcd7568 filtered outis the load-bearing number: the harness enumerated 568 tests, which it cannot do without compiling the crate. (0 passedis my filter, not a dead run — I filtered onterminal_ledger, which did not exist at that commit.)Both breaks landed today:
I first wrote that every session running the local suite had been running a command that cannot start. That was true only of sessions since 11:53 today, and the correction is stated here rather than quietly softened.
What this does not measure: whether this has happened before. "Suite red since" is the earliest unfixed break, not the earliest break, and I have not bisected. What is bounded is this occurrence: green at
00d202e8a6f^, red atd4b6a81dcd7.And the short duration makes the incident smaller while making the class no smaller. Two independent commits broke it 92 minutes apart. That is evidence of rate, not of rarity — the recurrence interval only became visible once the duration shrank.
The fix: three sites, five lines
required_regen_host.rs— two test callers gain&BTreeMap::new().This filler is legitimate for a specific reason rather than because it compiles: both assertions are on the empty-population arms, and
validate_compared_populationsreturns oncommitted.is_empty()/emitted.is_empty()beforehand_dir_shadowsis read at all. No value of the third argument can change what those two tests assert.BTreeMapis already imported in the file.cli_run.rs— the staleSymbolIndexinitializer gainstransparent_alias_rep: rc_empty_map(), matching whatempty_symbol_indexfills for that field.What this PR deliberately does not do
It does not re-add a gate. Re-arming
--all-targets, or returning the suite to CI, is the operator's call — it is their two rulings that compose into this, and a PR that fixed the sites and re-armed a gate would force one decision through a diff that only needed the other.It is also the prerequisite either way: a gate re-added over a red tree lands red.
Verification
cargo test -p v1-compiler --lib— full suite, compiled and run, not merely type-checked.