build: trim dev-profile debuginfo to shrink target/ bloat#260
Open
mukeshblackhat wants to merge 1 commit intocoast-guard:mainfrom
Open
build: trim dev-profile debuginfo to shrink target/ bloat#260mukeshblackhat wants to merge 1 commit intocoast-guard:mainfrom
mukeshblackhat wants to merge 1 commit intocoast-guard:mainfrom
Conversation
Set [profile.dev] debug = "line-tables-only" workspace-wide and debug = false for all dependency packages. Stack traces + panic locations are preserved for our crates; dependencies shed all DWARF tables. Measured impact (clean build of full workspace): - workspace debug: 3.7G -> 2.4G (-35%) - + test --no-run: 6.4G -> 4.3G (-33%) - + release build: 8.0G -> 6.0G (-25%, release unchanged) make lint and make test stay green. Refs coast-guard#257
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.
Summary
First step toward addressing #257 (target/ bloat). Trims dev-profile debuginfo workspace-wide:
[profile.dev] debug = "line-tables-only"— keep stack traces + panic line numbers, drop DWARF type/variable tables[profile.dev.package."*"] debug = false— dependencies shed all debuginfo (we never debug into them)Release profile is untouched on purpose — CI / release builds produce identical artifacts.
Measured impact
Reproducible on a fresh
cargo clean, full workspace, onmainvs this branch:cargo build --workspacecargo test --workspace --no-runcargo build --workspace --releaseRelease portion is 1.6 G in both runs — the savings come entirely from
target/debug/, exactly as intended.Build times: roughly identical (within noise; debug-info emission is a small share of total compile time).
Why this doesn't break anything
debug = "line-tables-only"controls what debuginfo the compiler emits, not codegen. Same machine code, same symbols, same linking. Stack traces still pinpoint our source lines; panic messages still print the right file/line. The only thing lost is the ability to inspect local variables of a dependency in a debugger — which nobody does fortokio/axum/rust-embedetc.Test plan
Anyone can reproduce the comparison locally:
make lint— zero warningsmake test— all greencargo build --workspace --release— succeeds, output unchanged (release profile not touched)Out of scope (follow-up PRs, tracked in #257)
make watchfromcargo build --workspacetocargo build -p coast-daemonmake pruneto also removecoast-service-dev-{cargo,target,docker}Docker volumesCONTRIBUTING.mdnote on disk hygiene/target-coventry in.gitignore(no code writes there)Closes — none yet; refs #257, parent issue stays open until B–E land.
Reviewer note: per CONTRIBUTING.md, a Loom walkthrough of the change is required — I'll attach one once the PR is reviewed for correctness, since this is a config-only change with measured numbers above.