build: strip third-party debug symbols to line-tables-only in dev builds#3173
build: strip third-party debug symbols to line-tables-only in dev builds#3173
Conversation
Add [profile.dev.package."*"] with debug = "line-tables-only" to the workspace root. This reduces DWARF output for all non-workspace crates to just filename + line number, which is sufficient for backtraces but skips types, variables, and scope info we never debug into. Benchmark (clean `cargo build --workspace`): - Build time: ~2m 19s → ~2m 20s (within noise) - Target dir: 21 GiB → 19 GiB (~9.5% reduction) - CPU time: 20m 40s → 20m 24s Workspace members retain full debuginfo. profile.test inherits from profile.dev, so test builds benefit automatically. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughCargo.toml updated to introduce a development-profile override that sets debug symbols to line-tables-only for third-party crates, reducing debug information overhead. Additionally, a workspace-level Rust version requirement of 1.92 is specified. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR reduces the size of the Cargo build target directory in dev/test builds by stripping full DWARF debug symbols from all third-party (non-workspace) crate dependencies, keeping only line-table information sufficient for backtraces.
Changes:
- Adds
[profile.dev.package."*"]withdebug = "line-tables-only"to the workspace rootCargo.toml, reducing target directory size by ~2 GiB (~9.5%) with negligible impact on build time.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hey @QuantumExplorer — this is targeting only third-party crates. The From the Cargo reference:
This is a well-established pattern in the Rust ecosystem — projects like Bevy use the exact same The alternative would be listing individual heavy crates ( |
|
I'm not sure this profit worth potential problems in future when we forgot this setting and won't be able to make work debuggers or something else related. |
My debugger doesn't work at all in platform, not sure about yours. It doesn't show any variables.. In dash-evo-tool, I'm not able to dump backtrace due to issues with backtrace size (that's why I started investigating this topic at all). |
|
✅ DashSDKFFI.xcframework built for this PR.
SwiftPM (host the zip at a stable URL, then use): .binaryTarget(
name: "DashSDKFFI",
url: "https://your.cdn.example/DashSDKFFI.xcframework.zip",
checksum: "7a81c4001ccf04cc6dce8b713435849384ddb53ae97db996bf115591e21270e7"
)Xcode manual integration:
|
Issue being fixed or feature implemented
Dev builds carry full DWARF debug info for all third-party crates, bloating the target directory and adding unnecessary linker work for symbols we never debug into.
What was done?
Added
[profile.dev.package."*"]withdebug = "line-tables-only"to the workspace rootCargo.toml.This reduces debug output for all non-workspace crates (third-party deps) to just filename + line number — sufficient for backtraces but skipping types, variables, and scope info. Workspace members retain full debuginfo.
profile.testinherits fromprofile.dev, so test builds benefit automatically.Benchmark (clean
cargo build --workspace)line-tables-onlyHow Has This Been Tested?
cargo build --workspace— compiles successfullycargo check --workspace— no errorsBreaking Changes
None
Checklist:
🤖 Co-authored by Claudius the Magnificent AI Agent
Summary by CodeRabbit