Skip to content

Commit

Permalink
rustbuild: Print out failing commands
Browse files Browse the repository at this point in the history
Just ensure that we always print out the command line which should aid in
debugging.

Closes #38228
  • Loading branch information
alexcrichton committed Dec 8, 2016
1 parent 535b6d3 commit 03fb5ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/bootstrap/check.rs
Expand Up @@ -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");
}
Expand Down
6 changes: 4 additions & 2 deletions src/build_helper/lib.rs
Expand Up @@ -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\
Expand Down Expand Up @@ -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\
Expand Down

0 comments on commit 03fb5ad

Please sign in to comment.