Skip to content

Commit

Permalink
cargo: compile all packages with -C debuginfo=line-tables-only
Browse files Browse the repository at this point in the history
This causes `rustc` to only emit enough debuginfo to emit backtraces with
filepaths and line numbers, but nothing more. This has a massive impact on the
size of `target/` in practice; a clean rebuild of all dependencies (tested via
`cargo nextest run --workspace --no-run`) goes from ~5.5GiB to 2.1GiB.

This should help us stave off the dreaded sacrificial "delete `target/` to save
disk space" ritual that we occasionally must invoke (today I realized my `jj`
build dir was over 120GiB.)

Signed-off-by: Austin Seipp <[email protected]>
Change-Id: Ia1f31b87da89e59d77f54a3d79cb45113db215dc
  • Loading branch information
thoughtpolice committed Jun 12, 2024
1 parent 2589b4d commit 1e2d3ce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,13 @@ testutils = { path = "lib/testutils" }

[profile.dev.package."*"]
codegen-units = 1
debug = "line-tables-only"
opt-level = 3

[profile.dev]
debug = "line-tables-only"

[profile.release]
debug = "line-tables-only"
strip = "debuginfo"
codegen-units = 1

0 comments on commit 1e2d3ce

Please sign in to comment.