turbo
f43475ac - fix: Make cold graph builds of a cargo workspace deterministic in turbo trace (#15069)

Commit
1 day ago
fix: Make cold graph builds of a cargo workspace deterministic in turbo trace (#15069) ## Description A memoized lookup stored what its first computation observed, under the pauses of whichever caller ran it first. The cargo project model builds a workspace's crate graph with recording paused, and that build reads every member crate, so the first crate to ask decided whether another crate's target discovery (its benches, examples, src/bin and tests directories) was recorded for that crate's own files. With two or more crates, two cold builds of the same tree differed in about one run in five, and so did their shard keys. A memoized lookup now runs with every pause lifted and reports what it observed under the pauses of each caller, so every caller records its own observations whichever caller computed the value. The Rust language's config key carries a model version, so graphs stored before are not reused. The tests about cold builds of a cargo workspace and about cargo aliases with the Rust language run again, and the cargo task fixture is part of the moved fixtures sweep again. ## Testing Instructions - `cargo test -p turborepo-trace-core memo` and `cargo test -p turborepo-trace-lang-rust`: the new tests fail with the old memo. - `cargo test -p turborepo-trace-store --test cutoff`: the previously ignored cargo cold-build and cargo-alias tests run and pass. - Reproduction: 200 cold builds of a two-crate workspace give identical graphs (on `main`, 9 of 40 differed). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Author
Parents
Loading