aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build/local-derivation-goal.cc
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-08-25 13:41:56 +0200
committereldritch horrors <pennae@lix.systems>2024-08-25 19:55:47 +0200
commitcae260a15874dab1dfa505a1f11ae98be2f03afd (patch)
tree29629d22fb1e6509d0e8cd03299acec89a0bd497 /src/libstore/build/local-derivation-goal.cc
parent04b591dc1de3270e60de72918bf1ba200e566f86 (diff)
libstore: diagnose local build failure in goal
this should be done where we're actually trying to build something, not in the main worker loop that shouldn't have to be aware of such details Change-Id: I07276740c0e2e5591a8ce4828a4bfc705396527e
Diffstat (limited to 'src/libstore/build/local-derivation-goal.cc')
-rw-r--r--src/libstore/build/local-derivation-goal.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
index 1e3c4109d..8587ad662 100644
--- a/src/libstore/build/local-derivation-goal.cc
+++ b/src/libstore/build/local-derivation-goal.cc
@@ -1,6 +1,7 @@
#include "local-derivation-goal.hh"
#include "indirect-root-store.hh"
#include "hook-instance.hh"
+#include "machines.hh"
#include "store-api.hh"
#include "worker.hh"
#include "builtins.hh"
@@ -159,7 +160,21 @@ Goal::WorkResult LocalDerivationGoal::tryLocalBuild(bool inBuildSlot)
if (!inBuildSlot) {
state = &DerivationGoal::tryToBuild;
outputLocks.unlock();
- return WaitForSlot{};
+ if (0U != settings.maxBuildJobs) {
+ return WaitForSlot{};
+ }
+ if (getMachines().empty()) {
+ throw Error(
+ "unable to start any build; either set '--max-jobs' to a non-zero value or enable "
+ "remote builds.\n"
+ "https://docs.lix.systems/manual/lix/stable/advanced-topics/distributed-builds.html"
+ );
+ } else {
+ throw Error(
+ "unable to start any build; remote machines may not have all required system features.\n"
+ "https://docs.lix.systems/manual/lix/stable/advanced-topics/distributed-builds.html"
+ );
+ }
}
assert(derivationType);