mirror of
https://github.com/NixOS/nix
synced 2025-06-28 22:01:15 +02:00
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 5558652709
and adds a
new derivation attribute "allowSubstitutes" to specify whether a
derivation may be substituted.
This commit is contained in:
parent
b190f771e7
commit
b64988bb35
3 changed files with 18 additions and 10 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue