Author: MarcWeber Date: 2010-06-15 19:00:54 +0000 (Tue, 15 Jun 2010) New Revision: 22284
You can view the changes in this commit at: https://svn.nixos.org/viewvc/nix?rev=22284&view=rev Added: nixpkgs/branches/stdenv-updates/pkgs/tools/package-management/nix/num-cores.patch Modified: nixpkgs/branches/stdenv-updates/pkgs/tools/package-management/nix/unstable.nix Log: nix num-cores.patch pass MAX_PARALLELIZATION and TARGET_LOAD to the builder. See comments Changes: Added: nixpkgs/branches/stdenv-updates/pkgs/tools/package-management/nix/num-cores.patch =================================================================== --- nixpkgs/branches/stdenv-updates/pkgs/tools/package-management/nix/num-cores.patch (rev 0) +++ nixpkgs/branches/stdenv-updates/pkgs/tools/package-management/nix/num-cores.patch 2010-06-15 19:00:54 UTC (rev 22284) @@ -0,0 +1,31 @@ +commit b77e3721f19b4e5084125eb8dc7186117004dd4b +Author: Marc Weber <[email protected]> +Date: Sun Jun 13 23:53:46 2010 +0200 + + generic/setup.sh: add -j (+1) -l (*2) options to make depending on $NUM_CORES + +diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh +index a9f4d4d..685c0ec 100644 +--- a/pkgs/stdenv/generic/setup.sh ++++ b/pkgs/stdenv/generic/setup.sh +@@ -79,9 +79,19 @@ cmd(){ + } + + runMake(){ +- cmd make ${makefile:+-f $makefile} "$@" ++ local optout=NO_PARALLEL_BUILD_${curPhase} ++ [ -n "${!optout}" ] || \ ++ local j="$makeFlagsParallelBuild" ++ cmd make ${makefile:+-f $makefile} "$@" $j + } + ++###################################################################### ++# parallel builds: opt-out ++# - in a phase: set NO_PARALLEL_BUILD_${PHASE_NAME} ++# - for this build: pass NUM_CORES=1 to the builder ++if [ "$NUM_CORES" -gt 1 ]; then ++ makeFlagsParallelBuild="-j $(( $NUM_CORES + 1 )) -l $(( 2 * $NUM_CORES ))" ++fi + + ###################################################################### + # Initialisation. Modified: nixpkgs/branches/stdenv-updates/pkgs/tools/package-management/nix/unstable.nix =================================================================== --- nixpkgs/branches/stdenv-updates/pkgs/tools/package-management/nix/unstable.nix 2010-06-15 19:00:51 UTC (rev 22283) +++ nixpkgs/branches/stdenv-updates/pkgs/tools/package-management/nix/unstable.nix 2010-06-15 19:00:54 UTC (rev 22284) @@ -40,4 +40,6 @@ homepage = http://nixos.org/; license = "LGPLv2+"; }; + + patches = [ ./num-cores.patch ]; } _______________________________________________ nix-commits mailing list [email protected] http://mail.cs.uu.nl/mailman/listinfo/nix-commits
