summary refs log tree commit diff
diff options
context:
space:
mode:
authorRick van Schijndel <rol3517@gmail.com>2022-05-06 08:13:00 +0200
committerRick van Schijndel <rol3517@gmail.com>2022-05-09 22:18:50 +0200
commit2e882e09033b481a8f4531c30cfab7fc855c3909 (patch)
treeedae693e556799887bf5cc7988def8ee2ac7481e
parent5cdfc935fa8d37297743af925091e5c7555414c9 (diff)
downloadnixpkgs-2e882e09033b481a8f4531c30cfab7fc855c3909.tar
nixpkgs-2e882e09033b481a8f4531c30cfab7fc855c3909.tar.gz
nixpkgs-2e882e09033b481a8f4531c30cfab7fc855c3909.tar.bz2
nixpkgs-2e882e09033b481a8f4531c30cfab7fc855c3909.tar.lz
nixpkgs-2e882e09033b481a8f4531c30cfab7fc855c3909.tar.xz
nixpkgs-2e882e09033b481a8f4531c30cfab7fc855c3909.tar.zst
nixpkgs-2e882e09033b481a8f4531c30cfab7fc855c3909.zip
hydra-unstable: 2021-08-11 -> 2021-12-17
Adds some new required deps too.
Enable doCheck (tests).

Apply patch for missing std:: specifier before std::strings.
-rw-r--r--pkgs/development/tools/misc/hydra/common.nix32
-rw-r--r--pkgs/development/tools/misc/hydra/default.nix13
-rw-r--r--pkgs/development/tools/misc/hydra/missing-std-string.patch61
-rw-r--r--pkgs/top-level/perl-packages.nix15
4 files changed, 110 insertions, 11 deletions
diff --git a/pkgs/development/tools/misc/hydra/common.nix b/pkgs/development/tools/misc/hydra/common.nix
index f9d7a8156e1..c6bc9c60e3a 100644
--- a/pkgs/development/tools/misc/hydra/common.nix
+++ b/pkgs/development/tools/misc/hydra/common.nix
@@ -6,6 +6,9 @@
 , rpm, dpkg, cdrkit, pixz, lib, boost, autoreconfHook, src ? null, version ? null
 , migration ? false, patches ? []
 , tests ? {}, mdbook
+, foreman
+, python3
+, libressl
 }:
 
 with stdenv;
@@ -48,26 +51,32 @@ let
         DigestSHA1
         EmailMIME
         EmailSender
-        FileSlurp
+        FileSlurper
         IOCompress
         IPCRun
         JSON
-        JSONAny
+        JSONMaybeXS
         JSONXS
+        ListSomeUtils
         LWP
         LWPProtocolHttps
+        ModulePluggable
         NetAmazonS3
         NetPrometheus
         NetStatsd
         PadWalker
+        ParallelForkManager
+        PerlCriticCommunity
         PrometheusTinyShared
-        Readonly
+        ReadonlyX
         SQLSplitStatement
         SetScalar
         Starman
         StringCompareConstantTime
         SysHostnameLong
         TermSizeAny
+        Test2Harness
+        TestPostgreSQL
         TextDiff
         TextTable
         XMLSimple
@@ -85,11 +94,12 @@ in stdenv.mkDerivation rec {
 
   buildInputs =
     [ makeWrapper libtool unzip nukeReferences sqlite libpqxx_6
-      top-git mercurial /*darcs*/ subversion breezy openssl bzip2 libxslt
+      top-git mercurial darcs subversion breezy openssl bzip2 libxslt
       perlDeps perl nix
       postgresql # for running the tests
       nlohmann_json
       boost
+      pixz
     ];
 
   hydraPath = lib.makeBinPath (
@@ -99,6 +109,12 @@ in stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ autoreconfHook pkg-config mdbook autoconf automake ];
 
+  checkInputs = [
+    foreman
+    python3
+    libressl.nc
+  ];
+
   configureFlags = [ "--with-docbook-xsl=${docbook_xsl}/xml/xsl/docbook" ];
 
   NIX_CFLAGS_COMPILE = "-pthread";
@@ -113,6 +129,8 @@ in stdenv.mkDerivation rec {
   preCheck = ''
     patchShebangs .
     export LOGNAME=''${LOGNAME:-foo}
+    # set $HOME for bzr so it can create its trace file
+    export HOME=$(mktemp -d)
   '';
 
   postInstall = ''
@@ -127,16 +145,18 @@ in stdenv.mkDerivation rec {
             --set HYDRA_HOME $out/libexec/hydra \
             --set NIX_RELEASE ${nix.name or "unknown"}
     done
-  ''; # */
+  '';
 
   dontStrip = true;
 
+  doCheck = true;
+
   passthru = { inherit perlDeps migration tests; };
 
   meta = with lib; {
     description = "Nix-based continuous build system";
     license = licenses.gpl3;
     platforms = platforms.linux;
-    maintainers = with maintainers; [ ];
+    maintainers = with maintainers; [ lheckemann mindavi das_j ];
   };
 }
diff --git a/pkgs/development/tools/misc/hydra/default.nix b/pkgs/development/tools/misc/hydra/default.nix
index 27ff31dae96..f0ae50a0dec 100644
--- a/pkgs/development/tools/misc/hydra/default.nix
+++ b/pkgs/development/tools/misc/hydra/default.nix
@@ -2,15 +2,18 @@
 
 {
   hydra-unstable = callPackage ./common.nix {
-    version = "2021-08-11";
+    version = "2021-12-17";
     src = fetchFromGitHub {
       owner = "NixOS";
       repo = "hydra";
-      rev = "9bce425c3304173548d8e822029644bb51d35263";
-      sha256 = "sha256-tGzwKNW/odtAYcazWA9bPVSmVXMGKfXsqCA1UYaaxmU=";
+      rev = "e1e5fafdff63c1e1595d2edb8c9854710211a0d7";
+      sha256 = "sha256-JPkw3heasqX9iWju7BWjKDsyoS+HmLIKM2ibwHq5+Ko=";
     };
-    patches = [ ./eval.patch ];
-    nix = nixVersions.unstable;
+    patches = [
+      ./eval.patch
+      ./missing-std-string.patch
+    ];
+    nix = nixVersions.nix_2_4;
 
     tests = {
       basic = nixosTests.hydra.hydra-unstable;
diff --git a/pkgs/development/tools/misc/hydra/missing-std-string.patch b/pkgs/development/tools/misc/hydra/missing-std-string.patch
new file mode 100644
index 00000000000..2010b4cf178
--- /dev/null
+++ b/pkgs/development/tools/misc/hydra/missing-std-string.patch
@@ -0,0 +1,61 @@
+diff --git a/src/hydra-eval-jobs/hydra-eval-jobs.cc b/src/hydra-eval-jobs/hydra-eval-jobs.cc
+index acffe1d..53f2630 100644
+--- a/src/hydra-eval-jobs/hydra-eval-jobs.cc
++++ b/src/hydra-eval-jobs/hydra-eval-jobs.cc
+@@ -63,7 +63,7 @@ struct MyArgs : MixEvalArgs, MixCommonArgs
+ 
+ static MyArgs myArgs;
+ 
+-static std::string queryMetaStrings(EvalState & state, DrvInfo & drv, const string & name, const string & subAttribute)
++static std::string queryMetaStrings(EvalState & state, DrvInfo & drv, const std::string & name, const std::string & subAttribute)
+ {
+     Strings res;
+     std::function<void(Value & v)> rec;
+@@ -186,7 +186,7 @@ static void worker(
+                     for (auto & i : context)
+                         if (i.at(0) == '!') {
+                             size_t index = i.find("!", 1);
+-                            job["constituents"].push_back(string(i, index + 1));
++                            job["constituents"].push_back(std::string(i, index + 1));
+                         }
+ 
+                     state.forceList(*a->value, *a->pos);
+diff --git a/src/hydra-queue-runner/hydra-queue-runner.cc b/src/hydra-queue-runner/hydra-queue-runner.cc
+index 62eb572..a957bef 100644
+--- a/src/hydra-queue-runner/hydra-queue-runner.cc
++++ b/src/hydra-queue-runner/hydra-queue-runner.cc
+@@ -87,7 +87,7 @@ void State::parseMachines(const std::string & contents)
+     }
+ 
+     for (auto line : tokenizeString<Strings>(contents, "\n")) {
+-        line = trim(string(line, 0, line.find('#')));
++        line = trim(std::string(line, 0, line.find('#')));
+         auto tokens = tokenizeString<std::vector<std::string>>(line);
+         if (tokens.size() < 3) continue;
+         tokens.resize(8);
+diff --git a/src/libhydra/db.hh b/src/libhydra/db.hh
+index 7d5bdc5..00e8f40 100644
+--- a/src/libhydra/db.hh
++++ b/src/libhydra/db.hh
+@@ -18,7 +18,7 @@ struct Connection : pqxx::connection
+         std::string upper_prefix = "DBI:Pg:";
+ 
+         if (hasPrefix(s, lower_prefix) || hasPrefix(s, upper_prefix)) {
+-            return concatStringsSep(" ", tokenizeString<Strings>(string(s, lower_prefix.size()), ";"));
++            return concatStringsSep(" ", tokenizeString<Strings>(std::string(s, lower_prefix.size()), ";"));
+         }
+ 
+         throw Error("$HYDRA_DBI does not denote a PostgreSQL database");
+diff --git a/src/libhydra/hydra-config.hh b/src/libhydra/hydra-config.hh
+index bc989f7..1688c27 100644
+--- a/src/libhydra/hydra-config.hh
++++ b/src/libhydra/hydra-config.hh
+@@ -17,7 +17,7 @@ struct HydraConfig
+         if (hydraConfigFile && pathExists(*hydraConfigFile)) {
+ 
+             for (auto line : tokenizeString<Strings>(readFile(*hydraConfigFile), "\n")) {
+-                line = trim(string(line, 0, line.find('#')));
++                line = trim(std::string(line, 0, line.find('#')));
+ 
+                 auto eq = line.find('=');
+                 if (eq == std::string::npos) continue;
diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix
index 72568265a82..b834447e585 100644
--- a/pkgs/top-level/perl-packages.nix
+++ b/pkgs/top-level/perl-packages.nix
@@ -19055,6 +19055,21 @@ let
     };
   };
 
+  ReadonlyX = buildPerlModule {
+    pname = "ReadonlyX";
+    version = "1.04";
+    src = fetchurl {
+      url = "mirror://cpan/authors/id/S/SA/SANKO/ReadonlyX-1.04.tar.gz";
+      sha256 = "81bb97dba93ac6b5ccbce04a42c3590eb04557d75018773ee18d5a30fcf48188";
+    };
+    buildInputs = [ ModuleBuildTiny TestFatal ];
+    meta = {
+      homepage = "https://github.com/sanko/readonly";
+      description = "Faster facility for creating read-only scalars, arrays, hashes";
+      license = lib.licenses.artistic2;
+    };
+  };
+
   ReadonlyXS = buildPerlPackage {
     pname = "Readonly-XS";
     version = "1.05";