Repository navigation
Reduce debug information for local dependencies - #769
jianjian0504 wants to merge 4 commits into
Conversation
Use line tables for dependencies in dev and test builds to reduce local build output on disk. Update the development guide. Close sysprog21#755 Change-Id: Ief2703031ca6a9d83f898c1d6bdc8a9fced7609c
dges5202
left a comment
There was a problem hiding this comment.
The line-tables-only override itself looks fine and the Apple Silicon numbers in the PR body are useful. Two doc/comment fixes so the next reader does not confuse this with the codec-speed tradeoff above it, or with CI's whole-profile trim.
Verification (checkout
|
Explain the disk footprint setting and rust-embed assertion override. Document the CI profile scope and measured local disk savings. Change-Id: I460648590dc34da1052e9370d7561516dc60a35b
f4603f5 to
791035d
Compare
dges5202
left a comment
There was a problem hiding this comment.
Re-checked 791035d8.
Both follow-ups from my earlier review are addressed:
Cargo.toml: comments markline-tables-onlyas a disk/backtrace setting for dependencies, and the rust-embed note is no longer "codec speed only".docs/development.md: CI whole-profile trim vs localpackage."*"trim is explicit, with the ~49 MiB / ~1% measurement cited.
cargo metadata --no-deps still parses cleanly here. Approving.
|
@dges5202, Never approve a PR marked as a draft. As the human reviewer, exercise your own judgment when evaluating the changes and any feedback from AI tools. |
|
@jserv Understood — I should not have Approved while this PR was still a draft. Sorry for the noise. I re-checked the two doc/comment follow-ups on |
dges5202
left a comment
There was a problem hiding this comment.
Follow-up to the draft-Approve mistake: withdrawing the intent of my earlier Approve while this stays a draft. The Cargo.toml / docs/development.md follow-ups still look correct on this head; I will Approve only after Ready for review.
|
I ran ./scripts/test.sh browser on Ubuntu 24.04 in GitHub Codespaces at 791035d. The full run had 3,651 passes and 2 failures. Both failed cases passed when rerun individually: the compact drawing stage test and the Java start test. Could you re-run the failed GitHub Actions jobs for this commit? All three browser jobs stopped at Install system packages, before the browser tests started. |
Record the Linux disk measurements that motivated the dependency override and identify the workload used for the CI relink comparison. Change-Id: I446e3717a56f8dd4a5a0fd218776df386142a369
|
|
||
| Local dev and test builds use `debug = "line-tables-only"` in their | ||
| `package."*"` overrides. Dependencies retain file and line information | ||
| for backtraces, and workspace packages keep full debug information. In |
There was a problem hiding this comment.
When a contributor steps into a dependency, line tables still locate the source, but the debugger loses the type and local-variable information it previously had. Please document how to restore it for one crate. For example, cargo test --config 'profile.test.package.tokio.debug=2' enables full debug information for Tokio while investigating a test.
| only line tables across the entire dev and test profiles. After a | ||
| one-file edit, relinking the test suite took 16.6s with full debug | ||
| information and 9.9s with line tables only, about 40% less time. The | ||
| macOS comparison with the system linker measured 7.5s and 8.1s. The |
There was a problem hiding this comment.
This drops which configuration took 7.5s and which took 8.1s. It also drops the conclusion the old text drew: on macOS, where the system linker rather than mold does the link, trimming debug info buys no relink time. That conclusion is why disk space is the only argument left for the local setting, so name each time with its configuration and state the conclusion in one sentence, instead of leaving two bare numbers between the CI figure and the disk figures.
There was a problem hiding this comment.
Could you confirm which macOS relink time used full debug information and which used line-tables-only? The earlier documentation lists 7.5s and 8.1s without labeling the configurations. I’ll label both timings and clarify that the local override is intended to save disk space.
|
Some review comments on this pull request are not settled yet. Please refine the change per the review comments listed below, reply on each thread with what you changed or why you did not, and mark each thread resolved yourself once it is settled (Resolve conversation, at the bottom of the thread). The pull request stays blocked while review threads are open. Not addressed at the current head:
Checked at a3df383. |
Show how to restore full debug information for Tokio so contributors can inspect types and local variables. Correct the wording of the web test binary size comparison. Change-Id: I9bf8e63f52c57ce46c41dbf1e53e7332ebf40b31
Summary
Set
debug = "line-tables-only"in the[profile.dev.package."*"]and[profile.test.package."*"]overrides. This reduces the disk footprint oflocal dependency builds while retaining source file and line information
for backtraces.
Update
docs/development.mdto clarify that the earlier experimentmeasured relink time and that this change targets disk usage.
Apple Silicon measurements
Built the
codetrialweb integration test withcargo test --locked --no-run -p codetrial --test web, using a separate clean target directoryfor each configuration.
Testing
Ran the web integration suite serially with the line-tables-only
configuration on Apple Silicon. Result: 227 passed, 0 failed, 2 ignored.
Close #755
Summary by cubic
Reduces disk usage of local
devandtestdependency builds withdebug = "line-tables-only", keeping file and line info in backtraces while dropping full debug info. Workspace packages keep full debug info by default.Updates
docs/development.mdto clarify the earlier measurement was relink time, document therust-embeddebug-assertions override, show how to restore full debug info for Tokio, and record the Linux disk measurements.Measurements
cargo test --no-run --all-targetsuses 8.0 GB with line tables only, down from 9.9 GB; thewebtest executable shrinks from 404 MB to 270 MB.codetrialweb test target directory shrinks by 49.3 MiB (1.06%); the executable by 380,400 bytes (0.52%); 227 passed, 0 failed, 2 ignored.Closes #755.
Written for commit 1965963. Summary will update on new commits.