Skip to content

Commit

Permalink
Rollup merge of rust-lang#110121 - jyn514:check-stage1, r=ozkanonur
Browse files Browse the repository at this point in the history
Fix `x check --stage 1` when download-rustc is enabled

Helps with rust-lang#81930
  • Loading branch information
Dylan-DPC authored Apr 10, 2023
2 parents e327487 + 2b43f25 commit 6f2fd3e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/bootstrap/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,17 @@ impl Step for Rustc {
false,
);

let libdir = builder.sysroot_libdir(compiler, target);
let hostdir = builder.sysroot_libdir(compiler, compiler.host);
add_to_sysroot(&builder, &libdir, &hostdir, &librustc_stamp(builder, compiler, target));
// HACK: This avoids putting the newly built artifacts in the sysroot if we're using
// `download-rustc`, to avoid "multiple candidates for `rmeta`" errors. Technically, that's
// not quite right: people can set `download-rustc = true` to download even if there are
// changes to the compiler, and in that case ideally we would put the *new* artifacts in the
// sysroot, in case there are API changes that should be used by tools. In practice,
// though, that should be very uncommon, and people can still disable download-rustc.
if !builder.download_rustc() {
let libdir = builder.sysroot_libdir(compiler, target);
let hostdir = builder.sysroot_libdir(compiler, compiler.host);
add_to_sysroot(&builder, &libdir, &hostdir, &librustc_stamp(builder, compiler, target));
}
}
}

Expand Down

0 comments on commit 6f2fd3e

Please sign in to comment.