Skip to content

Commit

Permalink
Rollup merge of rust-lang#63558 - jgalenson:move-remap, r=alexcrichton
Browse files Browse the repository at this point in the history
Remap paths for proc-macro crates.

The remap-debuginfo config option remaps paths in most crates, but it does not apply to proc-macros, so they are still non-reproducible.  This patch fixes that.

I'm not completely sure if this is the best way to do this, but to get reproducible builds we need librustc_macros to be built with --remap-path-prefix.  I was previously modifying Cargo to pass that argument to all child crates, so this seems simpler and more correct.

I did not add a test since there do not seem to be any existing tests for RUSTC_DEBUGINFO_MAP.

r? @alexcrichton
  • Loading branch information
Centril committed Aug 17, 2019
2 parents 13b1031 + 9e2d02a commit 786aaf0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/bootstrap/bin/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,6 @@ fn main() {
cmd.arg("-C").arg("target-feature=-crt-static");
}
}

if let Ok(map) = env::var("RUSTC_DEBUGINFO_MAP") {
cmd.arg("--remap-path-prefix").arg(&map);
}
} else {
// Override linker if necessary.
if let Ok(host_linker) = env::var("RUSTC_HOST_LINKER") {
Expand All @@ -296,6 +292,10 @@ fn main() {
}
}

if let Ok(map) = env::var("RUSTC_DEBUGINFO_MAP") {
cmd.arg("--remap-path-prefix").arg(&map);
}

// Force all crates compiled by this compiler to (a) be unstable and (b)
// allow the `rustc_private` feature to link to other unstable crates
// also in the sysroot. We also do this for host crates, since those
Expand Down

0 comments on commit 786aaf0

Please sign in to comment.