fix(rust): isolate cache inputs across worktrees - #769
Draft
jleni wants to merge 6 commits into
Draft
Conversation
`Test (Windows)` failed on a `clippy::cmp_owned` error in the 8.3 short-name assertion, and the changed-line mutation gate reported 11 missed mutants. Both are fixed here. - compare the short-name dep-info root as a borrowed `Path` instead of building a `PathBuf` just to compare it - pin the `with_target_dir` splice point from both sides: the new rules must land after every higher-ranked root and after an equal-ranked `<TARGET>` peer, but ahead of anything ranked below, since `normalize` applies rules in list order - assert `depinfo_source_roots` picks the designated restore spelling rather than whichever alias rule happens to come first - cover every source sentinel's dep-info mapping, including the three Windows user dirs, and assert the mappings stay distinct - assert `configured_rustc_depinfo_roots` reports the workspace, an external target, and a configured base dir with their real ranks - assert `path_normalization_root` reads back the frozen root The e2e key-divergence diagnostic was one function whose whole body was stderr I/O, so its parsing could not be tested. Split it into `parse_keytrace`, `render_key_divergence`, and `key_divergence_report`, all directly tested; `report_key_divergence` keeps the call site and is now two lines of printing, excluded with the same justification the other entries in `.cargo/mutants.toml` use. Dropped the redundant empty-map early return in the renderer: a crate absent from either map already contributes no difference, so the guard was an equivalent mutant.
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.
Fixes #760.
What changed
kache cargo build/checkisolate Cargo fingerprints in a workspace-local build directory while retaining the configured shared artifact target (Cargo 1.91+).Root cause
The reported n00n history did not have byte-identical Rust sources: the relevant change added both a literal builtin entry and an
include_dir!invocation. In the exact shared-target reproduction, Cargo marked the old unitFresh, so it never invokedRUSTC_WRAPPER; Kache could not validate or reject it.The investigation also found two independent Kache correctness holes:
.dfiles could retain a live donor-worktree path, allowing Cargo to validate the wrong tree after a relocated hit.The new
kache cargoisolation closes the pre-wrapper Cargo fingerprint boundary, while the key and dep-info changes close the Kache-owned boundaries. Arbitrary undeclaredstd::fsreads inside proc macros remain outside rustc's observable inputs and still require declaredextra_inputs.Validation
cargo fmt --all -- --checkcargo check --testsjust lintcargo test --workspace --test '*'(all integration tests green)