[Nix-dev] Parallel building support, 1st attempt
Jeff Johnson
n3npq at mac.com
Tue Jun 22 17:26:31 CEST 2010
On Jun 22, 2010, at 11:10 AM, Peter Simons wrote:
> Hi guys,
>
> the following patch is a first implementation for you to review and comment on.
> It's been tested successfully on Linux/x86, Linux/x86_64, and Darwin/x86. The
> following changes were made:
>
> 1) Nix-env provides the environment variable $NIX_BUILD_CORES. The default
> value is 1, which is equivalent to building with parallelism disabled.
>
Specify the means to set the envvar please, like what the inputs to the heuristic
are. There are most definitely "portability" issues associated with
discovering #CORES and the details should be spelled out.
(aside)
In fact (since you want not only -jN but also -lN options), you likely should avoid the misleading fiction
of "...BUILD_CORES" in the envvar name. In fact, you are supplying arbitrary (the proposed mechanisms
are merely heuristics, you'll never find one heuristic that adapts to all cases imho),
and you likely should choose some name for the envvar that doesn't pretent to "CORES".
All I'm saying is lose the "cores" connotative baggage. Everything else as before.
> 2) The generic builder checks whether $enableParallelBuilding is set. If it
> is, "-j{NIX_BUILD_CORES} -l{NIX_BUILD_CORES}" is added to $makeFlags.
>
Ditto.
> 3) The packages gcc, glibc, gmp, mpfr, coreutils, perl, git, and qt4 now
> define $enableParallelBuilding.
>
You are likely to make better forward progress with "opt-in" rather than "opt-out" logic.
> Let me know what you think, please.
>
73 de Jeff
More information about the nix-dev
mailing list