[Nix-dev] make -jx within builds?
Marc Weber
marco-oweber at gmx.de
Fri May 28 15:04:07 CEST 2010
> buildInParallel = makeSetupHook ...
> ''
> nrCores=$(cat /proc/cpuinfo | grep 'processor.*:' | wc -l)
> makeFlags="$makeFlags -j -l $nrCores"
-j -l ? Agreed. This is superior.
However I don't know whether we want to depend on Makefile. I can't
think about other systems which do concurrent builds in nixpkgs right
now though.
We still have to find a way to mark makefiles as concurrency unsafe so
that -j1 is used on them.
Probably -j -l does not work nicely with
buildImportant -j4 &
nice -n10 buildLessImportant -j4 &
nice -n20 buildLeastImportart -j4 &
wait
because less and least important would run one thread causing
buildImportant to spawn less threads.
So maybe we want to use $( .. |wc -l) * 0.9 for less important jobs
such as stdenv-updates so that it spawns less processes :)
Marc Weber
More information about the nix-dev
mailing list