Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information