-
Notifications
You must be signed in to change notification settings - Fork 43
Description
Hello,
As discussed in this zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/does.20Cargo.20inject.20fifo.3APATH.20style.20jobserver-auth.20in.20MAKEFLAG/near/447522824
We have a build case with rust that started failing on newer nightly toolchains, the crash stemmed from a fifo:PATH style jobserver-auth being forwarded in a build.rs to a make command (with version < 4.4) that is not compatible with the fifo:PATH style auth, when the make command tried to run it crashed indicating it did not support the fifo:PATH auth.
@the8472 pointed out this piece of code
Lines 168 to 181 in c0c2898
// Optimization: Try converting it to a fifo by using /dev/fd | |
// | |
// On linux, opening `/dev/fd/$fd` returns a fd with a new file description, | |
// so we can set `O_NONBLOCK` on it without affecting other processes. | |
// | |
// On macOS, opening `/dev/fd/$fd` seems to be the same as `File::try_clone`. | |
// | |
// I tested this on macOS 14 and Linux 6.5.13 | |
#[cfg(target_os = "linux")] | |
if let Ok(Some(jobserver)) = | |
Self::from_fifo(&format!("fifo:/dev/fd/{}", read.as_raw_fd())) | |
{ | |
return Ok(Some(jobserver)); | |
} |
which breaks compatibility if the new fifo:PATH auth is forwarded to incompatible children processes.
Thanks a lot for the swift support!
Cheers
Activity
NobodyXu commentedon Jun 28, 2024
I think we can fix this, by pass the fd + the path for fifo?
the8472 commentedon Jun 28, 2024
We should pass-through whatever the parent gave us and as an optimization open a separate set of FDs for internal use on linux and not pass.
Fix `Client::configure*` on unix
Client::configure*
on unix #100chore: downgrade to jobserver@0.1.28
Auto merge of #14254 - weihanglo:jobserver, r=epage
chore: downgrade to jobserver@0.1.28
Fix `Client::configure*` on unix
cargo test --doc
frommake -j
always triggers "failed to connect to jobserver from environment" rust-lang/cargo#14407