Skip to content

Commit 43d3470

Browse files
committed
Auto merge of #121079 - onur-ozkan:install-conflicts, r=albertlarsan68
distribute tool documentations and avoid file conflicts on `x install` I suggest reading commits one-by-one with the descriptions for more context about the changes. Fixes #115213
2 parents eb1f279 + 435e1c6 commit 43d3470

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

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

src/bootstrap/src/core/build_steps/install.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ fn install_sh(
9595
}
9696

9797
let datadir = prefix.join(default_path(&builder.config.datadir, "share"));
98-
let docdir = prefix.join(default_path(&builder.config.docdir, "share/doc/rust"));
98+
let docdir = prefix.join(default_path(&builder.config.docdir, &format!("share/doc/{package}")));
9999
let mandir = prefix.join(default_path(&builder.config.mandir, "share/man"));
100100
let libdir = prefix.join(default_path(&builder.config.libdir, "lib"));
101101
let bindir = prefix.join(&builder.config.bindir); // Default in config.rs

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)