From 1e12538c96efe0a48c30e9b849915e904c6c407a Mon Sep 17 00:00:00 2001 From: Daniil Belov <70999565+BelovDV@users.noreply.github.com> Date: Fri, 4 Aug 2023 12:36:48 +0300 Subject: [PATCH] pass jobserver on target info acquiring --- src/cargo/core/compiler/build_context/target_info.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/cargo/core/compiler/build_context/target_info.rs b/src/cargo/core/compiler/build_context/target_info.rs index e6e41c5226f..c0e8f395867 100644 --- a/src/cargo/core/compiler/build_context/target_info.rs +++ b/src/cargo/core/compiler/build_context/target_info.rs @@ -185,6 +185,12 @@ impl TargetInfo { .args(&rustflags) .env_remove("RUSTC_LOG"); + // Removes `FD_CLOEXEC` set by `jobserver::Client` to pass jobserver + // as environment variables specify. + if let Some(client) = config.jobserver_from_env() { + process.inherit_jobserver(client); + } + if let CompileKind::Target(target) = kind { process.arg("--target").arg(target.rustc_target()); }