Skip to content

Commit

Permalink
feat(turborepo): Report more details when go-turbo exits (#5287)
Browse files Browse the repository at this point in the history
### Description

- adds a little extra reporting on unix systems when `go-turbo` does not
return an exit code

### Testing Instructions

Co-authored-by: Greg Soltis <Greg Soltis>
  • Loading branch information
Greg Soltis authored Jun 14, 2023
1 parent c75f3a1 commit d461eca
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion crates/turborepo-lib/src/shim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,21 @@ impl RepoState {

let child = spawn_child(command)?;

let exit_code = child.wait()?.code().unwrap_or(2);
let exit_status = child.wait()?;
let exit_code = exit_status.code().unwrap_or_else(|| {
debug!("go-turbo failed to report exit code");
#[cfg(unix)]
{
use std::os::unix::process::ExitStatusExt;
let signal = exit_status.signal();
let core_dumped = exit_status.core_dumped();
debug!(
"go-turbo caught signal {:?}. Core dumped? {}",
signal, core_dumped
);
}
2
});

Ok(exit_code)
}
Expand Down

0 comments on commit d461eca

Please sign in to comment.