From 5595aeb6b7eda6b96cb2fe882401213c4fc04c6f Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 30 Aug 2018 10:25:07 -0700 Subject: 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`. --- src/libstd/build.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/libstd') 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") { -- cgit 1.4.1-3-g733a5