Skip to content

Commit 448c437

Browse files
committed
fix: cargo fix: always inherit the jobserver
1 parent 2ed2dbd commit 448c437

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/cargo/ops/fix.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,11 @@ pub fn fix_exec_rustc(config: &Config, lock_addr: &str) -> CargoResult<()> {
379379
rustc.retry_with_argfile(true);
380380
rustc.env_remove(FIX_ENV_INTERNAL);
381381
args.apply(&mut rustc);
382+
// Removes `FD_CLOEXEC` set by `jobserver::Client` to ensure that the
383+
// compiler can access the jobserver.
384+
if let Some(client) = config.jobserver_from_env() {
385+
rustc.inherit_jobserver(client);
386+
}
382387

383388
trace!("start rustfixing {:?}", args.file);
384389
let json_error_rustc = {
@@ -451,11 +456,6 @@ pub fn fix_exec_rustc(config: &Config, lock_addr: &str) -> CargoResult<()> {
451456
// things like colored output to work correctly.
452457
rustc.arg(arg);
453458
}
454-
// Removes `FD_CLOEXEC` set by `jobserver::Client` to pass jobserver
455-
// as environment variables specify.
456-
if let Some(client) = config.jobserver_from_env() {
457-
rustc.inherit_jobserver(client);
458-
}
459459
debug!("calling rustc to display remaining diagnostics: {rustc}");
460460
exit_with(rustc.status()?);
461461
}

0 commit comments

Comments
 (0)