about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-02-17T21·58+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-02-17T21·58+0100
commit71adb090f05532b2116e952b617048abd0a6081d (patch)
treeceeb12b532a5fea6827e4963a12a4f135b15f1ab
parent69fe6c58faa91c3b8f844e1aafca26354ea14425 (diff)
When using a build hook, only copy missing paths
-rw-r--r--src/libstore/build.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index f37f3ddf2933..e1f585f64706 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();