1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-01 00:07:58 +02:00

Merge remote-tracking branch 'origin/master' into flakes

This commit is contained in:
Eelco Dolstra 2019-04-08 14:23:48 +02:00
commit 9b7eac332b
6 changed files with 15 additions and 8 deletions

View file

@ -12,6 +12,7 @@
#include "json.hh"
#include "nar-info.hh"
#include "parsed-derivations.hh"
#include "machines.hh"
#include <algorithm>
#include <iostream>
@ -4411,6 +4412,11 @@ static void primeCache(Store & store, const PathSet & paths)
PathSet willBuild, willSubstitute, unknown;
unsigned long long downloadSize, narSize;
store.queryMissing(paths, willBuild, willSubstitute, unknown, downloadSize, narSize);
if (!willBuild.empty() && 0 == settings.maxBuildJobs && getMachines().empty())
throw Error(
"%d derivations need to be built, but neither local builds ('--max-jobs') "
"nor remote builds ('--builders') are enabled", willBuild.size());
}

View file

@ -89,10 +89,11 @@ void parseMachines(const std::string & s, Machines & machines)
Machines getMachines()
{
Machines machines;
parseMachines(settings.builders, machines);
static auto machines = [&]() {
Machines machines;
parseMachines(settings.builders, machines);
return machines;
}();
return machines;
}