From 71a036ed00d7e45c75b8b03c54656de43fa9fe29 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 4 Apr 2022 16:31:36 +0200 Subject: [PATCH] Update to 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/ec90fc4d1f42db3c5e3c74dc186487d10a28c221' (2022-04-05) → 'github:NixOS/nix/5fe4fe823c193cbb7bfa05a468de91eeab09058d' (2022-04-05) • Updated input 'nix/nixpkgs': 'github:NixOS/nixpkgs/82891b5e2c2359d7e58d08849e4c89511ab94234' (2021-09-28) → 'github:NixOS/nixpkgs/530a53dcbc9437363471167a5e4762c5fcfa34a1' (2022-02-19) --- flake.lock | 18 ++++++++---------- flake.nix | 2 +- src/hydra-eval-jobs/hydra-eval-jobs.cc | 14 ++++++++++---- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/flake.lock b/flake.lock index d5c5e613..b9dd6995 100644 --- a/flake.lock +++ b/flake.lock @@ -23,27 +23,25 @@ "nixpkgs-regression": "nixpkgs-regression" }, "locked": { - "lastModified": 1646680282, - "narHash": "sha256-m8tqCS6uHveDon5GSro5yZor9H+sHeh+v/veF1IGw24=", + "lastModified": 1649172203, + "narHash": "sha256-Q3nYaXqbseDOvZrlePKeIrx0/KzqyrtNpxHIUbtFHuI=", "owner": "NixOS", "repo": "nix", - "rev": "ffe155abd36366a870482625543f9bf924a58281", + "rev": "5fe4fe823c193cbb7bfa05a468de91eeab09058d", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "2.7.0", - "repo": "nix", - "type": "github" + "id": "nix", + "type": "indirect" } }, "nixpkgs": { "locked": { - "lastModified": 1632864508, - "narHash": "sha256-d127FIvGR41XbVRDPVvozUPQ/uRHbHwvfyKHwEt5xFM=", + "lastModified": 1645296114, + "narHash": "sha256-y53N7TyIkXsjMpOG7RhvqJFGDacLs9HlyHeSTBioqYU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "82891b5e2c2359d7e58d08849e4c89511ab94234", + "rev": "530a53dcbc9437363471167a5e4762c5fcfa34a1", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index aad9072d..d2b71724 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "A Nix-based continuous build system"; inputs.nixpkgs.follows = "nix/nixpkgs"; - inputs.nix.url = github:NixOS/nix/2.7.0; + #inputs.nix.url = github:NixOS/nix/2.7.0; outputs = { self, nixpkgs, nix }: let diff --git a/src/hydra-eval-jobs/hydra-eval-jobs.cc b/src/hydra-eval-jobs/hydra-eval-jobs.cc index ba92113e..7485b297 100644 --- a/src/hydra-eval-jobs/hydra-eval-jobs.cc +++ b/src/hydra-eval-jobs/hydra-eval-jobs.cc @@ -210,7 +210,9 @@ static void worker( nlohmann::json out; for (auto & j : outputs) - out[j.first] = state.store->printStorePath(j.second); + // FIXME: handle CA/impure builds. + if (j.second) + out[j.first] = state.store->printStorePath(*j.second); job["outputs"] = std::move(out); reply["job"] = std::move(job); @@ -489,10 +491,14 @@ int main(int argc, char * * argv) std::string drvName(drvPath.name()); assert(hasSuffix(drvName, drvExtension)); drvName.resize(drvName.size() - drvExtension.size()); - auto h = std::get(hashDerivationModulo(*store, drv, true)); - auto outPath = store->makeOutputPath("out", h, drvName); + + auto hashModulo = hashDerivationModulo(*store, drv, true); + if (hashModulo.kind != DrvHash::Kind::Regular) continue; + auto h = hashModulo.hashes.find("out"); + if (h == hashModulo.hashes.end()) continue; + auto outPath = store->makeOutputPath("out", h->second, drvName); drv.env["out"] = store->printStorePath(outPath); - drv.outputs.insert_or_assign("out", DerivationOutput { .output = DerivationOutputInputAddressed { .path = outPath } }); + drv.outputs.insert_or_assign("out", DerivationOutput::InputAddressed { .path = outPath }); auto newDrvPath = store->printStorePath(writeDerivation(*store, drv)); debug("rewrote aggregate derivation %s -> %s", store->printStorePath(drvPath), newDrvPath);