install rustc before the tools

Signed-off-by: onur-ozkan <work@onurozkan.dev>
This commit is contained in:
onur-ozkan 2024-02-14 13:52:45 +03:00
parent 81c068a7a6
commit 435e1c6dc5
2 changed files with 7 additions and 2 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

@ -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,