From faf407d5dccacdcaa0ee40bfee18847226c570f7 Mon Sep 17 00:00:00 2001 From: Aaron Hill Date: Thu, 9 Dec 2021 12:21:00 -0600 Subject: [PATCH] Don't copy llvm tools to sysroot when using download-ci-llvm Fixes #91710 --- src/bootstrap/compile.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index 186b5e92d33..6a734ab5177 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -1173,7 +1173,12 @@ fn run(self, builder: &Builder<'_>) -> Compiler { // (e.g. the `bootimage` crate). for tool in LLVM_TOOLS { let tool_exe = exe(tool, target_compiler.host); - builder.copy(&llvm_bin_dir.join(&tool_exe), &libdir_bin.join(&tool_exe)); + let src_path = llvm_bin_dir.join(&tool_exe); + // When using `donwload-ci-llvm`, some of the tools + // may not exist, so skip trying to copy them. + if src_path.exists() { + builder.copy(&src_path, &libdir_bin.join(&tool_exe)); + } } } }