aboutsummaryrefslogtreecommitdiff
path: root/tests/build-hook.hook.sh
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2004-05-13 19:14:49 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2004-05-13 19:14:49 +0000
commita8306cb98ff920b38db5e5bbfcbe71bb36859b3f (patch)
tree9e4d1c694140b49582dee517206005644e2557d8 /tests/build-hook.hook.sh
parent5087c8f645cf971ee6dfd11c5c56c6b2b752d7ad (diff)
* The build hooks used to implement distributed builds can now be run
in parallel. Hooks are more efficient: locks on output paths are only acquired when the hook says that it is willing to accept a build job. Hooks now work in two phases. First, they should first tell Nix whether they are willing to accept a job. Nix guarantuees that no two hooks will ever be in the first phase at the same time (this simplifies the implementation of hooks, since they don't have to perform locking (?)). Second, if they accept a job, they are then responsible for building it (on the remote system), and copying the result back. These can be run in parallel with other hooks and locally executed jobs. The implementation is a bit messy right now, though. * The directory `distributed' shows a (hacky) example of a hook that distributes build jobs over a set of machines listed in a configuration file.
Diffstat (limited to 'tests/build-hook.hook.sh')
-rw-r--r--tests/build-hook.hook.sh16
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/build-hook.hook.sh b/tests/build-hook.hook.sh
index 7176315d9..bbf423017 100644
--- a/tests/build-hook.hook.sh
+++ b/tests/build-hook.hook.sh
@@ -1,17 +1,21 @@
+#! /bin/sh
+
set -x
-drv=$1
+drv=$4
-echo "HOOK for $drv"
+echo "HOOK for $drv" >&2
outPath=$(sed 's/Derive(\[\"\([^\"]*\)\".*/\1/' $drv)
-echo "output path is $outPath"
+echo "output path is $outPath" >&2
if $(echo $outPath | grep -q input-1); then
+ echo "accept" >&3
+ read x <&4
+ echo "got $x"
mkdir $outPath
echo "BAR" > $outPath/foo
- exit 100
+else
+ echo "decline" >&3
fi
-
-exit 101 \ No newline at end of file