You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you have a build script that uses both cc-rs and cmake-rs (as is the case when writing bindings with https://github.com/dtolnay/cxx), the jobserver isn't shared between the two correctly.
The TL;DR is that after the cc-rs build finishes, the cmake-rs build can't use the jobserver:
$ export MAKEFLAGS=-j16
$ cargo build -vv
...
[cmake-jobserver-bug 0.1.0] -- Build files have been written to: /home/nots/workspace/cmake-jobserver-bug/target/debug/build/cmake-jobserver-bug-b047a90afcff9857/out/build
[cmake-jobserver-bug 0.1.0] running: "cmake""--build"".""--target""install""--config""Debug"
[cmake-jobserver-bug 0.1.0] gmake: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
...
Using binary search, I was able to tell that the issue was introduced in the 1.0.42 release, which was the one that first introduced jobserver support: 4fda8db
A workaround is to pin cmake-rs to 0.1.48, which doesn't use the jobserver, and instead just invokes cmake with --parallel 16
The text was updated successfully, but these errors were encountered:
When you have a build script that uses both
cc-rs
andcmake-rs
(as is the case when writing bindings with https://github.com/dtolnay/cxx), the jobserver isn't shared between the two correctly.I filed rust-lang/cmake-rs#172 but am not sure where the bug actually is.
See https://github.com/Notgnoshi/cmake-jobserver-bug for a small example project that reproduces this behavior. The linked issue also has lots more details.
The TL;DR is that after the
cc-rs
build finishes, thecmake-rs
build can't use the jobserver:Using binary search, I was able to tell that the issue was introduced in the 1.0.42 release, which was the one that first introduced jobserver support: 4fda8db
A workaround is to pin
cmake-rs
to 0.1.48, which doesn't use the jobserver, and instead just invokescmake
with--parallel 16
The text was updated successfully, but these errors were encountered: