diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 17f19222e6ea65637828e5cae38dbb0ab8e604d2..e5824010ef2cc0309e5f0006ba0bff76d630dde6 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -592,7 +592,15 @@ pub fn cargo(&self, // FIXME: Temporary fix for https://github.com/rust-lang/cargo/issues/3005 // Force cargo to output binaries with disambiguating hashes in the name - cargo.env("__CARGO_DEFAULT_LIB_METADATA", &self.config.channel); + let metadata = if compiler.stage == 0 { + // Treat stage0 like special channel, whether it's a normal prior- + // release rustc or a local rebuild with the same version, so we + // never mix these libraries by accident. + "bootstrap" + } else { + &self.config.channel + }; + cargo.env("__CARGO_DEFAULT_LIB_METADATA", &metadata); let stage; if compiler.stage == 0 && self.local_rebuild {