Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustc_codegen_llvm: don't generate any type debuginfo for -Cdebuginfo=1. #69080

Merged
merged 4 commits into from
Mar 23, 2020

Conversation

eddyb
Copy link
Member

@eddyb eddyb commented Feb 12, 2020

Works towards #69074 by adding more checks for DebugInfo::Full in a few places in rustc_codegen_llvm, bringing us in line with what clang -g1 generates (no debuginfo types, nor debuginfo for statics).


My local build's (debuginfo-level=1, debug-assertions=1) librustc_driver-*.so went from just over 1GiB (1019MiB) down to 402MiB.

It's still bad, but the .debug_* sections themselves (as reported by objdump) went from something like 853MiB down to 236MiB, i.e. roughly a 3.6x reduction.


Sadly, I don't think this is enough to justify shipping all of this debuginfo, but now it's more plausible that we could at least build with debuginfo-level=1 then strip it.
That would give us real backtraces for e.g. ICEs during builds, but I don't know how often that's relevant.

We could also look into split DWARF, and maybe have a rustc-debuginfo component in rustup.

There's also the possibility of making it slimmer by omitting parameters to functions, or perhaps some deduplication (I think right now there is no DWARF reuse across CGUs? maybe ThinLTO helps?).

r? @michaelwoerister cc @rust-lang/wg-codegen @alexcrichton @Mark-Simulacrum

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 12, 2020
src/librustc_codegen_llvm/debuginfo/mod.rs Outdated Show resolved Hide resolved
src/librustc_codegen_llvm/debuginfo/mod.rs Outdated Show resolved Hide resolved
src/librustc_codegen_llvm/debuginfo/mod.rs Show resolved Hide resolved
@michaelwoerister
Copy link
Member

Thanks for the PR, @eddyb!

I want to be careful with merging this so we don't run into a problem like #60020.

@eddyb

This comment has been minimized.

@JohnCSimon JohnCSimon added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 2, 2020
@eddyb

This comment has been minimized.

@eddyb eddyb force-pushed the one-billion-dwarves-walk-into-a-bar branch from 440e474 to bcfddd9 Compare March 17, 2020 10:52
@eddyb
Copy link
Member Author

eddyb commented Mar 17, 2020

I've removed the commit with the FIXMEs, and I think we can just land this PR as-is.
See also #69074 (comment) for future work after this PR is merged.

@nagisa @hanna-kruppe Do either of you want to review this?

@eddyb eddyb added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 17, 2020
@michaelwoerister
Copy link
Member

This looks straightforward to me now. Thanks, @eddyb!

@bors r+

@bors
Copy link
Contributor

bors commented Mar 20, 2020

📌 Commit bcfddd9b883f1b19f5aca7ce450fed22ca4cd355 has been approved by michaelwoerister

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 20, 2020
@bors
Copy link
Contributor

bors commented Mar 22, 2020

⌛ Testing commit bcfddd9b883f1b19f5aca7ce450fed22ca4cd355 with merge 64c5abdf57876e69861591d6ad757ffa4dd7a76c...

@bors
Copy link
Contributor

bors commented Mar 22, 2020

💔 Test failed - checks-azure

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 22, 2020
@eddyb eddyb force-pushed the one-billion-dwarves-walk-into-a-bar branch from bcfddd9 to b5e78a2 Compare March 23, 2020 00:57
@eddyb
Copy link
Member Author

eddyb commented Mar 23, 2020

@bors r=michaelwoerister

@bors
Copy link
Contributor

bors commented Mar 23, 2020

📌 Commit b5e78a2 has been approved by michaelwoerister

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 23, 2020
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Mar 23, 2020
@bors
Copy link
Contributor

bors commented Mar 23, 2020

⌛ Testing commit b5e78a2 with merge 81459fe37234126246a4d483866b171936defc2f...

@Centril
Copy link
Contributor

Centril commented Mar 23, 2020

@bors retry

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 23, 2020
Rollup of 8 pull requests

Successful merges:

 - rust-lang#69080 (rustc_codegen_llvm: don't generate any type debuginfo for -Cdebuginfo=1.)
 - rust-lang#69940 (librustc_codegen_llvm: Replace deprecated API usage)
 - rust-lang#69942 (Increase verbosity when suggesting subtle code changes)
 - rust-lang#69968 (rustc: keep upvars tupled in {Closure,Generator}Substs.)
 - rust-lang#70123 (Ensure LLVM is in the link path for rustc tools)
 - rust-lang#70159 (Update the bundled wasi-libc with libstd)
 - rust-lang#70233 (resolve: Do not resolve visibilities on proc macro definitions twice)
 - rust-lang#70286 (Miri error type: remove UbExperimental variant)

Failed merges:

r? @ghost
@bors
Copy link
Contributor

bors commented Mar 23, 2020

⌛ Testing commit b5e78a2 with merge 5aa8f19...

@bors bors merged commit 1980242 into rust-lang:master Mar 23, 2020
@eddyb eddyb deleted the one-billion-dwarves-walk-into-a-bar branch March 23, 2020 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants