mirror of
https://github.com/NixOS/nix
synced 2025-07-07 14:21:48 +02:00
* Made the build hook mechanism more efficient. Rather than starting
the hook every time we want to ask whether we can run a remote build (which can be very often), we now reuse a hook process for answering those queries until it accepts a build. So if there are N derivations to be built, at most N hooks will be started.
This commit is contained in:
parent
1a396f3789
commit
e437b08250
3 changed files with 332 additions and 346 deletions
|
@ -2,20 +2,22 @@
|
|||
|
||||
#set -x
|
||||
|
||||
drv=$4
|
||||
while read x y drv rest; do
|
||||
|
||||
echo "HOOK for $drv" >&2
|
||||
echo "HOOK for $drv" >&2
|
||||
|
||||
outPath=`sed 's/Derive(\[("out",\"\([^\"]*\)\".*/\1/' $drv`
|
||||
outPath=`sed 's/Derive(\[("out",\"\([^\"]*\)\".*/\1/' $drv`
|
||||
|
||||
echo "output path is $outPath" >&2
|
||||
echo "output path is $outPath" >&2
|
||||
|
||||
if `echo $outPath | grep -q input-1`; then
|
||||
echo "# accept" >&2
|
||||
read x
|
||||
echo "got $x"
|
||||
mkdir $outPath
|
||||
echo "BAR" > $outPath/foo
|
||||
else
|
||||
echo "# decline" >&2
|
||||
fi
|
||||
if `echo $outPath | grep -q input-1`; then
|
||||
echo "# accept" >&2
|
||||
read inputs
|
||||
read outputs
|
||||
mkdir $outPath
|
||||
echo "BAR" > $outPath/foo
|
||||
else
|
||||
echo "# decline" >&2
|
||||
fi
|
||||
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue