diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2015-06-04 16:04:41 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2015-06-04 16:30:22 +0200 |
commit | b64988bb3585478676585a0f0aecbcf4e11d4432 (patch) | |
tree | b8c34a16fc76a42f4e9f8ea9beecd453bea05712 /src/libstore/misc.cc | |
parent | b190f771e7e23db363f7cb40db0e538557bbea30 (diff) |
Allow substitutes for builds that have preferLocalBuild set
Not substituting builds with "preferLocalBuild = true" was a bad idea,
because it didn't take the cost of dependencies into account. For
instance, if we can't substitute a fetchgit call, then we have to
download/build git and all its dependencies.
Partially reverts 5558652709f27e8a887580b77b93c705659d7a4b and adds a
new derivation attribute "allowSubstitutes" to specify whether a
derivation may be substituted.
Diffstat (limited to 'src/libstore/misc.cc')
-rw-r--r-- | src/libstore/misc.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstore/misc.cc b/src/libstore/misc.cc index 2facda815..736434ca4 100644 --- a/src/libstore/misc.cc +++ b/src/libstore/misc.cc @@ -120,7 +120,7 @@ void queryMissing(StoreAPI & store, const PathSet & targets, if (invalid.empty()) continue; todoDrv.insert(*i); - if (settings.useSubstitutes && !willBuildLocally(drv)) + if (settings.useSubstitutes && substitutesAllowed(drv)) query.insert(invalid.begin(), invalid.end()); } @@ -144,7 +144,7 @@ void queryMissing(StoreAPI & store, const PathSet & targets, PathSet outputs; bool mustBuild = false; - if (settings.useSubstitutes && !willBuildLocally(drv)) { + if (settings.useSubstitutes && substitutesAllowed(drv)) { foreach (DerivationOutputs::iterator, j, drv.outputs) { if (!wantOutput(j->first, i2.second)) continue; if (!store.isValidPath(j->second.path)) { |