rust-lang / jobserver-rs

Apache License 2.0
68 stars 39 forks source link

jobserver updates jobserver-auth from old style R,W to new style fifo:PATH for children though children may not be compatible with fifo:PATH style auth #99

Closed IceTDrinker closed 1 day ago

IceTDrinker commented 2 weeks ago

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 https://github.com/rust-lang/jobserver-rs/blob/c0c2898efbdc616c00f86ecfa68831e74488bba3/src/unix.rs#L168-L181

which breaks compatibility if the new fifo:PATH auth is forwarded to incompatible children processes.

Thanks a lot for the swift support!

Cheers

NobodyXu commented 2 weeks ago

I think we can fix this, by pass the fd + the path for fifo?

the8472 commented 2 weeks ago

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.