Просмотр исходного кода

Check command statuses in build.rs (#1778)

This PR fixes #1684 by checking the statuses of two commands in the
build.rs file.

Signed-off-by: Samuel Moelius <sam@moeli.us>
Samuel Moelius 6 месяцев назад
Родитель
Сommit
8eac360fa7
1 измененных файлов с 5 добавлено и 3 удалено
  1. 5 3
      build.rs

+ 5 - 3
build.rs

@@ -5,16 +5,18 @@ use std::process::Command;
 fn main() {
     #[cfg(feature = "llvm")]
     {
-        Command::new("make")
+        let status = Command::new("make")
             .args(["-C", "stdlib"])
-            .output()
-            .expect("Could not build stdlib");
+            .status()
+            .expect("could not execute make");
+        assert!(status.success(), "building stdlib failed");
 
         // compile our linker
         let cxxflags = Command::new("llvm-config")
             .args(["--cxxflags"])
             .output()
             .expect("could not execute llvm-config");
+        assert!(cxxflags.status.success(), "llvm-config failed");
 
         let cxxflags = String::from_utf8(cxxflags.stdout).unwrap();