From 20c8263e3c993d4ba0a2a0bedd531a7f32861441 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 7 Dec 2023 11:40:30 -0500 Subject: [PATCH 01/17] Update to Nix master MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The point of this branch is to always track Nix master, so we are proactively ready to upgrade to the next Nix release when it is ready. Flake lock file updates: • Updated input 'nix': 'github:NixOS/nix/50f8f1c8bc019a4c0fd098b9ac674b94cfc6af0d' (2023-11-27) → 'github:NixOS/nix/c3827ff6348a4d5199eaddf8dbc2ca2e2ef46ec5' (2023-12-07) • Added input 'nix/libgit2': 'github:libgit2/libgit2/45fd9ed7ae1a9b74b957ef4f337bc3c8b3df01b5' (2023-10-18) --- flake.lock | 24 ++++++++++++++++++++---- flake.nix | 2 +- src/hydra-queue-runner/build-remote.cc | 2 +- src/hydra-queue-runner/nar-extractor.cc | 2 +- src/hydra-queue-runner/queue-monitor.cc | 2 +- 5 files changed, 24 insertions(+), 8 deletions(-) diff --git a/flake.lock b/flake.lock index 2871e70a1..ae4f60ebe 100644 --- a/flake.lock +++ b/flake.lock @@ -16,6 +16,22 @@ "type": "github" } }, + "libgit2": { + "flake": false, + "locked": { + "lastModified": 1697646580, + "narHash": "sha256-oX4Z3S9WtJlwvj0uH9HlYcWv+x1hqp8mhXl7HsLu2f0=", + "owner": "libgit2", + "repo": "libgit2", + "rev": "45fd9ed7ae1a9b74b957ef4f337bc3c8b3df01b5", + "type": "github" + }, + "original": { + "owner": "libgit2", + "repo": "libgit2", + "type": "github" + } + }, "lowdown-src": { "flake": false, "locked": { @@ -35,6 +51,7 @@ "nix": { "inputs": { "flake-compat": "flake-compat", + "libgit2": "libgit2", "lowdown-src": "lowdown-src", "nixpkgs": [ "nixpkgs" @@ -42,16 +59,15 @@ "nixpkgs-regression": "nixpkgs-regression" }, "locked": { - "lastModified": 1701122567, - "narHash": "sha256-iA8DqS+W2fWTfR+nNJSvMHqQ+4NpYMRT3b+2zS6JTvE=", + "lastModified": 1701948782, + "narHash": "sha256-rEu4hLHZIy3fgf88BpiaVfl79hNSESRfQNbmxAO5uzg=", "owner": "NixOS", "repo": "nix", - "rev": "50f8f1c8bc019a4c0fd098b9ac674b94cfc6af0d", + "rev": "c3827ff6348a4d5199eaddf8dbc2ca2e2ef46ec5", "type": "github" }, "original": { "owner": "NixOS", - "ref": "2.19.2", "repo": "nix", "type": "github" } diff --git a/flake.nix b/flake.nix index 5a5aef553..fdeaa6ca2 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "A Nix-based continuous build system"; inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05"; - inputs.nix.url = "github:NixOS/nix/2.19.2"; + inputs.nix.url = "github:NixOS/nix"; inputs.nix.inputs.nixpkgs.follows = "nixpkgs"; outputs = { self, nixpkgs, nix }: diff --git a/src/hydra-queue-runner/build-remote.cc b/src/hydra-queue-runner/build-remote.cc index f41585c83..dad414bf3 100644 --- a/src/hydra-queue-runner/build-remote.cc +++ b/src/hydra-queue-runner/build-remote.cc @@ -350,7 +350,7 @@ static std::map queryPathInfos( auto references = ServeProto::Serialise::read(localStore, conn); readLongLong(conn.from); // download size auto narSize = readLongLong(conn.from); - auto narHash = Hash::parseAny(readString(conn.from), htSHA256); + auto narHash = Hash::parseAny(readString(conn.from), HashAlgorithm::SHA256); auto ca = ContentAddress::parseOpt(readString(conn.from)); readStrings(conn.from); // sigs ValidPathInfo info(localStore.parseStorePath(storePathS), narHash); diff --git a/src/hydra-queue-runner/nar-extractor.cc b/src/hydra-queue-runner/nar-extractor.cc index 3c6857bf2..ff4aa2685 100644 --- a/src/hydra-queue-runner/nar-extractor.cc +++ b/src/hydra-queue-runner/nar-extractor.cc @@ -42,7 +42,7 @@ struct Extractor : ParseSink void preallocateContents(uint64_t size) override { expectedSize = size; - hashSink = std::make_unique(htSHA256); + hashSink = std::make_unique(HashAlgorithm::SHA256); } void receiveContents(std::string_view data) override diff --git a/src/hydra-queue-runner/queue-monitor.cc b/src/hydra-queue-runner/queue-monitor.cc index 6c339af64..3ce9bba27 100644 --- a/src/hydra-queue-runner/queue-monitor.cc +++ b/src/hydra-queue-runner/queue-monitor.cc @@ -677,7 +677,7 @@ BuildOutput State::getBuildOutputCached(Connection & conn, nix::ref product.fileSize = row[2].as(); } if (!row[3].is_null()) - product.sha256hash = Hash::parseAny(row[3].as(), htSHA256); + product.sha256hash = Hash::parseAny(row[3].as(), HashAlgorithm::SHA256); if (!row[4].is_null()) product.path = row[4].as(); product.name = row[5].as(); From aaa0e128c1e85885ff55f6abd3a3115ab4b194be Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 9 Dec 2023 11:58:09 -0500 Subject: [PATCH 02/17] flake.lock: Update Nix master MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nix': 'github:NixOS/nix/c3827ff6348a4d5199eaddf8dbc2ca2e2ef46ec5' (2023-12-07) → 'github:NixOS/nix/c8458bd731eb1c74159bebe459ea00165e056b65' (2023-12-09) --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index ae4f60ebe..424ed3b09 100644 --- a/flake.lock +++ b/flake.lock @@ -59,11 +59,11 @@ "nixpkgs-regression": "nixpkgs-regression" }, "locked": { - "lastModified": 1701948782, - "narHash": "sha256-rEu4hLHZIy3fgf88BpiaVfl79hNSESRfQNbmxAO5uzg=", + "lastModified": 1702090558, + "narHash": "sha256-JzuGOltp5Ht9flroZ7g0erD5ud2okNQChw9YlxWDX3c=", "owner": "NixOS", "repo": "nix", - "rev": "c3827ff6348a4d5199eaddf8dbc2ca2e2ef46ec5", + "rev": "c8458bd731eb1c74159bebe459ea00165e056b65", "type": "github" }, "original": { From 3f932a6731cfd40919258d0731aad235b77e470c Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 7 Dec 2023 14:10:28 -0500 Subject: [PATCH 03/17] build-remote: Use `std::map` It is less denormalized --- src/hydra-queue-runner/build-remote.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/hydra-queue-runner/build-remote.cc b/src/hydra-queue-runner/build-remote.cc index 05bfdb66f..62d321bb1 100644 --- a/src/hydra-queue-runner/build-remote.cc +++ b/src/hydra-queue-runner/build-remote.cc @@ -154,7 +154,7 @@ static void copyClosureTo( // FIXME: use Store::topoSortPaths(). -static StorePaths reverseTopoSortPaths(const std::map & paths) +static StorePaths reverseTopoSortPaths(const std::map & paths) { StorePaths sorted; StorePathSet visited; @@ -322,7 +322,7 @@ static BuildResult performBuild( return result; } -static std::map queryPathInfos( +static std::map queryPathInfos( Machine::Connection & conn, Store & localStore, StorePathSet & outputs, @@ -331,7 +331,7 @@ static std::map queryPathInfos( { /* Get info about each output path. */ - std::map infos; + std::map infos; conn.to << ServeProto::Command::QueryPathInfos; ServeProto::write(localStore, conn, outputs); conn.to.flush(); @@ -395,14 +395,16 @@ static void copyPathsFromRemote( NarMemberDatas & narMembers, Store & localStore, Store & destStore, - const std::map & infos + const std::map & infos ) { auto pathsSorted = reverseTopoSortPaths(infos); for (auto & path : pathsSorted) { auto & info = infos.find(path)->second; - copyPathFromRemote(conn, narMembers, localStore, destStore, info); + copyPathFromRemote( + conn, narMembers, localStore, destStore, + ValidPathInfo { path, info }); } } From d0d3b0a2986915ab7aa96d3fce8371a5012c9021 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 7 Dec 2023 14:13:06 -0500 Subject: [PATCH 04/17] Use `ServeProto::Serialise` for `QueryValidPaths` Companion to already-merged https://github.com/NixOS/nix/pull/9560 --- src/hydra-queue-runner/build-remote.cc | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/src/hydra-queue-runner/build-remote.cc b/src/hydra-queue-runner/build-remote.cc index 62d321bb1..5818727bf 100644 --- a/src/hydra-queue-runner/build-remote.cc +++ b/src/hydra-queue-runner/build-remote.cc @@ -338,23 +338,10 @@ static std::map queryPathInfos( while (true) { auto storePathS = readString(conn.from); if (storePathS == "") break; - auto deriver = readString(conn.from); // deriver - auto references = ServeProto::Serialise::read(localStore, conn); - readLongLong(conn.from); // download size - auto narSize = readLongLong(conn.from); - auto narHash = Hash::parseAny(readString(conn.from), HashAlgorithm::SHA256); - auto ca = ContentAddress::parseOpt(readString(conn.from)); - readStrings(conn.from); // sigs - ValidPathInfo info(localStore.parseStorePath(storePathS), narHash); - assert(outputs.count(info.path)); - info.references = references; - info.narSize = narSize; - totalNarSize += info.narSize; - info.narHash = narHash; - info.ca = ca; - if (deriver != "") - info.deriver = localStore.parseStorePath(deriver); - infos.insert_or_assign(info.path, info); + + auto storePath = localStore.parseStorePath(storePathS); + auto info = ServeProto::Serialise::read(localStore, conn); + infos.insert_or_assign(storePath, info); } return infos; From f6f817926a5ee98af4251a4244d01f5ba1f31695 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 9 Dec 2023 12:11:04 -0500 Subject: [PATCH 05/17] `std::move` the into the path info map --- src/hydra-queue-runner/build-remote.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hydra-queue-runner/build-remote.cc b/src/hydra-queue-runner/build-remote.cc index 5818727bf..a8047182b 100644 --- a/src/hydra-queue-runner/build-remote.cc +++ b/src/hydra-queue-runner/build-remote.cc @@ -341,7 +341,7 @@ static std::map queryPathInfos( auto storePath = localStore.parseStorePath(storePathS); auto info = ServeProto::Serialise::read(localStore, conn); - infos.insert_or_assign(storePath, info); + infos.insert_or_assign(std::move(storePath), std::move(info)); } return infos; From 1d80b72ffb9d9619a0c146d4662d27e3bd45850b Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sun, 10 Dec 2023 13:00:43 -0500 Subject: [PATCH 06/17] flake.lock: Update Nix master MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nix': 'github:NixOS/nix/c8458bd731eb1c74159bebe459ea00165e056b65' (2023-12-09) → 'github:NixOS/nix/b7e016ab2464ad2e7e2e856ad0f173157135aae0' (2023-12-10) --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 424ed3b09..d99954a9d 100644 --- a/flake.lock +++ b/flake.lock @@ -59,11 +59,11 @@ "nixpkgs-regression": "nixpkgs-regression" }, "locked": { - "lastModified": 1702090558, - "narHash": "sha256-JzuGOltp5Ht9flroZ7g0erD5ud2okNQChw9YlxWDX3c=", + "lastModified": 1702228562, + "narHash": "sha256-VwvfxT8LZcEm3H+VCMCrKzl7Ip+dHumxPfugAx3tjk8=", "owner": "NixOS", "repo": "nix", - "rev": "c8458bd731eb1c74159bebe459ea00165e056b65", + "rev": "b7e016ab2464ad2e7e2e856ad0f173157135aae0", "type": "github" }, "original": { From 69a5b00e60df0a40ac8f193f33937b7214872327 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 7 Dec 2023 14:18:00 -0500 Subject: [PATCH 07/17] Use `ServeProto::BuildOption` More deduplication with Nix. --- src/hydra-queue-runner/build-remote.cc | 8 ++++---- src/hydra-queue-runner/builder.cc | 15 +++++++++------ src/hydra-queue-runner/state.hh | 10 ++-------- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/hydra-queue-runner/build-remote.cc b/src/hydra-queue-runner/build-remote.cc index a8047182b..1fdd5a23b 100644 --- a/src/hydra-queue-runner/build-remote.cc +++ b/src/hydra-queue-runner/build-remote.cc @@ -282,7 +282,7 @@ static BuildResult performBuild( Store & localStore, StorePath drvPath, const BasicDerivation & drv, - const State::BuildOptions & options, + const ServeProto::BuildOptions & options, counter & nrStepsBuilding ) { @@ -293,7 +293,7 @@ static BuildResult performBuild( conn.to << options.maxLogSize; if (GET_PROTOCOL_MINOR(conn.remoteVersion) >= 3) { conn.to - << options.repeats // == build-repeat + << options.nrRepeats << options.enforceDeterminism; } conn.to.flush(); @@ -458,7 +458,7 @@ void RemoteResult::updateWithBuildResult(const nix::BuildResult & buildResult) void State::buildRemote(ref destStore, Machine::ptr machine, Step::ptr step, - const BuildOptions & buildOptions, + const ServeProto::BuildOptions & buildOptions, RemoteResult & result, std::shared_ptr activeStep, std::function updateStep, NarMemberDatas & narMembers) @@ -510,7 +510,7 @@ void State::buildRemote(ref destStore, }); try { - build_remote::handshake(conn, buildOptions.repeats); + build_remote::handshake(conn, buildOptions.nrRepeats); } catch (EndOfFile & e) { child.pid.wait(); std::string s = chomp(readFile(result.logFile)); diff --git a/src/hydra-queue-runner/builder.cc b/src/hydra-queue-runner/builder.cc index 307eee8ea..cfa95cef1 100644 --- a/src/hydra-queue-runner/builder.cc +++ b/src/hydra-queue-runner/builder.cc @@ -98,10 +98,13 @@ State::StepResult State::doBuildStep(nix::ref destStore, it). */ BuildID buildId; std::optional buildDrvPath; - BuildOptions buildOptions; - buildOptions.repeats = step->isDeterministic ? 1 : 0; - buildOptions.maxLogSize = maxLogSize; - buildOptions.enforceDeterminism = step->isDeterministic; + // Other fields set below + nix::ServeProto::BuildOptions buildOptions { + .maxLogSize = maxLogSize, + .nrRepeats = step->isDeterministic ? 1u : 0u, + .enforceDeterminism = step->isDeterministic, + .keepFailed = false, + }; auto conn(dbPool.get()); @@ -136,7 +139,7 @@ State::StepResult State::doBuildStep(nix::ref destStore, { auto i = jobsetRepeats.find(std::make_pair(build2->projectName, build2->jobsetName)); if (i != jobsetRepeats.end()) - buildOptions.repeats = std::max(buildOptions.repeats, i->second); + buildOptions.nrRepeats = std::max(buildOptions.nrRepeats, i->second); } } if (!build) build = *dependents.begin(); @@ -147,7 +150,7 @@ State::StepResult State::doBuildStep(nix::ref destStore, buildOptions.buildTimeout = build->buildTimeout; printInfo("performing step ‘%s’ %d times on ‘%s’ (needed by build %d and %d others)", - localStore->printStorePath(step->drvPath), buildOptions.repeats + 1, machine->sshName, buildId, (dependents.size() - 1)); + localStore->printStorePath(step->drvPath), buildOptions.nrRepeats + 1, machine->sshName, buildId, (dependents.size() - 1)); } if (!buildOneDone) diff --git a/src/hydra-queue-runner/state.hh b/src/hydra-queue-runner/state.hh index 6359063af..830f05982 100644 --- a/src/hydra-queue-runner/state.hh +++ b/src/hydra-queue-runner/state.hh @@ -459,7 +459,7 @@ private: /* How often the build steps of a jobset should be repeated in order to detect non-determinism. */ - std::map, unsigned int> jobsetRepeats; + std::map, size_t> jobsetRepeats; bool uploadLogsToBinaryCache; @@ -488,12 +488,6 @@ private: public: State(std::optional metricsAddrOpt); - struct BuildOptions { - unsigned int maxSilentTime, buildTimeout, repeats; - size_t maxLogSize; - bool enforceDeterminism; - }; - private: nix::MaintainCount startDbUpdate(); @@ -578,7 +572,7 @@ private: void buildRemote(nix::ref destStore, Machine::ptr machine, Step::ptr step, - const BuildOptions & buildOptions, + const nix::ServeProto::BuildOptions & buildOptions, RemoteResult & result, std::shared_ptr activeStep, std::function updateStep, NarMemberDatas & narMembers); From b56d2383c1e0c39418af35665f7d5b21cf49d381 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 7 Dec 2023 14:30:44 -0500 Subject: [PATCH 08/17] Do not attempt to speak a newer version of the protocol Both sides need to agree on a version (with `std::min`) for anything to work. Somehow... we've never done this. With this comment, the next commit succeeds. Without this commit, the next commit fails. This is because the next commit exposes serializers which do different things for proto version 2.7, and we're currently requesting 2.6. Opened https://github.com/NixOS/nix/issues/9584 to track this issue --- src/hydra-queue-runner/build-remote.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/hydra-queue-runner/build-remote.cc b/src/hydra-queue-runner/build-remote.cc index 1fdd5a23b..659618b7d 100644 --- a/src/hydra-queue-runner/build-remote.cc +++ b/src/hydra-queue-runner/build-remote.cc @@ -203,7 +203,9 @@ static std::pair openLogFile(const std::string & logDir, cons */ static void handshake(Machine::Connection & conn, unsigned int repeats) { - conn.to << SERVE_MAGIC_1 << 0x206; + constexpr ServeProto::Version our_version = 0x206; + + conn.to << SERVE_MAGIC_1 << our_version; conn.to.flush(); unsigned int magic = readInt(conn.from); @@ -215,6 +217,9 @@ static void handshake(Machine::Connection & conn, unsigned int repeats) throw Error("unsupported ‘nix-store --serve’ protocol version on ‘%1%’", conn.machine->sshName); if (GET_PROTOCOL_MINOR(conn.remoteVersion) < 3 && repeats > 0) throw Error("machine ‘%1%’ does not support repeating a build; please upgrade it to Nix 1.12", conn.machine->sshName); + + // Do not attempt to speak a newer version of the protocol + conn.remoteVersion = std::min(conn.remoteVersion, our_version); } static BasicDerivation sendInputs( From 20f5a2120cf0663bd52df9e82c42d26942017c1a Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 9 Dec 2023 12:26:11 -0500 Subject: [PATCH 09/17] Use `ServeProto::Serialise` --- src/hydra-queue-runner/build-remote.cc | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/hydra-queue-runner/build-remote.cc b/src/hydra-queue-runner/build-remote.cc index 659618b7d..a4882f5c4 100644 --- a/src/hydra-queue-runner/build-remote.cc +++ b/src/hydra-queue-runner/build-remote.cc @@ -293,14 +293,7 @@ static BuildResult performBuild( { conn.to << ServeProto::Command::BuildDerivation << localStore.printStorePath(drvPath); writeDerivation(conn.to, localStore, drv); - conn.to << options.maxSilentTime << options.buildTimeout; - if (GET_PROTOCOL_MINOR(conn.remoteVersion) >= 2) - conn.to << options.maxLogSize; - if (GET_PROTOCOL_MINOR(conn.remoteVersion) >= 3) { - conn.to - << options.nrRepeats - << options.enforceDeterminism; - } + ServeProto::write(localStore, conn, options); conn.to.flush(); BuildResult result; From 8c10331ee818a21699a8b774cccdd32f476f8ba6 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sun, 10 Dec 2023 14:05:26 -0500 Subject: [PATCH 10/17] Fix `totalNarSize` summation I accidentally removed it in d0d3b0a2986915ab7aa96d3fce8371a5012c9021. --- src/hydra-queue-runner/build-remote.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hydra-queue-runner/build-remote.cc b/src/hydra-queue-runner/build-remote.cc index 1fdd5a23b..41c7c4532 100644 --- a/src/hydra-queue-runner/build-remote.cc +++ b/src/hydra-queue-runner/build-remote.cc @@ -341,6 +341,7 @@ static std::map queryPathInfos( auto storePath = localStore.parseStorePath(storePathS); auto info = ServeProto::Serialise::read(localStore, conn); + totalNarSize += info.narSize; infos.insert_or_assign(std::move(storePath), std::move(info)); } From db7aa01b8d90439081ee60dce998a8b30ad5f5b2 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 22 Jan 2024 13:49:05 -0500 Subject: [PATCH 11/17] Update to newer Nix master MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nix': 'github:NixOS/nix/b7e016ab2464ad2e7e2e856ad0f173157135aae0' (2023-12-10) → 'github:NixOS/nix/74534829f23b668fb9b2f2a14ff6afa4d5e71d4a' (2024-01-22) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/e9f06adb793d1cca5384907b3b8a4071d5d7cb19' (2023-12-03) → 'github:NixOS/nixpkgs/a1982c92d8980a0114372973cbdfe0a307f1bdea' (2024-01-12) • Removed input 'nix/lowdown-src' --- flake.lock | 31 ++++++-------------------- flake.nix | 2 +- src/hydra-eval-jobs/hydra-eval-jobs.cc | 4 ++-- 3 files changed, 10 insertions(+), 27 deletions(-) diff --git a/flake.lock b/flake.lock index d99954a9d..8b15a882f 100644 --- a/flake.lock +++ b/flake.lock @@ -32,38 +32,21 @@ "type": "github" } }, - "lowdown-src": { - "flake": false, - "locked": { - "lastModified": 1633514407, - "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", - "owner": "kristapsdz", - "repo": "lowdown", - "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8", - "type": "github" - }, - "original": { - "owner": "kristapsdz", - "repo": "lowdown", - "type": "github" - } - }, "nix": { "inputs": { "flake-compat": "flake-compat", "libgit2": "libgit2", - "lowdown-src": "lowdown-src", "nixpkgs": [ "nixpkgs" ], "nixpkgs-regression": "nixpkgs-regression" }, "locked": { - "lastModified": 1702228562, - "narHash": "sha256-VwvfxT8LZcEm3H+VCMCrKzl7Ip+dHumxPfugAx3tjk8=", + "lastModified": 1705948977, + "narHash": "sha256-8ZUbb/vf2R0kKKHJyLTIh0HYKzgkV2pq/unDj0kzKG8=", "owner": "NixOS", "repo": "nix", - "rev": "b7e016ab2464ad2e7e2e856ad0f173157135aae0", + "rev": "74534829f23b668fb9b2f2a14ff6afa4d5e71d4a", "type": "github" }, "original": { @@ -74,16 +57,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1701615100, - "narHash": "sha256-7VI84NGBvlCTduw2aHLVB62NvCiZUlALLqBe5v684Aw=", + "lastModified": 1705033721, + "narHash": "sha256-K5eJHmL1/kev6WuqyqqbS1cdNnSidIZ3jeqJ7GbrYnQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e9f06adb793d1cca5384907b3b8a4071d5d7cb19", + "rev": "a1982c92d8980a0114372973cbdfe0a307f1bdea", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-23.05", + "ref": "nixos-23.05-small", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index fdeaa6ca2..c9af0174f 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,7 @@ { description = "A Nix-based continuous build system"; - inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05-small"; inputs.nix.url = "github:NixOS/nix"; inputs.nix.inputs.nixpkgs.follows = "nixpkgs"; diff --git a/src/hydra-eval-jobs/hydra-eval-jobs.cc b/src/hydra-eval-jobs/hydra-eval-jobs.cc index 2fe2c80f6..1c4b5d93e 100644 --- a/src/hydra-eval-jobs/hydra-eval-jobs.cc +++ b/src/hydra-eval-jobs/hydra-eval-jobs.cc @@ -89,7 +89,7 @@ struct MyArgs : MixEvalArgs, MixCommonArgs, RootArgs static MyArgs myArgs; -static std::string queryMetaStrings(EvalState & state, DrvInfo & drv, const std::string & name, const std::string & subAttribute) +static std::string queryMetaStrings(EvalState & state, PackageInfo & drv, const std::string & name, const std::string & subAttribute) { Strings res; std::function rec; @@ -178,7 +178,7 @@ static void worker( if (auto drv = getDerivation(state, *v, false)) { - DrvInfo::Outputs outputs = drv->queryOutputs(); + PackageInfo::Outputs outputs = drv->queryOutputs(); if (drv->querySystem() == "unknown") throw EvalError("derivation must have a 'system' attribute"); From 4ac31c89df85a6a72d82a392b729b0c90bcd5d33 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sun, 20 Feb 2022 19:51:28 +0000 Subject: [PATCH 12/17] Use `nix::serv_proto::BasicConnection` in build_remote.cc - Use the type itself This lays the foundation for being able to dedup the protocol code. - Use `BasicConnection::handshake`, replacing ours. - Use `BasicConnection::queryValidPaths` - Use `BasicConnection::putBuildDerivationRequest` --- src/hydra-queue-runner/build-remote.cc | 64 ++++++++++---------------- src/hydra-queue-runner/state.hh | 23 +-------- 2 files changed, 26 insertions(+), 61 deletions(-) diff --git a/src/hydra-queue-runner/build-remote.cc b/src/hydra-queue-runner/build-remote.cc index f19008dc2..058af02cb 100644 --- a/src/hydra-queue-runner/build-remote.cc +++ b/src/hydra-queue-runner/build-remote.cc @@ -8,6 +8,7 @@ #include "build-result.hh" #include "path.hh" #include "serve-protocol.hh" +#include "serve-protocol-impl.hh" #include "state.hh" #include "current-process.hh" #include "processes.hh" @@ -123,13 +124,10 @@ static void copyClosureTo( garbage-collect paths that are already there. Optionally, ask the remote host to substitute missing paths. */ // FIXME: substitute output pollutes our build log - conn.to << ServeProto::Command::QueryValidPaths << 1 << useSubstitutes; - ServeProto::write(destStore, conn, closure); - conn.to.flush(); - /* Get back the set of paths that are already valid on the remote host. */ - auto present = ServeProto::Serialise::read(destStore, conn); + auto present = conn.queryValidPaths( + destStore, true, closure, useSubstitutes); if (present.size() == closure.size()) return; @@ -195,33 +193,6 @@ static std::pair openLogFile(const std::string & logDir, cons return {std::move(logFile), std::move(logFD)}; } -/** - * @param conn is not fully initialized; it is this functions job to set - * the `remoteVersion` field after the handshake is completed. - * Therefore, no `ServeProto::Serialize` functions can be used until - * that field is set. - */ -static void handshake(Machine::Connection & conn, unsigned int repeats) -{ - constexpr ServeProto::Version our_version = 0x206; - - conn.to << SERVE_MAGIC_1 << our_version; - conn.to.flush(); - - unsigned int magic = readInt(conn.from); - if (magic != SERVE_MAGIC_2) - throw Error("protocol mismatch with ‘nix-store --serve’ on ‘%1%’", conn.machine->sshName); - conn.remoteVersion = readInt(conn.from); - // Now `conn` is initialized. - if (GET_PROTOCOL_MAJOR(conn.remoteVersion) != 0x200) - throw Error("unsupported ‘nix-store --serve’ protocol version on ‘%1%’", conn.machine->sshName); - if (GET_PROTOCOL_MINOR(conn.remoteVersion) < 3 && repeats > 0) - throw Error("machine ‘%1%’ does not support repeating a build; please upgrade it to Nix 1.12", conn.machine->sshName); - - // Do not attempt to speak a newer version of the protocol - conn.remoteVersion = std::min(conn.remoteVersion, our_version); -} - static BasicDerivation sendInputs( State & state, Step & step, @@ -291,10 +262,7 @@ static BuildResult performBuild( counter & nrStepsBuilding ) { - conn.to << ServeProto::Command::BuildDerivation << localStore.printStorePath(drvPath); - writeDerivation(conn.to, localStore, drv); - ServeProto::write(localStore, conn, options); - conn.to.flush(); + conn.putBuildDerivationRequest(localStore, drvPath, drv, options); BuildResult result; @@ -498,9 +466,13 @@ void State::buildRemote(ref destStore, }); Machine::Connection conn { - .from = child.from.get(), - .to = child.to.get(), - .machine = machine, + { + .to = child.to.get(), + .from = child.from.get(), + /* Handshake. */ + .remoteVersion = 0xdadbeef, // FIXME avoid dummy initialize + }, + /*.machine =*/ machine, }; Finally updateStats([&]() { @@ -508,14 +480,26 @@ void State::buildRemote(ref destStore, bytesSent += conn.to.written; }); + constexpr ServeProto::Version our_version = 0x206; + try { - build_remote::handshake(conn, buildOptions.nrRepeats); + conn.remoteVersion = decltype(conn)::handshake( + conn.to, + conn.from, + our_version, + machine->sshName); } catch (EndOfFile & e) { child.pid.wait(); std::string s = chomp(readFile(result.logFile)); throw Error("cannot connect to ‘%1%’: %2%", machine->sshName, s); } + // Do not attempt to speak a newer version of the protocol. + // + // Per https://github.com/NixOS/nix/issues/9584 should be handled as + // part of `handshake` in upstream nix. + conn.remoteVersion = std::min(conn.remoteVersion, our_version); + { auto info(machine->state->connectInfo.lock()); info->consecutiveFailures = 0; diff --git a/src/hydra-queue-runner/state.hh b/src/hydra-queue-runner/state.hh index 830f05982..82481ab5d 100644 --- a/src/hydra-queue-runner/state.hh +++ b/src/hydra-queue-runner/state.hh @@ -22,6 +22,7 @@ #include "sync.hh" #include "nar-extractor.hh" #include "serve-protocol.hh" +#include "serve-protocol-impl.hh" typedef unsigned int BuildID; @@ -302,29 +303,9 @@ struct Machine } // A connection to a machine - struct Connection { - nix::FdSource from; - nix::FdSink to; - nix::ServeProto::Version remoteVersion; - + struct Connection : nix::ServeProto::BasicClientConnection { // Backpointer to the machine ptr machine; - - operator nix::ServeProto::ReadConn () - { - return { - .from = from, - .version = remoteVersion, - }; - } - - operator nix::ServeProto::WriteConn () - { - return { - .to = to, - .version = remoteVersion, - }; - } }; }; From 84c46b6b6865721bb23a38580f4e190548a5a380 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 23 Jan 2024 09:43:43 -0500 Subject: [PATCH 13/17] Update to newer Nix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nix': 'github:NixOS/nix/74534829f23b668fb9b2f2a14ff6afa4d5e71d4a' (2024-01-22) → 'github:NixOS/nix/b6aee9a93f6646bbffd919d362a5c75c37bb9caa' (2024-01-23) --- flake.lock | 6 +- src/hydra-queue-runner/nar-extractor.cc | 91 +++++++++++++------------ 2 files changed, 52 insertions(+), 45 deletions(-) diff --git a/flake.lock b/flake.lock index 8b15a882f..c78d52036 100644 --- a/flake.lock +++ b/flake.lock @@ -42,11 +42,11 @@ "nixpkgs-regression": "nixpkgs-regression" }, "locked": { - "lastModified": 1705948977, - "narHash": "sha256-8ZUbb/vf2R0kKKHJyLTIh0HYKzgkV2pq/unDj0kzKG8=", + "lastModified": 1706016881, + "narHash": "sha256-XZz6tfTuZcrrX27vI+jAereNVWmnCrzFhBFhaKwEdoY=", "owner": "NixOS", "repo": "nix", - "rev": "74534829f23b668fb9b2f2a14ff6afa4d5e71d4a", + "rev": "b6aee9a93f6646bbffd919d362a5c75c37bb9caa", "type": "github" }, "original": { diff --git a/src/hydra-queue-runner/nar-extractor.cc b/src/hydra-queue-runner/nar-extractor.cc index ff4aa2685..61299ecd1 100644 --- a/src/hydra-queue-runner/nar-extractor.cc +++ b/src/hydra-queue-runner/nar-extractor.cc @@ -6,7 +6,46 @@ using namespace nix; -struct Extractor : ParseSink + +struct NarMemberConstructor : CreateRegularFileSink +{ + NarMemberData & curMember; + + HashSink hashSink = HashSink { HashAlgorithm::SHA256 }; + + std::optional expectedSize; + + NarMemberConstructor(NarMemberData & curMember) + : curMember(curMember) + { } + + void isExecutable() override + { + } + + void preallocateContents(uint64_t size) override + { + expectedSize = size; + } + + void operator () (std::string_view data) override + { + assert(expectedSize); + *curMember.fileSize += data.size(); + hashSink(data); + if (curMember.contents) { + curMember.contents->append(data); + } + assert(curMember.fileSize <= expectedSize); + if (curMember.fileSize == expectedSize) { + auto [hash, len] = hashSink.finish(); + assert(curMember.fileSize == len); + curMember.sha256 = hash; + } + } +}; + +struct Extractor : FileSystemObjectSink { std::unordered_set filesToKeep { "/nix-support/hydra-build-products", @@ -15,7 +54,6 @@ struct Extractor : ParseSink }; NarMemberDatas & members; - NarMemberData * curMember = nullptr; Path prefix; Extractor(NarMemberDatas & members, const Path & prefix) @@ -27,53 +65,22 @@ struct Extractor : ParseSink members.insert_or_assign(prefix + path, NarMemberData { .type = SourceAccessor::Type::tDirectory }); } - void createRegularFile(const Path & path) override + void createRegularFile(const Path & path, std::function func) override { - curMember = &members.insert_or_assign(prefix + path, NarMemberData { - .type = SourceAccessor::Type::tRegular, - .fileSize = 0, - .contents = filesToKeep.count(path) ? std::optional("") : std::nullopt, - }).first->second; - } - - std::optional expectedSize; - std::unique_ptr hashSink; - - void preallocateContents(uint64_t size) override - { - expectedSize = size; - hashSink = std::make_unique(HashAlgorithm::SHA256); - } - - void receiveContents(std::string_view data) override - { - assert(expectedSize); - assert(curMember); - assert(hashSink); - *curMember->fileSize += data.size(); - (*hashSink)(data); - if (curMember->contents) { - curMember->contents->append(data); - } - assert(curMember->fileSize <= expectedSize); - if (curMember->fileSize == expectedSize) { - auto [hash, len] = hashSink->finish(); - assert(curMember->fileSize == len); - curMember->sha256 = hash; - hashSink.reset(); - } + NarMemberConstructor nmc { + members.insert_or_assign(prefix + path, NarMemberData { + .type = SourceAccessor::Type::tRegular, + .fileSize = 0, + .contents = filesToKeep.count(path) ? std::optional("") : std::nullopt, + }).first->second, + }; + func(nmc); } void createSymlink(const Path & path, const std::string & target) override { members.insert_or_assign(prefix + path, NarMemberData { .type = SourceAccessor::Type::tSymlink }); } - - void isExecutable() override - { } - - void closeRegularFile() override - { } }; From 7386caaecfd68fbf70099eb8f3a6f8e296d1fb5b Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 22 Jan 2024 18:38:39 -0500 Subject: [PATCH 14/17] Use Nix's `SSHMaster` --- src/hydra-queue-runner/build-remote.cc | 87 +++++++------------------- 1 file changed, 24 insertions(+), 63 deletions(-) diff --git a/src/hydra-queue-runner/build-remote.cc b/src/hydra-queue-runner/build-remote.cc index 68a339f3f..7f547a0ba 100644 --- a/src/hydra-queue-runner/build-remote.cc +++ b/src/hydra-queue-runner/build-remote.cc @@ -21,12 +21,6 @@ using namespace nix; - -static void append(Strings & dst, const Strings & src) -{ - dst.insert(dst.end(), src.begin(), src.end()); -} - namespace nix::build_remote { static Strings extraStoreArgs(std::string & machine) @@ -49,58 +43,20 @@ static Strings extraStoreArgs(std::string & machine) return result; } -static void openConnection(Machine::ptr machine, Path tmpDir, int stderrFD, SSHMaster::Connection & child) +static std::unique_ptr openConnection( + Machine::ptr machine, SSHMaster & master) { - std::string pgmName; - Pipe to, from; - to.create(); - from.create(); - - Strings argv; + Strings command = {"nix-store", "--serve", "--write"}; if (machine->isLocalhost()) { - pgmName = "nix-store"; - argv = {"nix-store", "--builders", "", "--serve", "--write"}; + command.push_back("--builders"); + command.push_back(""); } else { - pgmName = "ssh"; - auto sshName = machine->sshName; - Strings extraArgs = extraStoreArgs(sshName); - argv = {"ssh", sshName}; - if (machine->sshKey != "") append(argv, {"-i", machine->sshKey}); - if (machine->sshPublicHostKey != "") { - Path fileName = tmpDir + "/host-key"; - auto p = machine->sshName.find("@"); - std::string host = p != std::string::npos ? std::string(machine->sshName, p + 1) : machine->sshName; - writeFile(fileName, host + " " + machine->sshPublicHostKey + "\n"); - append(argv, {"-oUserKnownHostsFile=" + fileName}); - } - append(argv, - { "-x", "-a", "-oBatchMode=yes", "-oConnectTimeout=60", "-oTCPKeepAlive=yes" - , "--", "nix-store", "--serve", "--write" }); - append(argv, extraArgs); + command.splice(command.end(), extraStoreArgs(machine->sshName)); } - child.sshPid = startProcess([&]() { - restoreProcessContext(); - - if (dup2(to.readSide.get(), STDIN_FILENO) == -1) - throw SysError("cannot dup input pipe to stdin"); - - if (dup2(from.writeSide.get(), STDOUT_FILENO) == -1) - throw SysError("cannot dup output pipe to stdout"); - - if (dup2(stderrFD, STDERR_FILENO) == -1) - throw SysError("cannot dup stderr"); - - execvp(argv.front().c_str(), (char * *) stringsToCharPtrs(argv).data()); // FIXME: remove cast - - throw SysError("cannot start %s", pgmName); + return master.startCommand(std::move(command), { + "-a", "-oBatchMode=yes", "-oConnectTimeout=60", "-oTCPKeepAlive=yes" }); - - to.readSide = -1; - from.writeSide = -1; - - child.in = to.writeSide.release(); - child.out = from.readSide.release(); } @@ -430,21 +386,26 @@ void State::buildRemote(ref destStore, AutoDelete logFileDel(logFile, false); result.logFile = logFile; - nix::Path tmpDir = createTempDir(); - AutoDelete tmpDirDel(tmpDir, true); - try { updateStep(ssConnecting); + SSHMaster master { + machine->sshName, + machine->sshKey, + machine->sshPublicHostKey, + false, // no SSH master yet + false, // no compression yet + logFD.get(), + }; + // FIXME: rewrite to use Store. - SSHMaster::Connection child; - build_remote::openConnection(machine, tmpDir, logFD.get(), child); + auto child = build_remote::openConnection(machine, master); { auto activeStepState(activeStep->state_.lock()); if (activeStepState->cancelled) throw Error("step cancelled"); - activeStepState->pid = child.sshPid; + activeStepState->pid = child->sshPid; } Finally clearPid([&]() { @@ -461,8 +422,8 @@ void State::buildRemote(ref destStore, Machine::Connection conn { { - .to = child.in.get(), - .from = child.out.get(), + .to = child->in.get(), + .from = child->out.get(), /* Handshake. */ .remoteVersion = 0xdadbeef, // FIXME avoid dummy initialize }, @@ -483,7 +444,7 @@ void State::buildRemote(ref destStore, our_version, machine->sshName); } catch (EndOfFile & e) { - child.sshPid.wait(); + child->sshPid.wait(); std::string s = chomp(readFile(result.logFile)); throw Error("cannot connect to ‘%1%’: %2%", machine->sshName, s); } @@ -583,8 +544,8 @@ void State::buildRemote(ref destStore, } /* Shut down the connection. */ - child.in = -1; - child.sshPid.wait(); + child->in = -1; + child->sshPid.wait(); } catch (Error & e) { /* Disable this machine until a certain period of time has From 2bdbf51d7d947c44af159dab391be2a0dfb930d7 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 24 Jan 2024 18:46:56 -0500 Subject: [PATCH 15/17] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nix': 'github:NixOS/nix/b6aee9a93f6646bbffd919d362a5c75c37bb9caa' (2024-01-23) → 'github:NixOS/nix/212ba69e6f995992f8b4e4c0656d19c0156c8714' (2024-01-24) --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index c78d52036..bdbc41976 100644 --- a/flake.lock +++ b/flake.lock @@ -42,11 +42,11 @@ "nixpkgs-regression": "nixpkgs-regression" }, "locked": { - "lastModified": 1706016881, - "narHash": "sha256-XZz6tfTuZcrrX27vI+jAereNVWmnCrzFhBFhaKwEdoY=", + "lastModified": 1706100941, + "narHash": "sha256-YLYxZrQLQ6i22RLZG/rsB4sIfFzhep7XQYlodzCmKy0=", "owner": "NixOS", "repo": "nix", - "rev": "b6aee9a93f6646bbffd919d362a5c75c37bb9caa", + "rev": "212ba69e6f995992f8b4e4c0656d19c0156c8714", "type": "github" }, "original": { From 449eb2d873d3240ec4f6bc3e6679eeda7a5cadfd Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 24 Jan 2024 20:14:31 -0500 Subject: [PATCH 16/17] Use more `nix::Machine` fields The upstream fields were made to match Hydra, so we can get rid of the extra fields temporary added in 70e5469303b422bdb4b123be222bdea4d7f9611c. --- src/hydra-queue-runner/dispatcher.cc | 6 +++--- src/hydra-queue-runner/hydra-queue-runner.cc | 12 +++++------- src/hydra-queue-runner/state.hh | 10 +--------- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/hydra-queue-runner/dispatcher.cc b/src/hydra-queue-runner/dispatcher.cc index f5d9d3e33..6d738ded5 100644 --- a/src/hydra-queue-runner/dispatcher.cc +++ b/src/hydra-queue-runner/dispatcher.cc @@ -231,11 +231,11 @@ system_time State::doDispatch() sort(machinesSorted.begin(), machinesSorted.end(), [](const MachineInfo & a, const MachineInfo & b) -> bool { - float ta = std::round(a.currentJobs / a.machine->speedFactorFloat); - float tb = std::round(b.currentJobs / b.machine->speedFactorFloat); + float ta = std::round(a.currentJobs / a.machine->speedFactor); + float tb = std::round(b.currentJobs / b.machine->speedFactor); return ta != tb ? ta < tb : - a.machine->speedFactorFloat != b.machine->speedFactorFloat ? a.machine->speedFactorFloat > b.machine->speedFactorFloat : + a.machine->speedFactor != b.machine->speedFactor ? a.machine->speedFactor > b.machine->speedFactor : a.currentJobs > b.currentJobs; }); diff --git a/src/hydra-queue-runner/hydra-queue-runner.cc b/src/hydra-queue-runner/hydra-queue-runner.cc index 5fbcb6414..3d48f3d77 100644 --- a/src/hydra-queue-runner/hydra-queue-runner.cc +++ b/src/hydra-queue-runner/hydra-queue-runner.cc @@ -155,16 +155,16 @@ void State::parseMachines(const std::string & contents) auto machine = std::make_shared<::Machine>(nix::Machine { // `storeUri`, not yet used "", - // `systemTypes`, not yet used - {}, + // `systemTypes` + tokenizeString(tokens[1], ","), // `sshKey` tokens[2] == "-" ? "" : tokens[2], // `maxJobs` tokens[3] != "" ? string2Int(tokens[3]).value() : 1, - // `speedFactor`, not yet used - 1, + // `speedFactor` + atof(tokens[4].c_str()), // `supportedFeatures` std::move(supportedFeatures), // `mandatoryFeatures` @@ -176,8 +176,6 @@ void State::parseMachines(const std::string & contents) }); machine->sshName = tokens[0]; - machine->systemTypesSet = tokenizeString(tokens[1], ","); - machine->speedFactorFloat = atof(tokens[4].c_str()); /* Re-use the State object of the previous machine with the same name. */ @@ -638,7 +636,7 @@ void State::dumpStatus(Connection & conn) json machine = { {"enabled", m->enabled}, - {"systemTypes", m->systemTypesSet}, + {"systemTypes", m->systemTypes}, {"supportedFeatures", m->supportedFeatures}, {"mandatoryFeatures", m->mandatoryFeatures}, {"nrStepsDone", s->nrStepsDone.load()}, diff --git a/src/hydra-queue-runner/state.hh b/src/hydra-queue-runner/state.hh index f6d9d5a94..cda238ae3 100644 --- a/src/hydra-queue-runner/state.hh +++ b/src/hydra-queue-runner/state.hh @@ -244,14 +244,6 @@ struct Machine : nix::Machine we are not yet used to, but once we are, we don't need this. */ std::string sshName; - /* TODO Get rid once `nix::Machine::systemTypes` is a set not - vector. */ - std::set systemTypesSet; - - /* TODO Get rid once `nix::Machine::systemTypes` is a `float` not - an `int`. */ - float speedFactorFloat = 1.0; - struct State { typedef std::shared_ptr ptr; counter currentJobs{0}; @@ -278,7 +270,7 @@ struct Machine : nix::Machine { /* Check that this machine is of the type required by the step. */ - if (!systemTypesSet.count(step->drv->platform == "builtin" ? nix::settings.thisSystem : step->drv->platform)) + if (!systemTypes.count(step->drv->platform == "builtin" ? nix::settings.thisSystem : step->drv->platform)) return false; /* Check that the step requires all mandatory features of this From 14aabc1cc94b1a51f67bbcb30f901785d47a9872 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 30 Jan 2024 13:31:56 -0500 Subject: [PATCH 17/17] Update to released Nix 2.20 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nix': 'github:NixOS/nix/8df68a213fc52a57b02a57005b0e06cc8de40ce3' (2024-01-25) → 'github:NixOS/nix/8f42912c80c0a03f62f6a3d28a3af05a9762565d' (2024-01-30) --- flake.lock | 7 ++++--- flake.nix | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index e3ea8f61c..d8b2e4a94 100644 --- a/flake.lock +++ b/flake.lock @@ -42,15 +42,16 @@ "nixpkgs-regression": "nixpkgs-regression" }, "locked": { - "lastModified": 1706195509, - "narHash": "sha256-1kwfk7H/MWZAcTKHnnWXo/+KlQeOTIRtOIzc4FX3QnE=", + "lastModified": 1706637536, + "narHash": "sha256-fjx+nCOzuSxGWfhwWWc8hCsLFZAjZLDDUcbBtldRqbk=", "owner": "NixOS", "repo": "nix", - "rev": "8df68a213fc52a57b02a57005b0e06cc8de40ce3", + "rev": "8f42912c80c0a03f62f6a3d28a3af05a9762565d", "type": "github" }, "original": { "owner": "NixOS", + "ref": "2.20-maintenance", "repo": "nix", "type": "github" } diff --git a/flake.nix b/flake.nix index 4dc7d25ea..306ed292b 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "A Nix-based continuous build system"; inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05-small"; - inputs.nix.url = "github:NixOS/nix"; + inputs.nix.url = "github:NixOS/nix/2.20-maintenance"; inputs.nix.inputs.nixpkgs.follows = "nixpkgs"; # TODO get rid of this once https://github.com/NixOS/nix/pull/9546 is