about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2009-03-28T16·12+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2009-03-28T16·12+0000
commitf54e800366b3c8540c60f0a35c407ad701e2f622 (patch)
tree7b3d0d7f29676f179b7c70d15ecce4e9b8dca902 /src/libstore
parent38f98b32822efa35a050b26d7ab5bbd561c9e529 (diff)
* The `fixedOutput' variable didn't get initialised when using a build
  hook, causing negative caching to fail randomly.

Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/build.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 8c5c6cc360..92bf1cab0b 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -942,6 +942,11 @@ void DerivationGoal::inputsRealised()
 
     allPaths.insert(inputPaths.begin(), inputPaths.end());
 
+    /* Is this a fixed-output derivation? */
+    fixedOutput = true;
+    foreach (DerivationOutputs::iterator, i, drv.outputs)
+        if (i->second.hash == "") fixedOutput = false;
+    
     /* Okay, try to build.  Note that here we don't wait for a build
        slot to become available, since we don't need one if there is a
        build hook. */
@@ -1479,11 +1484,7 @@ void DerivationGoal::startBuilder()
        derivation, tell the builder, so that for instance `fetchurl'
        can skip checking the output.  On older Nixes, this environment
        variable won't be set, so `fetchurl' will do the check. */
-    fixedOutput = true;
-    foreach (DerivationOutputs::iterator, i, drv.outputs)
-        if (i->second.hash == "") fixedOutput = false;
-    if (fixedOutput) 
-        env["NIX_OUTPUT_CHECKED"] = "1";
+    if (fixedOutput) env["NIX_OUTPUT_CHECKED"] = "1";
 
     /* *Only* if this is a fixed-output derivation, propagate the
        values of the environment variables specified in the