]> git.lizzy.rs Git - rust.git/commitdiff
Fix rustc binary metadata overwriting librustc metadata
authorMark Simulacrum <mark.simulacrum@gmail.com>
Sat, 12 May 2018 03:30:02 +0000 (21:30 -0600)
committerMark Simulacrum <mark.simulacrum@gmail.com>
Thu, 17 May 2018 14:47:25 +0000 (08:47 -0600)
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.

https://github.com/rust-lang/cargo/issues/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.

src/bootstrap/compile.rs
src/rustc/Cargo.toml

index 1248c2b50be5e8700b4fa672ced5981db5db41b8..163493a443d8ebf316a7e76256a291f4b0c1d871 100644 (file)
@@ -972,7 +972,7 @@ fn run(self, builder: &Builder) -> Compiler {
 
         // Link the compiler binary itself into place
         let out_dir = builder.cargo_out(build_compiler, Mode::Librustc, host);
-        let rustc = out_dir.join(exe("rustc", &*host));
+        let rustc = out_dir.join(exe("rustc_binary", &*host));
         let bindir = sysroot.join("bin");
         t!(fs::create_dir_all(&bindir));
         let compiler = builder.rustc(target_compiler);
index 9986e0b512a347583c00c783ce090bb3b417a2b0..9ccd37a6a45924fb1e4ecf88795d62e277311e44 100644 (file)
@@ -4,7 +4,7 @@ name = "rustc-main"
 version = "0.0.0"
 
 [[bin]]
-name = "rustc"
+name = "rustc_binary"
 path = "rustc.rs"
 
 [dependencies]