about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-11-24T15·44+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-11-24T15·50+0100
commit9e3389c3378df026dcbf66adef8e52002c7b9d2a (patch)
tree2301311a29def24cc8c3ce16bc6d66695d708156 /src
parent215745415e7c1e31cdb9747a02d217a884484c51 (diff)
Don't create unnecessary substitution goals for derivations
Diffstat (limited to 'src')
-rw-r--r--src/libstore/build.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 24576f67093e..72694cfbbe78 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -924,6 +924,11 @@ void DerivationGoal::init()
     /* The first thing to do is to make sure that the derivation
        exists.  If it doesn't, it may be created through a
        substitute. */
+    if (buildMode == bmNormal && worker.store.isValidPath(drvPath)) {
+        haveDerivation();
+        return;
+    }
+
     addWaitee(worker.makeSubstitutionGoal(drvPath));
 
     state = &DerivationGoal::haveDerivation;