about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2023-12-20 21:44:12 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2023-12-20 21:44:12 +0100
commit6631dd9dd27b63bf89d3ace5dbce02ea240c5a44 (patch)
tree6470f2c799e1238af7a9f4745026afc9c6c9d2e9
parent87a704a2278882d4d8717e83c62879dc540ad87d (diff)
downloadrust-6631dd9dd27b63bf89d3ace5dbce02ea240c5a44.tar.gz
rust-6631dd9dd27b63bf89d3ace5dbce02ea240c5a44.zip
Don't stop test if llvm FileCheck cannot be found
-rw-r--r--build_system/src/test.rs28
1 files changed, 15 insertions, 13 deletions
diff --git a/build_system/src/test.rs b/build_system/src/test.rs
index c98be8dcacc..1a9bb4ea94e 100644
--- a/build_system/src/test.rs
+++ b/build_system/src/test.rs
@@ -524,23 +524,25 @@ fn setup_rustc(env: &mut Env, args: &TestArg) -> Result<(), String> {
             Ok(cargo)
         }
     })?;
-    let llvm_filecheck = String::from_utf8(
-        run_command_with_env(
-            &[
-                &"bash",
-                &"-c",
-                &"which FileCheck-10 || \
+    let llvm_filecheck = match run_command_with_env(
+        &[
+            &"bash",
+            &"-c",
+            &"which FileCheck-10 || \
           which FileCheck-11 || \
           which FileCheck-12 || \
           which FileCheck-13 || \
           which FileCheck-14",
-            ],
-            rust_dir,
-            Some(env),
-        )?
-        .stdout,
-    )
-    .map_err(|error| format!("Failed to retrieve LLVM FileCheck: {:?}", error))?;
+        ],
+        rust_dir,
+        Some(env),
+    ) {
+        Ok(cmd) => String::from_utf8_lossy(&cmd.stdout).to_string(),
+        Err(_) => {
+            eprintln!("Failed to retrieve LLVM FileCheck, ignoring...");
+            String::new()
+        }
+    };
     std::fs::write(
         "rust/config.toml",
         &format!(