From 820e3163b16cbe04c6c02218f32a5555ff6ef4fe Mon Sep 17 00:00:00 2001 From: Chris Olszewski Date: Mon, 26 Aug 2024 13:16:05 -0400 Subject: [PATCH] fix(cli): avoid use of process exit (#9065) ### 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) --- crates/turborepo-lib/src/cli/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/turborepo-lib/src/cli/mod.rs b/crates/turborepo-lib/src/cli/mod.rs index 07c3f5383cba4..68f62e53100a9 100644 --- a/crates/turborepo-lib/src/cli/mod.rs +++ b/crates/turborepo-lib/src/cli/mod.rs @@ -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() {