Repository navigation
chore(test): stop writing debug info into test binaries - #1204
Conversation
Nothing in this repository reads it. The 66 integration-test binaries in this workspace are 81% DWARF by weight — one measured 236 MB unstripped against 45 MB stripped — and every consumer (cargo test, clippy, fmt, CI, the review lenses) either never opens a symbol table or reads a panic location, which the compiler emits with or without debug info. Measured 2026-11-21 from a cold target dir on -p nostream-mcp --test auth: profile binary build target dir dev (default, 2) 230 MB 75 s 1.6 GB line tables (1) 150 MB 54 s 1.3 GB none (0) 43 MB 49 s 0.8 GB The test profile is the one that matters: cargo test runs it, so it decides the size of every artifact a test run leaves behind. dev keeps the default, because cargo build output is the one artifact a person opens in a debugger by hand.
🦋 Changeset detectedLatest commit: 6bea142 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
[Medium impact] The PR appears safe to merge.
|
Stops writing debug info into test binaries, because nothing in this repository reads it.
Measured
-p nostream-mcp --test auth, each from a coldCARGO_TARGET_DIR, same tree:devdefault (debug = 2)debug = 1)debug = 0)debug = 1is the surprise: line tables alone kept 107 MB of debug info, 75 MB of it.debug_str, so it buys a third of the win for the same lost debugging. The full profile is worth nothing here and line tables are barely worth anything.Why nobody needs it
Every consumer either never opens a symbol table or does not need one:
cargo test,clippy,fmt,cargo check— no symbol reader in the path.assert_eq!diff from values, not from DWARF, and a panic'sfile:linecomes from#[track_caller]andLocation, which the compiler emits regardless.The one case that does read it — attaching a debugger to a binary by hand — is
cargo buildoutput, which is why[profile.test]is the only profile changed anddevkeeps its default.Why it matters for the factory
One review round links a test binary per integration-test target — 66 of them in this workspace — each statically carrying the crate graph. A single five-round job left 13 target directories and ~55 GB in
/tmpin one day and the disk reached 7.8 GB free. At these numbers that job's trees would have been about 28 GB, and each build is 35% faster.Scope
One
Cargo.tomlprofile and an empty changeset.cargo test -p nostream-mcp --test authpasses: 11 passed, 0 failed. Nothing else in the tree is touched.