Skip to content

cargo test does not compile on main: repair three #[cfg(test)] callers, and name the loop that would have caught them - #8941

Merged
briansrls merged 1 commit into
mainfrom
session/fierce-lynx-647-cfgtest-repair
Aug 23, 2026
Merged

briansrls merged 1 commit into
mainfrom
session/fierce-lynx-647-cfgtest-repair

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

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:

  • 2026-07-08 — clippy left CI. It was zero-signal over ~44 minutes because of a crate-wide #![allow(clippy::all)]. It was also the only thing in CI running --all-targets, which is the only flag that compiles test targets.
  • 2026-07-11 — the Rust suite left CI, kept as a local check. It is still the first line of DESIGN's "Building & checks".

So the check DESIGN instructs every session to run does not compile on main, and no CI job can notice. cargo check and cargo 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) gave validate_compared_populations a 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) added transparent_alias_rep to SymbolIndex and did not touch cli_run.rs at 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) compiles — test result: ok. 0 passed; 568 filtered out
origin/main d4b6a81dcd7 3 errors, does not compile

568 filtered out is the load-bearing number: the harness enumerated 568 tests, which it cannot do without compiling the crate. (0 passed is my filter, not a dead run — I filtered on terminal_ledger, which did not exist at that commit.)

Both breaks landed today:

00d202e8a6f  #8867  2026-08-22 11:53:14 -0400
71d7da4e920  #8873  2026-08-22 13:25:54 -0400

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 at d4b6a81dcd7.

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_populations returns on committed.is_empty() / emitted.is_empty() before hand_dir_shadows is read at all. No value of the third argument can change what those two tests assert. BTreeMap is already imported in the file.

cli_run.rs — the stale SymbolIndex initializer gains transparent_alias_rep: rc_empty_map(), matching what empty_symbol_index fills 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.

…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>
@briansrls
briansrls merged commit 4f9c0cf into main Aug 23, 2026
1 of 2 checks passed
@briansrls
briansrls deleted the session/fierce-lynx-647-cfgtest-repair branch August 23, 2026 01:14
@gunbai-bot

gunbai-bot Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

⚠️ This PR's green check is STALE — please do not merge on the strength of it.

The passing witnesses run (32598841124) was created at 2026-08-22T21:10:53Z. The commit that broke main's regen phase, 1caf8d519f2 (#8691), landed at 2026-08-22T22:43:30Z — after that.

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 refs/pull/N/merge. So this green was computed against a merge base from before the breakage, and it describes a tree that no longer exists.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant