From 9a08a0330798b3d538a74ed0712cf6ffde8e5a6e Mon Sep 17 00:00:00 2001 From: YifanXu1999 Date: Mon, 23 Nov 2026 02:20:45 +0800 Subject: [PATCH] build: keep line-table debug info only in dev and test profiles Set debug = "line-tables-only" for [profile.dev] and [profile.test]. Backtraces keep function, file and line; debugger locals need CARGO_PROFILE_DEV_DEBUG=2 / CARGO_PROFILE_TEST_DEBUG=2. The release profile is unchanged, so product binaries and measurements are not affected. CI already sets CARGO_PROFILE_TEST_DEBUG=0 and is unaffected. Diagnostic build check, taken on main 7d42d0b506 before rebasing here (one cold sample per arm, layerfs-content only, cargo 1.85.1, macOS aarch64, -j 6, host 1-min load 8.8-13.9 from other sessions; not a product measurement): - cargo build --tests: 26.6 s -> 14.3 s wall, 66.4 -> 49.9 s user; target 964 -> 800 MB (-17%), deps 471 -> 347 MB (-26%) - cargo test --no-run: 34.5 s -> 31.9 s wall, 162.8 -> 143.7 s user; target 1092 -> 865 MB (-21%); test executables unchanged on macOS (debug info stays in object files there) Production LOC: 206163 -> 206163 (delta 0); scope core+engine+control+api, tools/production_loc.py at parent 2f6718e193 and committed tree; manifest-only change. Reference absent (retired R9c; last counted 65,417 at tree 498dd1917812). Deleted tests: none. Co-Authored-By: Claude Opus 5.5 --- Cargo.toml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 3af11cfa43..ff608dd140 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,10 +16,18 @@ version = "2.0.0" rust-version = "1.85" license = "MIT" +# Development builds keep file:line debug info only: backtraces stay useful, +# targets are smaller and links faster. For full debugger variables set +# CARGO_PROFILE_DEV_DEBUG=2 (or CARGO_PROFILE_TEST_DEBUG=2). The release +# profile is unchanged. +[profile.dev] +debug = "line-tables-only" + # Keep the large boundary fixtures cheap without removing cases or assertions. -# Product dev/release profiles and test debug assertions stay unchanged. +# Test debug assertions stay unchanged. [profile.test] opt-level = 1 +debug = "line-tables-only" [profile.test.package.zstd-sys] opt-level = 3