Skip to content

rules: no debug info in a default build profile - #18

Merged
shinaoka merged 1 commit into
mainfrom
chore/audit-no-debuginfo-by-default
Oct 11, 2026
Merged

shinaoka merged 1 commit into
mainfrom
chore/audit-no-debuginfo-by-default

Conversation

@shinaoka

Copy link
Copy Markdown
Member

Why

DWARF, not code, is what makes Rust build output large, and no test reads it. Measured on one machine: the shared compiler cache holds 320 GiB of dev-profile artifacts out of a 335 GiB store — 6.7x its configured limit — with a single strided_kernel dev rlib at 1.13 GiB. Every workspace without [profile.dev] debug = 0 was contributing.

The rules already asked for debug = 0 on dev and test, but recommended debug = "line-tables-only" for release backtraces and did not say that debug = 1 and line-tables-only are debug info rather than a size compromise.

What

  • rules/rust/build-artifacts.md: new Debug Info Is Not A Default section. Every default profile keeps debug = 0; debug = 1 and "line-tables-only" emit DWARF and count as a finding; the measurement; the workspace-root caveat (Cargo ignores a dependency's own [profile.*], so a vendored debug = 1 is neither the cause nor a thing to patch); and that -Cdebuginfo is part of the cache key, so turning it off invalidates rather than corrupts.
  • rules/rust/performance.md: the two profile bullets now say the same thing and point at that section, instead of recommending line tables on a default release profile.
  • rules/rust/index.md: routes build-artifacts.md for "setting Cargo profile options that change artifact size".

The six workspace PRs this rule would have caught are open: tensor4all/hdf5-rt#25, SpM-lab/sparse-ir-rs#337, tuwien-cms/xprec-rs#50, tensor4all/tenferro-benchmark#130, tensor4all/tensor4all-benchmark#9, shinaoka/koushi-matrix#1350.

DWARF, not code, is what makes Rust build output large, and no test reads it. The shared
compiler cache on this machine holds 320 GiB of dev-profile artifacts out of a 335 GiB
store — 6.7x its configured limit — with a single strided_kernel dev rlib at 1.13 GiB.

The rules already asked for `debug = 0` on dev and test but recommended
`debug = "line-tables-only"` for release backtraces, and did not say that `debug = 1` and
`line-tables-only` are debug info rather than a size compromise.

`build-artifacts.md` gains the section, with the measurement, the workspace-root caveat
(Cargo ignores a dependency's own `[profile.*]`), and the cache-key note. The two profile
bullets in `performance.md` now point at it, and `index.md` routes the file for setting
profile options that change artifact size.
@shinaoka
shinaoka merged commit ede307c into main Oct 11, 2026
1 check passed
@shinaoka
shinaoka deleted the chore/audit-no-debuginfo-by-default branch October 11, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant