mirror of
https://github.com/NixOS/nix
synced 2025-07-02 21:51:50 +02:00
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.
This commit is contained in:
parent
1906cce6fc
commit
5558652709
3 changed files with 15 additions and 7 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue