From 81c068a7a6cd6c7efb85e372769ca6deb4a892ea Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Wed, 14 Feb 2024 13:31:50 +0300 Subject: [PATCH 1/2] install tools documentations Previously, we were trying to install all doc files under "share/doc/rust" which caused `rust-installer` tool to create backup files (*.old) due to filename conflicts. With this change, doc files is now installed under "share/doc/{package}", where {package} could be rustc, cargo, clippy, etc. Signed-off-by: onur-ozkan --- src/bootstrap/src/core/build_steps/install.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/src/core/build_steps/install.rs b/src/bootstrap/src/core/build_steps/install.rs index 1c565e7f7cc06..0225f8f24a5ef 100644 --- a/src/bootstrap/src/core/build_steps/install.rs +++ b/src/bootstrap/src/core/build_steps/install.rs @@ -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 From 6ff9c6f96b2ddd9fd83fe32b7089d77d61f40508 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Wed, 14 Feb 2024 13:52:45 +0300 Subject: [PATCH 2/2] don't use entire sysroot binary path for rustc tarballs Previously, we used the entire sysroot binary path to prepare rustc tarballs. Since we also copy tool binaries to the sysroot binary path, installing rustc and tools with `x install` results in attempting to install the same binaries more than once. This causes rust-installer to create backup files (*.old) due to file conflicts. This change fixes that. Signed-off-by: onur-ozkan --- src/bootstrap/src/core/build_steps/dist.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs index f50026368dabd..1339b2a926613 100644 --- a/src/bootstrap/src/core/build_steps/dist.rs +++ b/src/bootstrap/src/core/build_steps/dist.rs @@ -398,10 +398,11 @@ impl Step for Rustc { let host = compiler.host; let src = builder.sysroot(compiler); - // Copy rustc/rustdoc binaries + // Copy rustc binary + builder.install(&src.join("bin").join(exe("rustc", host)), &image.join("bin"), 0o755); 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