diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2021-10-27 14:21:31 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2021-10-27 14:21:31 +0200 |
commit | f2280749b1d58a56f91ad417b487e920ab23b8b6 (patch) | |
tree | 1c3fd4819c74941f1c36a604aa8233b8c3ae993c /src/libstore | |
parent | 6e684d1b8747ed0180489eacbdf920a82162e249 (diff) |
If max-jobs == 0, do preferLocalBuild on remote builders
Diffstat (limited to 'src/libstore')
-rw-r--r-- | src/libstore/build/derivation-goal.cc | 4 |
1 files changed, 3 insertions, 1 deletions
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()) { |