cc-rs: make resource failure when cc parallel is enabled
Since cc >=1.0.80, we set the jobserver inherited to O_NONBLOCK, make probably isn’t designed for this, which is why it failed.
I will open a new ticket in cc and fix it.
_Originally posted by @NobodyXu in https://github.com/rust-lang/cargo/issues/13476#issuecomment-1959123242_
About this issue
- Original URL
- State: closed
- Created 4 months ago
- Comments: 61 (7 by maintainers)
Here is how to override default
makewithgmakeon Github action runner on M1 which fixes build issueI have written a small rust-script, and confirmed that this is a macOS-only problem:
(The code below is a cargo-script, just paste it in a
*.rsfile,chmod +xit and then run it)The output of this program is:
which confirmed that setting blocking from children also affects its parent.
Thanks, confirmed that I can reproduce this on my M2
I’ve opened #985 to fix this, verified locally by building
cargo-nearthat it indeed fixed this issue.Can someone double-check it on their system/CI to see if it fixed the issue please?
BTW, your script has the same output on Linux as the one you pasted.
At that point, why keep the custom jobserver implementation? Wasn’t the main reason to avoid using a thread in the first place? Wouldn’t it make sense to just go back to using the jobserver crate?
Just piling up, this also happened on macOS when we upgraded Firefox to use cc 1.0.88.
I patched my build using the commit from #974 and got the following output which is the same error as before and it doesn’t show the message you asked about:
I’m working on a project I can’t share, but it’s using openssl and zstd. I’ll try to wrap up a minimal reproducible example asap
cc 1.0.87 has released, which shall fix this issue.
Note that since gnu make 4.3 they did switch to nonblocking pipes. Though due to an optimization in the linux kernel blocking pipe reads should actually perform better. jobserver-rs accepts both approaches.
Edit: Pipes, not sockets
At least on Linux you can open /dev/fd/$FD to open a separate FD pointing to the same underlying file.