Skip to content

Commit 55caf1d

Browse files
committed
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.
1 parent c01be67 commit 55caf1d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/bootstrap/bin/rustc.rs

+10
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,16 @@ fn main() {
305305
cmd.arg("-C").arg("target-feature=-crt-static");
306306
}
307307
}
308+
309+
let crate_type = args.windows(2)
310+
.find(|w| &*w[0] == "--crate-type")
311+
.and_then(|w| w[1].to_str());
312+
313+
if let Some("proc-macro") = crate_type {
314+
if let Ok(map) = env::var("RUSTC_DEBUGINFO_MAP") {
315+
cmd.arg("--remap-path-prefix").arg(&map);
316+
}
317+
}
308318
}
309319

310320
// Force all crates compiled by this compiler to (a) be unstable and (b)

0 commit comments

Comments
 (0)