From 8835cbd10fe5659bde8be0504d267a66781268ad Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 13 Feb 2025 18:46:36 -0500 Subject: [PATCH 1/3] 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/a7fdef6858dd45b9d7bda7c92324c63faee7f509?narHash=sha256-XFznzb8L4SdUm9u%2Bw3DPpMWJhffuv%2B/6%2BaiVl00slns%3D' (2024-09-19) → 'github:NixOS/nix/d652513e4519ed4eb48c92f8670e5a71c7793fc3?narHash=sha256-mIpJgIwPS4o4xYhN1B%2B/fHESEXoxpu6nVoZTzZ0MfTg%3D' (2025-02-12) • Updated input 'nix-eval-jobs': 'github:nix-community/nix-eval-jobs/889ea1406736b53cf165b6c28398aae3969418d1?narHash=sha256-3wwtKpS5tUBdjaGeSia7CotonbiRB6K5Kp0dsUt3nzU%3D' (2024-12-10) → 'github:nix-community/nix-eval-jobs/6d4fd5a93d7bc953ffa4dcd6d53ad7056a71eff7?narHash=sha256-1dZLPw%2BnlFQzzswfyTxW%2B8VF1AJ4ZvoYvLTjlHiz1SA%3D' (2025-02-13) --- flake.lock | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/flake.lock b/flake.lock index 8055275b..baa5e8be 100644 --- a/flake.lock +++ b/flake.lock @@ -53,16 +53,16 @@ "nixpkgs-regression": [] }, "locked": { - "lastModified": 1726787955, - "narHash": "sha256-XFznzb8L4SdUm9u+w3DPpMWJhffuv+/6+aiVl00slns=", + "lastModified": 1739390454, + "narHash": "sha256-mIpJgIwPS4o4xYhN1B+/fHESEXoxpu6nVoZTzZ0MfTg=", "owner": "NixOS", "repo": "nix", - "rev": "a7fdef6858dd45b9d7bda7c92324c63faee7f509", + "rev": "d652513e4519ed4eb48c92f8670e5a71c7793fc3", "type": "github" }, "original": { "owner": "NixOS", - "ref": "2.24-maintenance", + "ref": "2.25-maintenance", "repo": "nix", "type": "github" } @@ -77,16 +77,15 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1733814344, - "narHash": "sha256-3wwtKpS5tUBdjaGeSia7CotonbiRB6K5Kp0dsUt3nzU=", + "lastModified": 1739426028, + "narHash": "sha256-1dZLPw+nlFQzzswfyTxW+8VF1AJ4ZvoYvLTjlHiz1SA=", "owner": "nix-community", "repo": "nix-eval-jobs", - "rev": "889ea1406736b53cf165b6c28398aae3969418d1", + "rev": "6d4fd5a93d7bc953ffa4dcd6d53ad7056a71eff7", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-2.24", "repo": "nix-eval-jobs", "type": "github" } From 4347833f45027d13172bf41c21653911795cfac7 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 13 Feb 2025 19:03:37 -0500 Subject: [PATCH 2/3] Rework to synchronize deps Bypass `nix-eval-job`'s flake, and just call-package it, for fine-grained control. --- flake.nix | 47 +++++++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/flake.nix b/flake.nix index f12b8c2f..5b48879f 100644 --- a/flake.nix +++ b/flake.nix @@ -3,23 +3,35 @@ inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05-small"; - inputs.libgit2 = { url = "github:libgit2/libgit2/v1.8.1"; flake = false; }; - inputs.nix.url = "github:NixOS/nix/2.24-maintenance"; - inputs.nix.inputs.nixpkgs.follows = "nixpkgs"; - inputs.nix.inputs.libgit2.follows = "libgit2"; + inputs.libgit2 = { + url = "github:libgit2/libgit2/v1.8.1"; + flake = false; + }; - inputs.nix-eval-jobs.url = "github:nix-community/nix-eval-jobs/release-2.24"; - inputs.nix-eval-jobs.inputs.nixpkgs.follows = "nixpkgs"; + inputs.nix = { + url = "github:NixOS/nix/2.25-maintenance"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.libgit2.follows = "libgit2"; - # hide nix dev tooling from our lock file - inputs.nix.inputs.flake-parts.follows = ""; - inputs.nix.inputs.git-hooks-nix.follows = ""; - inputs.nix.inputs.nixpkgs-regression.follows = ""; - inputs.nix.inputs.nixpkgs-23-11.follows = ""; - inputs.nix.inputs.flake-compat.follows = ""; + # hide nix dev tooling from our lock file + inputs.flake-parts.follows = ""; + inputs.git-hooks-nix.follows = ""; + inputs.nixpkgs-regression.follows = ""; + inputs.nixpkgs-23-11.follows = ""; + inputs.flake-compat.follows = ""; + }; - # hide nix-eval-jobs dev tooling from our lock file - inputs.nix-eval-jobs.inputs.nix-github-actions.follows = ""; + inputs.nix-eval-jobs = { + url = "github:nix-community/nix-eval-jobs"; + # We want to control the deps precisely + flake = false; + + # Hide nix-eval-jobs dev tooling from our lock file. + # + # TODO why is this needed with `flake = false`? + inputs.nixpkgs.follows = "nixpkgs"; + inputs.nix-github-actions.follows = ""; + }; outputs = { self, nixpkgs, nix, nix-eval-jobs, ... }: let @@ -30,9 +42,9 @@ # A Nixpkgs overlay that provides a 'hydra' package. overlays.default = final: prev: { + nix-eval-jobs = final.callPackage nix-eval-jobs {}; hydra = final.callPackage ./package.nix { inherit (nixpkgs.lib) fileset; - nix-eval-jobs = nix-eval-jobs.packages.${final.system}.default; rawSrc = self; nix-perl-bindings = final.nixComponents.nix-perl-bindings; }; @@ -74,9 +86,12 @@ }); packages = forEachSystem (system: { + nix-eval-jobs = nixpkgs.legacyPackages.${system}.callPackage nix-eval-jobs { + nix = nix.packages.${system}.nix; + }; hydra = nixpkgs.legacyPackages.${system}.callPackage ./package.nix { inherit (nixpkgs.lib) fileset; - nix-eval-jobs = nix-eval-jobs.packages.${system}.default; + inherit (self.packages.${system}) nix-eval-jobs; rawSrc = self; nix = nix.packages.${system}.nix; nix-perl-bindings = nix.hydraJobs.perlBindings.${system}; From 80241fc8bedced8dc0af534284715f7fbbccb197 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 13 Feb 2025 19:10:09 -0500 Subject: [PATCH 3/3] Make code change necessary for building with Nix 2.25 --- src/hydra-queue-runner/builder.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hydra-queue-runner/builder.cc b/src/hydra-queue-runner/builder.cc index a0773511..4bc00f0c 100644 --- a/src/hydra-queue-runner/builder.cc +++ b/src/hydra-queue-runner/builder.cc @@ -178,7 +178,7 @@ State::StepResult State::doBuildStep(nix::ref destStore, unlink(result.logFile.c_str()); } } catch (...) { - ignoreException(); + ignoreExceptionInDestructor(); } } });