From 6ff9c6f96b2ddd9fd83fe32b7089d77d61f40508 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Wed, 14 Feb 2024 13:52:45 +0300 Subject: [PATCH] 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