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
Disable broken Make jobserver support on OSX to fix parallel builds (#229)
Disable legacy Make jobserver support on OSX
On OSX, CMake (via libuv) spawns child processes, including make, via
the Apple-specific `posix_spawn` attribute
`POSIX_SPAWN_CLOEXEC_DEFAULT`. This blocks make from accessing all
non-stdio file descriptors from the parent process, including those of
the jobserver.
Because make was getting passed jobserver information via MAKEFLAGS but
was unable to access the jobserver, it prints an error like the
following and proceeds to run a single-threaded build:
```
make: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
```
As a workaround, disable jobserver support on OSX so that cmake-rs
instead passes `--parallel $NUM_JOBS` to CMake, allowing for a faster
multi-threaded build. However, there is an exception made if the
available jobserver is based on a named pipe. Since access to this pipe
does not rely on the inheritance of file descriptors, the underlying
build will be able to access the jobserver in this case.
0 commit comments