diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2022-02-28 18:04:39 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2022-02-28 18:29:33 +0000 |
commit | c863e5f338947ecff275a67725ecf50b2a47bdb5 (patch) | |
tree | 733893d760809edcbc55c7aa8078ab84fcd2aa73 /src/build-remote | |
parent | 7869be49c2735280ceabbd13c087b4a06444ae63 (diff) | |
parent | b592359c565e0220545ba146b32f367e4ecdb23f (diff) |
Merge remote-tracking branch 'upstream/master' into trustless-remote-builder-simple
Diffstat (limited to 'src/build-remote')
-rw-r--r-- | src/build-remote/build-remote.cc | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/build-remote/build-remote.cc b/src/build-remote/build-remote.cc index 72752d624..d9e59d865 100644 --- a/src/build-remote/build-remote.cc +++ b/src/build-remote/build-remote.cc @@ -18,6 +18,7 @@ #include "derivations.hh" #include "local-store.hh" #include "legacy.hh" +#include "experimental-features.hh" using namespace nix; using std::cin; @@ -31,7 +32,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 +97,7 @@ static int main_build_remote(int argc, char * * argv) } std::optional<StorePath> drvPath; - string storeUri; + std::string storeUri; while (true) { @@ -130,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; @@ -179,7 +183,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 +193,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 +208,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); @@ -305,7 +309,7 @@ connected: auto outputHashes = staticOutputHashes(*store, drv); 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 }; @@ -340,7 +344,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); } |