From 426b64625c2eff58fb2122ba56e990d976bb97fc Mon Sep 17 00:00:00 2001 From: Justin Chung Date: Thu, 29 Oct 2026 12:25:49 -0400 Subject: [PATCH] build(profile): keep line tables for the workspace and no debug info for dependencies A new `[profile.dev]` sets `debug = "line-tables-only"`, and `[profile.dev.package."*"]` sets `debug = false`. `[profile.test]` drops from `debug = 1` to `"line-tables-only"` and keeps `opt-level = 3` and `incremental`. Its dependencies inherit the dev `"*"` override, which `cargo test --no-run -v` confirms, so no test-specific package block is needed. Workspace backtraces keep file:line. Dependency frames keep their symbol names but lose file:line. `CARGO_PROFILE_DEV_DEBUG=2` and `--config 'profile.dev.package."*".debug=2'` restore full debug info for one build. --- Cargo.toml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index dd400d3..635c7ca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -96,6 +96,18 @@ rawshift-video = { path = "crates/rawshift-video", version = "0.1.1" } # Profiles must live at the workspace root — Cargo ignores profiles declared in # member manifests. + +# Line tables only for workspace crates and no debug info for Rust dependencies, +# so `target/` stays small under fast iteration. Workspace backtraces keep +# file:line; dependency frames keep symbol names but lose file:line. For full +# debug info, use `CARGO_PROFILE_DEV_DEBUG=2` (workspace) and +# `cargo --config 'profile.dev.package."*".debug=2' ...` (dependencies). +[profile.dev] +debug = "line-tables-only" + +[profile.dev.package."*"] +debug = false + [profile.release] lto = "thin" codegen-units = 1 @@ -105,9 +117,13 @@ inherits = "release" debug = 1 incremental = true +# opt-level 3 because some suites are dominated by run time. Debug info matches +# `[profile.dev]`: line tables here, and dependencies inherit its `package."*"` +# override (full debug info: `CARGO_PROFILE_TEST_DEBUG=2` plus the `--config` +# above). [profile.test] opt-level = 3 -debug = 1 +debug = "line-tables-only" incremental = true [profile.bench]