Skip to content

Commit 435e1c6

Browse files
committed
install rustc before the tools
Signed-off-by: onur-ozkan <[email protected]>
1 parent 81c068a commit 435e1c6

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Diff for: src/bootstrap/src/core/build_steps/dist.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -398,10 +398,11 @@ impl Step for Rustc {
398398
let host = compiler.host;
399399
let src = builder.sysroot(compiler);
400400

401-
// Copy rustc/rustdoc binaries
401+
// Copy rustc binary
402402
t!(fs::create_dir_all(image.join("bin")));
403403
builder.cp_r(&src.join("bin"), &image.join("bin"));
404404

405+
// If enabled, copy rustdoc binary
405406
if builder
406407
.config
407408
.tools

Diff for: src/bootstrap/src/core/builder.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,11 @@ impl<'a> Builder<'a> {
858858
Kind::Install => describe!(
859859
install::Docs,
860860
install::Std,
861+
// During the Rust compiler (rustc) installation process, we copy the entire sysroot binary
862+
// path (build/host/stage2/bin). Since the building tools also make their copy in the sysroot
863+
// binary path, we must install rustc before the tools. Otherwise, the rust-installer will
864+
// install the same binaries twice for each tool, leaving backup files (*.old) as a result.
865+
install::Rustc,
861866
install::Cargo,
862867
install::RustAnalyzer,
863868
install::Rustfmt,
@@ -866,7 +871,6 @@ impl<'a> Builder<'a> {
866871
install::Miri,
867872
install::LlvmTools,
868873
install::Src,
869-
install::Rustc,
870874
),
871875
Kind::Run => describe!(
872876
run::ExpandYamlAnchors,

0 commit comments

Comments
 (0)