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

rustbuild: Don't enable debuginfo in rustc #38984

Merged
merged 1 commit into from
Jan 11, 2017

Conversation

alexcrichton
Copy link
Member

In #37280 we enabled line number debugging information in release artifacts,
primarily to close out #36452 where debugging information was critical for MSVC
builds of Rust to be useful in production. This commit, however, apparently had
some unfortunate side effects.

Namely it was noticed in #37477 that if RUST_BACKTRACE=1 was set then any
compiler error would take a very long time for the compiler to exit. The cause
of the problem here was somewhat deep:

To solve this problem this commit simply removes debuginfo from the compiler but
not from the standard library. This should allow us to keep #36452 closed while
also closing #37477. I've measured the difference to be orders of magnitude
faster than it was before, so we should see a much quicker time-to-exit after a
compile error when RUST_BACKTRACE=1 is set.

Closes #37477
Closes #37571

In rust-lang#37280 we enabled line number debugging information in release artifacts,
primarily to close out rust-lang#36452 where debugging information was critical for MSVC
builds of Rust to be useful in production. This commit, however, apparently had
some unfortunate side effects.

Namely it was noticed in rust-lang#37477 that if `RUST_BACKTRACE=1` was set then any
compiler error would take a very long time for the compiler to exit. The cause
of the problem here was somewhat deep:

* For all compiler errors, the compiler will `panic!` with a known value. This
  tears down the main compiler thread and allows cleaning up all the various
  resources. By default, however, this panic output is suppressed for "normal"
  compiler errors.
* When `RUST_BACKTRACE=1` was set this caused every compiler error to generate a
  backtrace.
* The libbacktrace library hits a pathological case where it spends a very long
  time in its custom allocation function, `backtrace_alloc`, because the
  compiler has so much debugging information. More information about this can be
  found in rust-lang#29293 with a summary at the end of rust-lang#37477.

To solve this problem this commit simply removes debuginfo from the compiler but
not from the standard library. This should allow us to keep rust-lang#36452 closed while
also closing rust-lang#37477. I've measured the difference to be orders of magnitude
faster than it was before, so we should see a much quicker time-to-exit after a
compile error when `RUST_BACKTRACE=1` is set.

Closes rust-lang#37477
Closes rust-lang#37571
@rust-highfive
Copy link
Collaborator

r? @aturon

(rust_highfive has picked a reviewer for you, use r? to override)

@brson
Copy link
Contributor

brson commented Jan 11, 2017

@bors r+

@bors
Copy link
Contributor

bors commented Jan 11, 2017

📌 Commit 099e7cb has been approved by brson

@brson brson added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jan 11, 2017
@brson
Copy link
Contributor

brson commented Jan 11, 2017

Is this bug bag enough to backport a fix?

@matklad
Copy link
Member

matklad commented Jan 11, 2017

Is this bug bag enough to backport a fix?

I personally would like a backport for IntelliJ Rust. We now provide nice hypelinks for backtraces (for files names(src/main.rs) and for paths (::foo::bar::baz), so useful even on MVSC windows which does not show file names), so we'd love to use RUST_BACKTRACE=1 by default, and we can't because of the said bug.

@bors
Copy link
Contributor

bors commented Jan 11, 2017

⌛ Testing commit 099e7cb with merge 52c03d1...

bors added a commit that referenced this pull request Jan 11, 2017
rustbuild: Don't enable debuginfo in rustc

In #37280 we enabled line number debugging information in release artifacts,
primarily to close out #36452 where debugging information was critical for MSVC
builds of Rust to be useful in production. This commit, however, apparently had
some unfortunate side effects.

Namely it was noticed in #37477 that if `RUST_BACKTRACE=1` was set then any
compiler error would take a very long time for the compiler to exit. The cause
of the problem here was somewhat deep:

* For all compiler errors, the compiler will `panic!` with a known value. This
  tears down the main compiler thread and allows cleaning up all the various
  resources. By default, however, this panic output is suppressed for "normal"
  compiler errors.
* When `RUST_BACKTRACE=1` was set this caused every compiler error to generate a
  backtrace.
* The libbacktrace library hits a pathological case where it spends a very long
  time in its custom allocation function, `backtrace_alloc`, because the
  compiler has so much debugging information. More information about this can be
  found in #29293 with a summary at the end of #37477.

To solve this problem this commit simply removes debuginfo from the compiler but
not from the standard library. This should allow us to keep #36452 closed while
also closing #37477. I've measured the difference to be orders of magnitude
faster than it was before, so we should see a much quicker time-to-exit after a
compile error when `RUST_BACKTRACE=1` is set.

Closes #37477
Closes #37571
@bors
Copy link
Contributor

bors commented Jan 11, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: brson
Pushing 52c03d1 to master...

@bors bors merged commit 099e7cb into rust-lang:master Jan 11, 2017
@alexcrichton alexcrichton deleted the less-debuginfo branch January 11, 2017 17:37
@alexcrichton
Copy link
Member Author

@brson I agree that we should backport

@alexcrichton alexcrichton added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Jan 11, 2017
@brson brson mentioned this pull request Jan 17, 2017
@alexcrichton alexcrichton removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel.
Projects
None yet
6 participants