Repository navigation
build: drop debug info for third-party crates in dev builds - #12905
Merged
Merged
Conversation
Contributor
cv
added a commit
that referenced
this pull request
Oct 10, 2026
## Failure The Rust dependency caches have grown from 1.3–1.5 GB to about 2.9 GB per platform in a day. Before saving, rust-cache keeps target artifacts by crate name only, not by version or build hash ([`cleanProfileTarget`](https://github.com/Swatinem/rust-cache/blob/6323deb102c322ba6fcbdcafc7e3dddab59af2b6/src/cleanup.ts) at the pinned revision). When a key change restores an older cache, the new cache therefore keeps every earlier build of each crate. The two profile changes in #12905 and #12885 each rebuilt every dependency with new hashes. The larger caches slow both ends of each run. Windows setup restores for 123–210 s. When `v1` saves a changed key, the Windows `Build and test` save takes 298–433 s, and lifecycle tests wait for it. Those saves made warm runs take 850–1,095 s instead of about 600 s. ## Decision Add two parts to the rust-cache prefix: - **The hash of `.cargo/config.toml`:** a profile change starts a fresh cache instead of extending the old one. - **The current UTC month:** this bounds the slower growth from lockfile updates, at the cost of one cold build per platform each month. Within a generation, manifest, lockfile, and toolchain-file changes still restore the previous cache and rebuild only what changed. Deleting unused artifacts before saving isn't reliable, because Cargo doesn't touch an artifact that's already fresh, so a job can't tell which files it used. The new prefix also resets the current oversized caches: the first `v1` push after merge builds each platform cold. The old entries expire unused. ## Validation - `actionlint` passes on the workflows, and the composite action parses as YAML with the new step. - `cargo ci` passed: 1,324 workspace tests and all 120 lifecycle tests. - `fern check` passes. - After merge, the `v1` cache entries should return to about 1.3–1.5 GB per platform and stay there within the month.
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.
Failure
The repository's Actions caches total 11.3 GB against a 10 GB limit, so GitHub evicts them and Native jobs restart cold. Each platform's
native-deps-v2cache is 1.4–1.7 GB. Building the bundle in a parallel job would save 2–3 minutes on Unix and about 6 on Windows, but it needs a second cache per platform, which doesn't fit.Decision
Set
debug = falsefor third-party crates in the dev profile. Workspace crates keepdebug = 1, so backtraces through our code keep line numbers; dependency frames keep their symbol names. Release builds and the bundle are unaffected.Validation
Measured locally with a cold
cargo build --locked --workspace --all-targets, comparing the current profile with the same build passing--config 'profile.dev.package."*".debug=false':target/debugThe cache is compressed, so its reduction will differ; the first
v1push records the new size. Because the change edits.cargo/config.toml, it selects a fresh cache key: this PR's runs restore an older cache and recompile dependencies, and each platform builds once more cold after merge.cargo cipassed: 1,304 workspace tests and all 112 lifecycle tests.