1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 02:21:16 +02:00

* True parallel builds. Nix can now run as many build jobs in

parallel as possible (similar to GNU Make's `-j' switch).  This is
  useful on SMP systems, but it is especially useful for doing builds
  on multiple machines.  The idea is that a large derivation is
  initiated on one master machine, which then distributes
  sub-derivations to any number of slave machines.  This should not
  happen synchronously or in lock-step, so the master must be capable
  of dealing with multiple parallel build jobs.  We now have the
  infrastructure to support this.

  TODO: substitutes are currently broken.
This commit is contained in:
Eelco Dolstra 2004-05-11 18:05:44 +00:00
parent aea436503e
commit c8d3882cdc
12 changed files with 696 additions and 309 deletions

View file

@ -17,10 +17,9 @@ dependencies.sh: dependencies.nix
locking.sh: locking.nix
parallel.sh: parallel.nix
TESTS = init.sh simple.sh dependencies.sh parallel.sh
#locking.sh parallel.sh
TESTS = init.sh simple.sh dependencies.sh locking.sh parallel.sh
XFAIL_TESTS = parallel.sh
XFAIL_TESTS =
include ../substitute.mk

View file

@ -4,7 +4,7 @@ echo "store expr is $storeExpr"
for i in $(seq 1 5); do
echo "WORKER $i"
$TOP/src/nix-store/nix-store -rvvB "$storeExpr" &
$TOP/src/nix-store/nix-store -rvvvvvB "$storeExpr" &
done
sleep 5

View file

@ -11,9 +11,9 @@ let {
a = mkDrv "a" [];
b = mkDrv "b" [a];
c = mkDrv "c" [b];
d = mkDrv "d" [c];
c = mkDrv "c" [a];
d = mkDrv "d" [a];
e = mkDrv "e" [b c d];
body = e;
}
}

View file

@ -2,19 +2,19 @@ storeExpr=$($TOP/src/nix-instantiate/nix-instantiate parallel.nix)
echo "store expr is $storeExpr"
for i in $(seq 1 5); do
echo "WORKER $i"
$TOP/src/nix-store/nix-store -rvvB "$storeExpr" &
done
#for i in $(seq 1 5); do
# echo "WORKER $i"
# $TOP/src/nix-store/nix-store -rvvB "$storeExpr" &
#done
sleep 5
#sleep 5
outPath=$($TOP/src/nix-store/nix-store -qnfvvvvv "$storeExpr")
outPath=$($TOP/src/nix-store/nix-store -qnfvvvvvvK "$storeExpr")
echo "output path is $outPath"
text=$(cat "$outPath")
if test "$text" != "aabcade"; then exit 1; fi
if test "$text" != "abacade"; then exit 1; fi
if test "$(cat $SHARED.cur)" != 0; then exit 1; fi
if test "$(cat $SHARED.max)" != 3; then exit 1; fi