diff options
Diffstat (limited to 'src/build-remote/build-remote.cc')
-rw-r--r-- | src/build-remote/build-remote.cc | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/build-remote/build-remote.cc b/src/build-remote/build-remote.cc index 0559aeaf4..8c9133c17 100644 --- a/src/build-remote/build-remote.cc +++ b/src/build-remote/build-remote.cc @@ -14,10 +14,12 @@ #include "pathlocks.hh" #include "globals.hh" #include "serialise.hh" +#include "build-result.hh" #include "store-api.hh" #include "derivations.hh" #include "local-store.hh" #include "legacy.hh" +#include "experimental-features.hh" using namespace nix; using std::cin; @@ -31,7 +33,7 @@ std::string escapeUri(std::string uri) return uri; } -static string currentLoad; +static std::string currentLoad; static AutoCloseFD openSlotLock(const Machine & m, uint64_t slot) { @@ -96,7 +98,7 @@ static int main_build_remote(int argc, char * * argv) } std::optional<StorePath> drvPath; - string storeUri; + std::string storeUri; while (true) { @@ -130,11 +132,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; @@ -179,7 +184,7 @@ static int main_build_remote(int argc, char * * argv) else { // build the hint template. - string errorText = + std::string errorText = "Failed to find a machine for remote build!\n" "derivation: %s\nrequired (system, features): (%s, %s)"; errorText += "\n%s available machines:"; @@ -189,7 +194,7 @@ static int main_build_remote(int argc, char * * argv) errorText += "\n(%s, %s, %s, %s)"; // add the template values. - string drvstr; + std::string drvstr; if (drvPath.has_value()) drvstr = drvPath->to_string(); else @@ -204,7 +209,7 @@ static int main_build_remote(int argc, char * * argv) for (auto & m : machines) error - % concatStringsSep<vector<string>>(", ", m.systemTypes) + % concatStringsSep<std::vector<std::string>>(", ", m.systemTypes) % m.maxJobs % concatStringsSep<StringSet>(", ", m.supportedFeatures) % concatStringsSep<StringSet>(", ", m.mandatoryFeatures); @@ -295,7 +300,7 @@ connected: std::set<Realisation> missingRealisations; StorePathSet missingPaths; - if (settings.isExperimentalFeatureEnabled("ca-derivations") && !derivationHasKnownOutputPaths(drv.type())) { + if (settings.isExperimentalFeatureEnabled(Xp::CaDerivations) && !derivationHasKnownOutputPaths(drv.type())) { for (auto & outputName : wantedOutputs) { auto thisOutputHash = outputHashes.at(outputName); auto thisOutputId = DrvOutput{ thisOutputHash, outputName }; @@ -327,7 +332,7 @@ connected: for (auto & realisation : missingRealisations) { // Should hold, because if the feature isn't enabled the set // of missing realisations should be empty - settings.requireExperimentalFeature("ca-derivations"); + settings.requireExperimentalFeature(Xp::CaDerivations); store->registerDrvOutput(realisation); } |