Hi,
Peter Simons <[email protected]> writes:
> 1) Nix-env provides the environment variable $NIX_BUILD_CORES. The default
> value is 1, which is equivalent to building with parallelism disabled.
It should be a ‘nix-store’ option IMO, so that it’s available to all the
commands that builds on it (‘nix-build’, ‘nix-env’, etc.).
Also, it should be able to guess a good default value when asking for
parallel builds, using sysconf(3) or some such (see Gnulib’s ‘nproc’
module.)
> 2) The generic builder checks whether $enableParallelBuilding is set. If it
> is, "-j{NIX_BUILD_CORES} -l{NIX_BUILD_CORES}" is added to $makeFlags.
FWIW I prefer Lluís’ suggestion of using substituters for this since
it’s completely orthogonal and makes it clear that the user asserts that
the build output isn’t dependent the number of parallel build processes.
Thanks,
Ludo’.
_______________________________________________
nix-dev mailing list
[email protected]
https://mail.cs.uu.nl/mailman/listinfo/nix-dev