Skip to content

Commit

Permalink
fix(cli): avoid use of process exit (#9065)
Browse files Browse the repository at this point in the history
### Description

We've seen segfaults from running `turbo run` on [CI]()

We believe this is due to `process::exit` being called before some
`Drop` implementations have been run. We make sure `Drop`s are run by
returning the exit code instead of exiting.

### Testing Instructions

Run in CI multiple times:
- [Run
1](https://github.com/vercel/turborepo/actions/runs/10562720469/job/29261407172?pr=9065)
- [Run
2](https://github.com/vercel/turborepo/actions/runs/10562720469/job/29262901217?pr=9065)
  • Loading branch information
chris-olszewski authored Aug 26, 2024
1 parent 563449b commit 820e316
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/turborepo-lib/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,7 @@ pub async fn run(

if execution_args.tasks.is_empty() {
print_potential_tasks(base, event).await?;
process::exit(1);
return Ok(1);
}

if let Some((file_path, include_args)) = run_args.profile_file_and_include_args() {
Expand Down

0 comments on commit 820e316

Please sign in to comment.