summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-11-24 16:44:35 +0100
committerLudovic Courtès <ludo@gnu.org>2015-05-11 17:42:43 +0200
commit9f355738e106f4ca49bba7276e8d520a2fc2955d (patch)
tree56cb474312150096e25aed001c7760a00740c6a4
parent554eaf5e8c82ddd6a42e4301f6d3dd5419c04060 (diff)
downloadguix-9f355738e106f4ca49bba7276e8d520a2fc2955d.tar.gz
Don't create unnecessary substitution goals for derivations
-rw-r--r--nix/libstore/build.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc
index 17085ad3f7..952dbd2325 100644
--- a/nix/libstore/build.cc
+++ b/nix/libstore/build.cc
@@ -936,6 +936,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;