Skip to content

build: strip third-party debug symbols to line-tables-only in dev builds#3173

Open
lklimek wants to merge 2 commits intov3.1-devfrom
build/strip-dep-debug-symbols
Open

build: strip third-party debug symbols to line-tables-only in dev builds#3173
lklimek wants to merge 2 commits intov3.1-devfrom
build/strip-dep-debug-symbols

Conversation

@lklimek
Copy link
Contributor

@lklimek lklimek commented Mar 3, 2026

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."*"] with debug = "line-tables-only" to the workspace root Cargo.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.test inherits from profile.dev, so test builds benefit automatically.

Benchmark (clean cargo build --workspace)

Metric Without (baseline) With line-tables-only Delta
Wall time 2m 18s 2m 20s ~0 (noise)
CPU time (user) 20m 40s 20m 24s -16s (~1.3%)
Target dir size 21 GiB 19 GiB -2 GiB (~9.5%)

How Has This Been Tested?

  • Full clean cargo build --workspace — compiles successfully
  • Full clean cargo check --workspace — no errors
  • Benchmarked with and without the change (results above)

Breaking Changes

None

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

🤖 Co-authored by Claudius the Magnificent AI Agent

Summary by CodeRabbit

  • Chores
    • Optimized development and test builds to reduce debug information size while maintaining essential debugging capabilities.
    • Established minimum Rust toolchain version requirement (1.92) for the workspace.

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>
@github-actions github-actions bot added this to the v3.1.0 milestone Mar 3, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 3, 2026

Warning

Rate limit exceeded

@lklimek has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 7 minutes and 25 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e3884036-7bb0-4ac4-9ba5-af7fdc4c54a3

📥 Commits

Reviewing files that changed from the base of the PR and between 1c01031 and 41b5f91.

📒 Files selected for processing (1)
  • Cargo.toml
📝 Walkthrough

Walkthrough

Cargo.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

Cohort / File(s) Summary
Build and Workspace Configuration
Cargo.toml
Added dev-profile package override to strip full debug info from dependencies while preserving file/line information, and explicit Rust version requirement (1.92) at workspace level.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 Hopping through configs with glee,
We trim the debug bloat, you see—
Line tables only for the rest,
While Rust 1.92's our nest!
Lean binaries and clear requirement lines,
Make these build-time designs shine! 🎯

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a profile configuration to strip third-party debug symbols to line-tables-only in dev builds, which directly matches the Cargo.toml modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch build/strip-dep-debug-symbols

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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."*"] with debug = "line-tables-only" to the workspace root Cargo.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.

@thepastaclaw
Copy link
Contributor

Hey @QuantumExplorer — this is targeting only third-party crates. The [profile.dev.package."*"] selector is Cargo's built-in mechanism for overriding profile settings on all non-workspace packages (i.e., external dependencies). Workspace members are explicitly excluded from "*" and retain their full debug = true setting.

From the Cargo reference:

[profile.dev.package."*"] — Sets the override for all packages. The "*" pattern matches all packages that are not members of the workspace.

This is a well-established pattern in the Rust ecosystem — projects like Bevy use the exact same [profile.dev.package."*"] override for similar reasons (e.g., setting opt-level = 2 for deps while keeping workspace crates at 0 for fast iteration).

The alternative would be listing individual heavy crates ([profile.dev.package.rocksdb-sys], etc.), but that's fragile and requires maintenance as the dep tree changes. The wildcard is the idiomatic approach here.

@lklimek lklimek requested a review from shumkov March 4, 2026 07:32
@lklimek lklimek added the ready for final review Ready for the final review. If AI was involved in producing this PR, it has already had a reviewer. label Mar 4, 2026
@shumkov
Copy link
Collaborator

shumkov commented Mar 4, 2026

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.

@lklimek
Copy link
Contributor Author

lklimek commented Mar 5, 2026

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).

@lklimek lklimek requested a deployment to test-suite-approval March 6, 2026 12:11 — with GitHub Actions Waiting
@lklimek lklimek requested a deployment to test-suite-approval March 6, 2026 12:11 — with GitHub Actions Waiting
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

✅ 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:

  • Download 'DashSDKFFI.xcframework' artifact from the run link above.
  • Drag it into your app target (Frameworks, Libraries & Embedded Content) and set Embed & Sign.
  • If using the Swift wrapper package, point its binaryTarget to the xcframework location or add the package and place the xcframework at the expected path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for final review Ready for the final review. If AI was involved in producing this PR, it has already had a reviewer.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants