From 596f4cf4b9832e90c8f4e5fb07c5e8046126d3ca Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 14 Jun 2020 00:37:41 +0800 Subject: [PATCH] nixbld: unbreak hydra sysbuild --- nixbld-etc-nixos/configuration.nix | 2 +- nixbld-etc-nixos/hydra-unbreak-sysbuild.patch | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 nixbld-etc-nixos/hydra-unbreak-sysbuild.patch diff --git a/nixbld-etc-nixos/configuration.nix b/nixbld-etc-nixos/configuration.nix index 68a9aac..3249466 100644 --- a/nixbld-etc-nixos/configuration.nix +++ b/nixbld-etc-nixos/configuration.nix @@ -378,7 +378,7 @@ in nixpkgs.config.packageOverrides = super: let self = super.pkgs; in { firmwareLinuxNonfree = super.callPackage ./firmware-linux-nonfree.nix {}; hydra-unstable = super.hydra-unstable.overrideAttrs(oa: { - patches = oa.patches or [] ++ [ ./hydra-conda.patch ./hydra-retry.patch ]; + patches = oa.patches or [] ++ [ ./hydra-conda.patch ./hydra-retry.patch ./hydra-unbreak-sysbuild.patch ]; hydraPath = oa.hydraPath + ":" + super.lib.makeBinPath [ super.jq ]; }); matterbridge = super.matterbridge.overrideAttrs(oa: { diff --git a/nixbld-etc-nixos/hydra-unbreak-sysbuild.patch b/nixbld-etc-nixos/hydra-unbreak-sysbuild.patch new file mode 100644 index 0000000..31a96b7 --- /dev/null +++ b/nixbld-etc-nixos/hydra-unbreak-sysbuild.patch @@ -0,0 +1,25 @@ +diff --git a/src/lib/Hydra/Schema/Builds.pm b/src/lib/Hydra/Schema/Builds.pm +index d4334300..014d07ce 100644 +--- a/src/lib/Hydra/Schema/Builds.pm ++++ b/src/lib/Hydra/Schema/Builds.pm +@@ -608,6 +608,7 @@ makeQueries('', ""); + makeQueries('ForProject', "and project = ?"); + makeQueries('ForJobset', "and jobset_id = ?"); + makeQueries('ForJob', "and jobset_id = ? and job = ?"); ++makeQueries('ForJobName', "and jobset_id = (select id from jobsets j where j.name = ?) and job = ?"); + + + my %hint = ( +diff --git a/src/script/hydra-eval-jobset b/src/script/hydra-eval-jobset +index ea336bfc..2f208418 100755 +--- a/src/script/hydra-eval-jobset ++++ b/src/script/hydra-eval-jobset +@@ -142,7 +142,7 @@ sub fetchInputSystemBuild { + $projectName ||= $project->name; + $jobsetName ||= $jobset->name; + +- my @latestBuilds = $db->resultset('LatestSucceededForJob') ++ my @latestBuilds = $db->resultset('LatestSucceededForJobName') + ->search({}, {bind => [$jobsetName, $jobName]}); + + my @validBuilds = ();