[Nix-dev] Re: Parallel building support, 1st attempt

Ludovic Courtès ludo at gnu.org
Tue Jun 22 19:24:43 CEST 2010


Hi,

Peter Simons <simons at cryp.to> 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’.




More information about the nix-dev mailing list