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
This commit is contained in:
bors 2024-02-19 11:28:34 +00:00
commit 43d3470f11
3 changed files with 8 additions and 3 deletions

View File

@ -398,10 +398,11 @@ fn prepare_image(builder: &Builder<'_>, compiler: Compiler, image: &Path) {
let host = compiler.host;
let src = builder.sysroot(compiler);
// Copy rustc/rustdoc binaries
// Copy rustc binary
t!(fs::create_dir_all(image.join("bin")));
builder.cp_r(&src.join("bin"), &image.join("bin"));
// If enabled, copy rustdoc binary
if builder
.config
.tools

View File

@ -95,7 +95,7 @@ fn install_sh(
}
let datadir = prefix.join(default_path(&builder.config.datadir, "share"));
let docdir = prefix.join(default_path(&builder.config.docdir, "share/doc/rust"));
let docdir = prefix.join(default_path(&builder.config.docdir, &format!("share/doc/{package}")));
let mandir = prefix.join(default_path(&builder.config.mandir, "share/man"));
let libdir = prefix.join(default_path(&builder.config.libdir, "lib"));
let bindir = prefix.join(&builder.config.bindir); // Default in config.rs

View File

@ -858,6 +858,11 @@ macro_rules! describe {
Kind::Install => describe!(
install::Docs,
install::Std,
// During the Rust compiler (rustc) installation process, we copy the entire sysroot binary
// path (build/host/stage2/bin). Since the building tools also make their copy in the sysroot
// binary path, we must install rustc before the tools. Otherwise, the rust-installer will
// install the same binaries twice for each tool, leaving backup files (*.old) as a result.
install::Rustc,
install::Cargo,
install::RustAnalyzer,
install::Rustfmt,
@ -866,7 +871,6 @@ macro_rules! describe {
install::Miri,
install::LlvmTools,
install::Src,
install::Rustc,
),
Kind::Run => describe!(
run::ExpandYamlAnchors,