about summary refs log tree commit diff
path: root/src/libstore/misc.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-06-20T17·26+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-06-20T17·26+0200
commit5558652709f27e8a887580b77b93c705659d7a4b (patch)
tree3579a66827b1a41af77c8b38aaa591295824da9b /src/libstore/misc.cc
parent1906cce6fcea88d07b55c0b9734da39675e17a4d (diff)
Don't substitute derivations that have preferLocalBuild set
In particular this means that "trivial" derivations such as writeText
are not substituted, reducing the number of GET requests to the binary
cache by about 200 on a typical NixOS configuration.
Diffstat (limited to 'src/libstore/misc.cc')
-rw-r--r--src/libstore/misc.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libstore/misc.cc b/src/libstore/misc.cc
index 74ff26b9cc5c..1bf3f9378245 100644
--- a/src/libstore/misc.cc
+++ b/src/libstore/misc.cc
@@ -120,7 +120,8 @@ void queryMissing(StoreAPI & store, const PathSet & targets,
                 if (invalid.empty()) continue;
 
                 todoDrv.insert(*i);
-                if (settings.useSubstitutes) query.insert(invalid.begin(), invalid.end());
+                if (settings.useSubstitutes && !willBuildLocally(drv))
+                    query.insert(invalid.begin(), invalid.end());
             }
 
             else {
@@ -143,7 +144,7 @@ void queryMissing(StoreAPI & store, const PathSet & targets,
 
             PathSet outputs;
             bool mustBuild = false;
-            if (settings.useSubstitutes) {
+            if (settings.useSubstitutes && !willBuildLocally(drv)) {
                 foreach (DerivationOutputs::iterator, j, drv.outputs) {
                     if (!wantOutput(j->first, i2.second)) continue;
                     if (!store.isValidPath(j->second.path)) {