aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-10-27 15:27:17 +0200
committerGitHub <noreply@github.com>2021-10-27 15:27:17 +0200
commit9559f74a997011520c096a6bf407c4f9b0b41109 (patch)
tree726bb82f8149f0d3669e9d62efd56a4b614504b7
parent6e684d1b8747ed0180489eacbdf920a82162e249 (diff)
parent1254e8753c4f07173b0463afad35d9020c6093d7 (diff)
Merge pull request #5440 from edolstra/build-remote
Fix preferLocalBuild when max-jobs == 0
-rw-r--r--src/build-remote/build-remote.cc11
-rw-r--r--src/libstore/build/derivation-goal.cc4
2 files changed, 10 insertions, 5 deletions
diff --git a/src/build-remote/build-remote.cc b/src/build-remote/build-remote.cc
index a6722a1f8..9d541b45d 100644
--- a/src/build-remote/build-remote.cc
+++ b/src/build-remote/build-remote.cc
@@ -131,11 +131,14 @@ static int main_build_remote(int argc, char * * argv)
for (auto & m : machines) {
debug("considering building on remote machine '%s'", m.storeUri);
- if (m.enabled && std::find(m.systemTypes.begin(),
- m.systemTypes.end(),
- neededSystem) != m.systemTypes.end() &&
+ if (m.enabled
+ && (neededSystem == "builtin"
+ || std::find(m.systemTypes.begin(),
+ m.systemTypes.end(),
+ neededSystem) != m.systemTypes.end()) &&
m.allSupported(requiredFeatures) &&
- m.mandatoryMet(requiredFeatures)) {
+ m.mandatoryMet(requiredFeatures))
+ {
rightType = true;
AutoCloseFD free;
uint64_t load = 0;
diff --git a/src/libstore/build/derivation-goal.cc b/src/libstore/build/derivation-goal.cc
index 67cf8b067..b924d23b2 100644
--- a/src/libstore/build/derivation-goal.cc
+++ b/src/libstore/build/derivation-goal.cc
@@ -616,7 +616,9 @@ void DerivationGoal::tryToBuild()
/* Don't do a remote build if the derivation has the attribute
`preferLocalBuild' set. Also, check and repair modes are only
supported for local builds. */
- bool buildLocally = buildMode != bmNormal || parsedDrv->willBuildLocally(worker.store);
+ bool buildLocally =
+ (buildMode != bmNormal || parsedDrv->willBuildLocally(worker.store))
+ && settings.maxBuildJobs.get() != 0;
if (!buildLocally) {
switch (tryBuildHook()) {