about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2018-08-30 10:25:07 -0700
committerAlex Crichton <alex@alexcrichton.com>2018-09-10 10:10:38 -0700
commit5595aeb6b7eda6b96cb2fe882401213c4fc04c6f (patch)
treec8441baefb29564effd126f431c8ee4e21f98bb5 /src/libstd
parentfc81e36242ddddb7149a0d1ca44ebce7fb9eef8a (diff)
downloadrust-5595aeb6b7eda6b96cb2fe882401213c4fc04c6f.tar.gz
rust-5595aeb6b7eda6b96cb2fe882401213c4fc04c6f.zip
Add rustc SHA to released DWARF debuginfo
This commit updates the debuginfo that is encoded in all of our released
artifacts by default. Currently it has paths like `/checkout/src/...` but these
are a little inconsistent and have changed over time. This commit instead
attempts to actually define the file paths in our debuginfo to be consistent
between releases.

All debuginfo paths are now intended to be `/rustc/$sha` where `$sha` is the git
sha of the released compiler. Sub-paths are all paths into the git repo at that
`$sha`.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/build.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libstd/build.rs b/src/libstd/build.rs
index 016e7adb4c9..0831e29bddd 100644
--- a/src/libstd/build.rs
+++ b/src/libstd/build.rs
@@ -97,6 +97,10 @@ fn build_libbacktrace(target: &str) -> Result<(), ()> {
         .file("../libbacktrace/sort.c")
         .file("../libbacktrace/state.c");
 
+    let any_debug = env::var("RUSTC_DEBUGINFO").unwrap_or(String::new()) == "true" ||
+        env::var("RUSTC_DEBUGINFO_LINES").unwrap_or(String::new()) == "true";
+    build.debug(any_debug);
+
     if target.contains("darwin") {
         build.file("../libbacktrace/macho.c");
     } else if target.contains("windows") {