From cc99b808d73bd28988027271fd8fb9231ea6fed9 Mon Sep 17 00:00:00 2001 From: Austin Seipp Date: Thu, 4 Apr 2024 01:35:05 -0500 Subject: [PATCH] cargo: compile all packages with `-C debuginfo=line-tables-only` 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 Change-Id: Ia1f31b87da89e59d77f54a3d79cb45113db215dc --- Cargo.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 73f8e72132..687702a745 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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