Repository navigation
Avoid production dependency analysis in Rust formatting checks #3208
Description
Activity
Source-only implementation verification found one generator integration edge before its follow-up fix: the existing top-level stale-block scan follows Bazel convenience symlink bazel-tracedecay and visits the new root BUILD aggregate again under that alias, reporting its generated block obsolete. The canonical root output is current. Fix will compare resolved file identity against already-owned generator output paths, preserving the existing stale-block check for distinct files.
Implemented in 362a73f, included in #3200.
Formatting now builds a native source-only Bazel target, using the pinned rustfmt toolchain and the same canonical source expressions as compilation. It no longer analyzes production dependency edges through the rustfmt aspect. Native genrules preserve each edition, fail on formatter errors, and use bounded per-file arguments on Windows. Manual tags keep ordinary workspace builds from unexpectedly invoking formatting.
Local verification:
- Original and replacement source inputs both contain exactly 3,863 files, with no missing or additional paths (one-off in-memory comparison).
- All 51 non-MCP checks passed in 6.349 seconds, including 50 executed actions. The known unowned MCP formatting change was left untouched; its committed source was already verified with the same pinned formatter.
- A deliberate formatting error in an owned probe failed in 0.713 seconds. Restoring it exactly passed in 0.566 seconds.
- Aggregate analysis configured 5,419 targets in 0.884 seconds in the warm local workspace, compared with 52,102 configured targets in the previous hosted run. Its closure contains 75 packages instead of 1,101; these are structural/work-count comparisons, not a cold-cache latency claim.
- The final Bazel generator check passes for all 59 generated files. It also caught and now handles the existing Bazel workspace symlink alias without treating the root generated block as obsolete. Actionlint and diff checks pass.
- Independent review found no correctness issues.
The clean hosted CI run must verify cold setup cost and all committed sources. No timeout was increased and no profile data was reset.
Clean hosted verification passed on commit 362a73f in CI run 37857923422.
The source-only formatting step ran from 23:13:02Z to 23:17:54Z (4m52s including cold setup). Generated BUILD freshness and every other Repository gates check also passed within the existing job budget. The full native test/build/Clippy jobs are now running. This confirms the committed-source Linux formatting path; it does not claim a native Windows formatter execution.
The native formatting CI step analyzes/fetches the production dependency graph even though it only needs maintained Rust source files, pinned rustfmt, and rustfmt.toml.
Measured evidence from cancelled CI run37855614453, Repository gates (head a93682c):
The15-minute Repository gates budget is at risk because formatting reaches unrelated dependencies. This is not evidence of slow rustfmt CPU or a reason to increase the timeout. Preserve complete maintained Rust-source coverage, fixture exclusions, editions and the pinned formatter/configuration while using an existing Bazel-native mechanism that does not analyze the production dependency graph. Record relevant cold-loading/action evidence after the fix.
Local log: /tmp/tracedecay-a936-repository-gates.log. Filed before the corrective edit.
Resolution: Merged via #3141. Native source-only formatting checks preserve all 3,863 maintained Rust sources and reduce local configured targets from over 52,000 to about 5,400. Hosted cold formatting completed in 4m52s and repository gates passed without increasing the budget.