about summary refs log tree commit diff
path: root/src/bootstrap/config.toml.example
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2017-01-10 20:01:54 -0800
committerAlex Crichton <alex@alexcrichton.com>2017-01-10 20:33:12 -0800
commit099e7cb120ad2cf7c85609ec58ef6a1ac7a56b1d (patch)
tree8c72564cecb916c35c5df8192493046f4c03a3a5 /src/bootstrap/config.toml.example
parente4fee525e04838dabc82beed5ae1a06051be53fd (diff)
downloadrust-099e7cb120ad2cf7c85609ec58ef6a1ac7a56b1d.tar.gz
rust-099e7cb120ad2cf7c85609ec58ef6a1ac7a56b1d.zip
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
Diffstat (limited to 'src/bootstrap/config.toml.example')
-rw-r--r--src/bootstrap/config.toml.example5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/bootstrap/config.toml.example b/src/bootstrap/config.toml.example
index 69210c4959b..76ac2808f09 100644
--- a/src/bootstrap/config.toml.example
+++ b/src/bootstrap/config.toml.example
@@ -149,6 +149,11 @@
 # Whether or not line number debug information is emitted
 #debuginfo-lines = false
 
+# Whether or not to only build debuginfo for the standard library if enabled.
+# If enabled, this will not compile the compiler with debuginfo, just the
+# standard library.
+#debuginfo-only-std = false
+
 # Whether or not jemalloc is built and enabled
 #use-jemalloc = true