about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2009-04-15T06·25+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2009-04-15T06·25+0000
commitdfb863f3339ee7e43c83803ade2d9fdf418399b7 (patch)
tree68655a07255945df4e1a6456f41611a0d5b5ca53
parent435a93b5d845a6fa90675675060ca3cc2d2a650d (diff)
* Don't cache transient build hook problems.
-rw-r--r--src/libstore/build.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 747a7decf2dd..b475341bd446 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1160,12 +1160,15 @@ void DerivationGoal::buildDone()
         printMsg(lvlError, e.msg());
         outputLocks.unlock();
         buildUser.release();
+
+        /* When using a build hook, the hook will return a remote
+           build failure using exit code 100.  Anything else is a hook
+           problem. */
+        bool hookError = usingBuildHook &&
+            (!WIFEXITED(status) || WEXITSTATUS(status) != 100);
         
         if (printBuildTrace) {
-            /* When using a build hook, the hook will return a
-               remote build failure using exit code 100.  Anything
-               else is a hook problem. */
-            if (usingBuildHook && (!WIFEXITED(status) || WEXITSTATUS(status) != 100))
+            if (usingBuildHook && hookError)
                 printMsg(lvlError, format("@ hook-failed %1% %2% %3% %4%")
                     % drvPath % drv.outputs["out"].path % status % e.msg());
             else
@@ -1177,8 +1180,10 @@ void DerivationGoal::buildDone()
            try to build them again (negative caching).  However, don't
            do this for fixed-output derivations, since they're likely
            to fail for transient reasons (e.g., fetchurl not being
-           able to access the network). */
-        if (worker.cacheFailure && !fixedOutput)
+           able to access the network).  Hook errors (like
+           communication problems with the remote machine) shouldn't
+           be cached either. */
+        if (worker.cacheFailure && !hookError && !fixedOutput)
             foreach (DerivationOutputs::iterator, i, drv.outputs)
                 worker.store.registerFailedPath(i->second.path);