From 71adb090f05532b2116e952b617048abd0a6081d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 17 Feb 2014 22:58:21 +0100 Subject: [PATCH] When using a build hook, only copy missing paths --- src/libstore/build.cc | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/libstore/build.cc b/src/libstore/build.cc index f37f3ddf29..e1f585f647 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -1240,8 +1240,7 @@ void DerivationGoal::tryToBuild() build this derivation, so no further checks are necessary. */ validPaths = checkPathValidity(true, repair); if (validPaths.size() == drv.outputs.size()) { - debug(format("skipping build of derivation `%1%', someone beat us to it") - % drvPath); + debug(format("skipping build of derivation `%1%', someone beat us to it") % drvPath); outputLocks.setDeletion(true); amDone(ecSuccess); return; @@ -1525,8 +1524,7 @@ HookReply DerivationGoal::tryBuildHook() else if (reply != "accept") throw Error(format("bad hook reply `%1%'") % reply); - printMsg(lvlTalkative, format("using hook to build path(s) %1%") - % showPaths(outputPaths(drv.outputs))); + printMsg(lvlTalkative, format("using hook to build path(s) %1%") % showPaths(missingPaths)); hook = worker.hook; worker.hook.reset(); @@ -1541,14 +1539,13 @@ HookReply DerivationGoal::tryBuildHook() computeFSClosure(worker.store, drvPath, allInputs); string s; - foreach (PathSet::iterator, i, allInputs) s += *i + " "; + foreach (PathSet::iterator, i, allInputs) { s += *i; s += ' '; } writeLine(hook->toHook.writeSide, s); - /* Tell the hooks the outputs that have to be copied back from the - remote system. */ + /* Tell the hooks the missing outputs that have to be copied back + from the remote system. */ s = ""; - foreach (DerivationOutputs::iterator, i, drv.outputs) - s += i->second.path + " "; + foreach (PathSet::iterator, i, missingPaths) { s += *i; s += ' '; } writeLine(hook->toHook.writeSide, s); hook->toHook.writeSide.close();