Skip to content

Commit 833447d

Browse files
authored
Rollup merge of rust-lang#63558 - jgalenson:move-remap, r=alexcrichton
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
2 parents 28d4d9a + 9e2d02a commit 833447d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/bootstrap/bin/rustc.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,6 @@ fn main() {
276276
cmd.arg("-C").arg("target-feature=-crt-static");
277277
}
278278
}
279-
280-
if let Ok(map) = env::var("RUSTC_DEBUGINFO_MAP") {
281-
cmd.arg("--remap-path-prefix").arg(&map);
282-
}
283279
} else {
284280
// Override linker if necessary.
285281
if let Ok(host_linker) = env::var("RUSTC_HOST_LINKER") {
@@ -296,6 +292,10 @@ fn main() {
296292
}
297293
}
298294

295+
if let Ok(map) = env::var("RUSTC_DEBUGINFO_MAP") {
296+
cmd.arg("--remap-path-prefix").arg(&map);
297+
}
298+
299299
// Force all crates compiled by this compiler to (a) be unstable and (b)
300300
// allow the `rustc_private` feature to link to other unstable crates
301301
// also in the sysroot. We also do this for host crates, since those

0 commit comments

Comments
 (0)