From f55c87966923fb8d3ba86da875225aaf687a187a Mon Sep 17 00:00:00 2001 From: Joseph Ryan Date: Mon, 2 Oct 2023 16:50:23 -0700 Subject: [PATCH] bootstrap: make copying linker binaries conditional --- src/bootstrap/compile.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index daf0798357b..cf1f97c5b41 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -167,12 +167,14 @@ impl Step for Std { .rustc_snapshot_sysroot() .join("lib") .join("rustlib") - .join(&compiler.host.triple) + .join(compiler.host.triple) .join("bin"); - let target_sysroot_bin = - builder.sysroot_libdir(compiler, target).parent().unwrap().join("bin"); - t!(fs::create_dir_all(&target_sysroot_bin)); - builder.cp_r(&src_sysroot_bin, &target_sysroot_bin); + if src_sysroot_bin.exists() { + let target_sysroot_bin = + builder.sysroot_libdir(compiler, target).parent().unwrap().join("bin"); + t!(fs::create_dir_all(&target_sysroot_bin)); + builder.cp_r(&src_sysroot_bin, &target_sysroot_bin); + } } let mut cargo = builder.cargo(compiler, Mode::Std, SourceType::InTree, target, "build");