Skip to content

Commit 1ae3cff

Browse files
Fix rustc binary metadata overwriting librustc metadata
In #49289, rustc was changed to emit metadata for binaries, which made it so that the librustc.rmeta file created when compiling librustc was overwritten by the rustc-main compilation. This commit renames the rustc-main binary to avoid this problem. rust-lang/cargo#5524 has also been filed to see if Cargo can learn to warn on this situation instead of leaving it for the user to debug.
1 parent 47f88e1 commit 1ae3cff

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/bootstrap/compile.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ impl Step for Assemble {
972972

973973
// Link the compiler binary itself into place
974974
let out_dir = builder.cargo_out(build_compiler, Mode::Librustc, host);
975-
let rustc = out_dir.join(exe("rustc", &*host));
975+
let rustc = out_dir.join(exe("rustc_binary", &*host));
976976
let bindir = sysroot.join("bin");
977977
t!(fs::create_dir_all(&bindir));
978978
let compiler = builder.rustc(target_compiler);

src/rustc/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name = "rustc-main"
44
version = "0.0.0"
55

66
[[bin]]
7-
name = "rustc"
7+
name = "rustc_binary"
88
path = "rustc.rs"
99

1010
[dependencies]

0 commit comments

Comments
 (0)