]> git.lizzy.rs Git - rust.git/commitdiff
rustbuild: Print out failing commands
authorAlex Crichton <alex@alexcrichton.com>
Thu, 8 Dec 2016 01:26:48 +0000 (17:26 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Thu, 8 Dec 2016 01:27:58 +0000 (17:27 -0800)
Just ensure that we always print out the command line which should aid in
debugging.

Closes #38228

src/bootstrap/check.rs
src/build_helper/lib.rs

index c5675fd46cbe07f4cedfeb0bed4047ab439eb424..72e12c55bfce2a3972eac2d7868c9f66e771f6ad 100644 (file)
@@ -464,8 +464,7 @@ fn krate_emscripten(build: &Build,
          println!("running {}", test_file_name);
          let nodejs = build.config.nodejs.as_ref().expect("nodejs not configured");
          let mut cmd = Command::new(nodejs);
-         cmd.arg(&test_file_name)
-            .stderr(::std::process::Stdio::inherit());
+         cmd.arg(&test_file_name);
          if build.config.quiet_tests {
              cmd.arg("--quiet");
          }
index 38844fb6c9ef0748c100a1756e72191b6c42d1e2..07f9c91d3c787b17f17c23be5225d1016d7142b3 100644 (file)
@@ -21,7 +21,8 @@ pub fn run(cmd: &mut Command) {
 pub fn run_silent(cmd: &mut Command) {
     let status = match cmd.status() {
         Ok(status) => status,
-        Err(e) => fail(&format!("failed to execute command: {}", e)),
+        Err(e) => fail(&format!("failed to execute command: {:?}\nerror: {}",
+                                cmd, e)),
     };
     if !status.success() {
         fail(&format!("command did not execute successfully: {:?}\n\
@@ -63,7 +64,8 @@ pub fn cc2ar(cc: &Path, target: &str) -> Option<PathBuf> {
 pub fn output(cmd: &mut Command) -> String {
     let output = match cmd.stderr(Stdio::inherit()).output() {
         Ok(status) => status,
-        Err(e) => fail(&format!("failed to execute command: {}", e)),
+        Err(e) => fail(&format!("failed to execute command: {:?}\nerror: {}",
+                                cmd, e)),
     };
     if !output.status.success() {
         panic!("command did not execute successfully: {:?}\n\