Skip to content

Commit

Permalink
Rollup merge of rust-lang#50789 - cuviper:bootstrap-metadata, r=alexc…
Browse files Browse the repository at this point in the history
…richton

Ensure libraries built in stage0 have unique metadata

Issue rust-lang#50786 shows a case with local rebuild where the libraries built
by stage0 had the same suffix as stage0's own, and were accidentally
loaded by that stage0 rustc when compiling `librustc_trans`.

Now we set `__CARGO_DEFAULT_LIB_METADATA` to "bootstrap" during stage0,
rather than the release channel like usual, so the library suffix will
always be completely distinct from the stage0 compiler.
  • Loading branch information
kennytm committed May 16, 2018
2 parents d3bf721 + e8e5eb5 commit e4f8132
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/bootstrap/builder.rs
Expand Up @@ -592,7 +592,15 @@ impl<'a> Builder<'a> {

// 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 {
Expand Down

0 comments on commit e4f8132

Please sign in to comment.