The primary motivating example is openssl:
Before the change full package build took 1m54s minutes.
After the change full package build takes 59s.
About a 2x speedup.
The difference is visible because openssl builds hundreds of manpages
spawning a perl process per manual in `install` phase. Such a workload
is very easy to parallelize.
Another example would be `autotools`+`libtool` based build system where
install step requires relinking. The more binaries there are to relink
the more gain it will be to do it in parallel.
The change enables parallel installs by default only for buiilds that
already have parallel builds enabled. There is a high chance those build
systems already handle parallelism well but some packages will fail.
Consistently propagated the enableParallelBuilding to:
- cmake (enabled by default, similar to builds)
- ninja (set parallelism explicitly, don't rely on default)
- bmake (enable when requested)
- scons (enable when requested)
- meson (set parallelism explicitly, don't rely on default)
- waf (set parallelism explicitly, don't rely on default)
- qmake-4/5/6 (enable by default, similar to builds)
- xorg (always enable, similar to builds)
Without this change pkgsLLVM fails to build any packages
as compiler-rt fails early in cmake:
CMake Error at ...-cmake-3.24.0/share/cmake-3.24/Modules/Platform/UnixPaths.cmake:53 (file):
file STRINGS file
"...-x86_64-unknown-linux-gnu-clang-wrapper-11.1.0/nix-support/orig-libc-dev"
cannot be read.
It's a regression caused by 871cf9f7b3 "cmake: detect libc location
at runtime #181431" where we started using `orig-libc-dev` as a libc pointer.
During pkgsLLVM pootstrap first compiler has no libc support yet.
The change skips runtime detection if there are no libc signs.
This should simplify using `nix-shell -A` or `nix develop` to develop
CMake based projects. CMake features a mechanism to use a different
RPATH for all executables in the build directory and only rewrite these
RPATHs on installation. This makes it possible to run executables
already from the build directory without having to set LD_LIBRARY_PATH.
This should simplify the checkPhase for cmake based projects and
hopefully not break anything.
Fixes: #22060
This is a reversed patch of https://gitlab.kitware.com/cmake/cmake/-/merge_requests/6426.
_CURRENT_OSX_VERSION isn't set properly, which causes this condition to fail,
which means we don't get CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG which means
we can't compile libcxx. Ugh.
Adds the SystemConfiguration framework to buildInputs unless we're
bootstrapping.
For the bootstrap version, we revert
31f631a142
instead so CMake builds without SystemConfiguration.