diff --git a/src/build-remote/build-remote.cc b/src/build-remote/build-remote.cc index cec7b369b171..2ac43ac7f4b2 100644 --- a/src/build-remote/build-remote.cc +++ b/src/build-remote/build-remote.cc @@ -101,6 +101,13 @@ static int _main(int argc, char * * argv) auto amWilling = readInt(source); auto neededSystem = readString(source); drvPath = store->parseStorePath(readString(source)); + + string drvstr; + if (drvPath.has_value()) + drvstr = drvPath->to_string(); + else + drvstr = ""; + auto requiredFeatures = readStrings>(source); auto canBuildLocally = amWilling @@ -123,11 +130,18 @@ static int _main(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() && - m.allSupported(requiredFeatures) && - m.mandatoryMet(requiredFeatures)) { + if (!m.enabled) { + debug(format("declined remote machine '%1%' because it is disabled") % m.storeUri); + } else if (std::find(m.systemTypes.begin(), m.systemTypes.end(), neededSystem) + == m.systemTypes.end()) { + printInfo(format("declined remote machine '%1%' for building '%2%' because it does not have the needed system type: '%3%") % m.storeUri % drvstr % neededSystem); + } else if (!m.allSupported(requiredFeatures)) { + std::string joinedFeatures = concatStringsSep(" ", requiredFeatures); + printInfo(format("declined remote machine '%1%' for building '%2%' because it does not have all required features: [ %3%]") % m.storeUri % drvstr % joinedFeatures); + } else if (!m.mandatoryMet(requiredFeatures)) { + std::string joinedFeatures = concatStringsSep(" ", requiredFeatures); + printInfo(format("declined remote machine '%1%' for building '%2%' because the derivation does not have all mandatory features to build on that machine: [ %3%]") % m.storeUri % drvstr % joinedFeatures); + } else { rightType = true; AutoCloseFD free; uint64_t load = 0; @@ -181,12 +195,6 @@ static int _main(int argc, char * * argv) } // add the template values. - string drvstr; - if (drvPath.has_value()) - drvstr = drvPath->to_string(); - else - drvstr = ""; - auto hint = hintformat(hintstring); hint % drvstr diff --git a/src/libstore/build.cc b/src/libstore/build.cc index 76baa1a6e181..e7e6be3d2562 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -4882,9 +4882,14 @@ void Worker::run(const Goals & _topGoals) "or enable remote builds." "\nhttps://nixos.org/nix/manual/#chap-distributed-builds"); else - throw Error("unable to start any build; remote machines may not have " - "all required system features." - "\nhttps://nixos.org/nix/manual/#chap-distributed-builds"); + throw Error("unable to start any build; either increase '--max-jobs' " + "to also allow building locally, or ensure that the configred" + "remote builder machines have all required system features." + "For example, to enable the 'big-parallel' feature, use:" + "\n --builders 'yourbuilderhostname - - - - big-parallel'" + "\nhttps://nixos.org/nix/manual/#chap-distributed-builds" + "\nYou can enable -v verbosity to see why any machine " + "was declined for any given build."); } assert(!awake.empty());