diff --git a/pkgs/development/tools/misc/hydra/common.nix b/pkgs/development/tools/misc/hydra/common.nix index f9d7a8156e1..affeb75d198 100644 --- a/pkgs/development/tools/misc/hydra/common.nix +++ b/pkgs/development/tools/misc/hydra/common.nix @@ -6,6 +6,11 @@ , rpm, dpkg, cdrkit, pixz, lib, boost, autoreconfHook, src ? null, version ? null , migration ? false, patches ? [] , tests ? {}, mdbook +, foreman +, python3 +, libressl +, cacert +, glibcLocales }: with stdenv; @@ -19,19 +24,19 @@ let name = "hydra-perl-deps"; paths = with perlPackages; lib.closePropagation [ ModulePluggable + AuthenSASL CatalystActionREST CatalystAuthenticationStoreDBIxClass + CatalystAuthenticationStoreLDAP CatalystDevel - CatalystDispatchTypeRegex CatalystPluginAccessLog CatalystPluginAuthorizationRoles CatalystPluginCaptcha CatalystPluginPrometheusTiny CatalystPluginSessionStateCookie CatalystPluginSessionStoreFastMmap - CatalystPluginSmartURI CatalystPluginStackTrace - CatalystRuntime + CatalystPluginUnicodeEncoding CatalystTraitForRequestProxyBase CatalystViewDownload CatalystViewJSON @@ -48,34 +53,44 @@ let DigestSHA1 EmailMIME EmailSender - FileSlurp + FileSlurper + FileWhich IOCompress IPCRun + IPCRun3 JSON - JSONAny + JSONMaybeXS JSONXS + ListSomeUtils LWP LWPProtocolHttps + ModulePluggable NetAmazonS3 NetPrometheus NetStatsd PadWalker + ParallelForkManager + PerlCriticCommunity PrometheusTinyShared - Readonly + ReadonlyX SQLSplitStatement SetScalar Starman StringCompareConstantTime SysHostnameLong TermSizeAny + TermReadKey + Test2Harness + TestMore + TestPostgreSQL TextDiff TextTable + UUID4Tiny XMLSimple YAML nix nix.perl-bindings git - boehmgc ]; }; in stdenv.mkDerivation rec { @@ -85,11 +100,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 +115,14 @@ in stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook pkg-config mdbook autoconf automake ]; + checkInputs = [ + cacert + foreman + glibcLocales + python3 + libressl.nc + ]; + configureFlags = [ "--with-docbook-xsl=${docbook_xsl}/xml/xsl/docbook" ]; NIX_CFLAGS_COMPILE = "-pthread"; @@ -113,6 +137,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 = '' @@ -123,20 +149,22 @@ in stdenv.mkDerivation rec { wrapProgram $i \ --prefix PERL5LIB ':' $out/libexec/hydra/lib:$PERL5LIB \ --prefix PATH ':' $out/bin:$hydraPath \ - --set HYDRA_RELEASE ${version} \ + --set-default HYDRA_RELEASE ${version} \ --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..5289015d43b 100644 --- a/pkgs/development/tools/misc/hydra/default.nix +++ b/pkgs/development/tools/misc/hydra/default.nix @@ -1,16 +1,23 @@ -{ fetchFromGitHub, callPackage, nixVersions, nixosTests }: +{ lib, fetchFromGitHub, callPackage, nixVersions, nixosTests, fetchpatch }: { hydra-unstable = callPackage ./common.nix { - version = "2021-08-11"; + version = "2022-02-07"; src = fetchFromGitHub { owner = "NixOS"; repo = "hydra"; - rev = "9bce425c3304173548d8e822029644bb51d35263"; - sha256 = "sha256-tGzwKNW/odtAYcazWA9bPVSmVXMGKfXsqCA1UYaaxmU="; + rev = "517dce285a851efd732affc084c7083aed2e98cd"; + sha256 = "sha256-abWhd/VLNse3Gz7gcVbFANJLAhHV4nbOKjhVDmq/Zmg="; }; - patches = [ ./eval.patch ]; - nix = nixVersions.unstable; + patches = [ + ./eval.patch + ./missing-std-string.patch + (fetchpatch { + url = "https://github.com/NixOS/hydra/commit/5ae26aa7604f714dcc73edcb74fe71ddc8957f6c.patch"; + sha256 = "sha256-wkbWo8SFbT3qwVxwkKQWpQT5Jgb1Bb51yiLTlFdDN/I="; + }) + ]; + nix = nixVersions.nix_2_6; 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 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(contents, "\n")) { +- line = trim(string(line, 0, line.find('#'))); ++ line = trim(std::string(line, 0, line.find('#'))); + auto tokens = tokenizeString>(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(string(s, lower_prefix.size()), ";")); ++ return concatStringsSep(" ", tokenizeString(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(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 adf03ae7271..3c1557f52ca 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -19069,6 +19069,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"; @@ -24475,6 +24490,19 @@ let }; }; + UUID4Tiny = buildPerlPackage { + pname = "UUID4-Tiny"; + version = "0.002"; + src = fetchurl { + url = "mirror://cpan/authors/id/C/CV/CVLIBRARY/UUID4-Tiny-0.002.tar.gz"; + sha256 = "e7535b31e386d432dec7adde214348389e1d5cf753e7ed07f1ae04c4360840cf"; + }; + meta = { + description = "Cryptographically secure v4 UUIDs for Linux x64"; + license = with lib.licenses; [ artistic1 gpl1Plus ]; + }; + }; + UUIDTiny = buildPerlPackage { pname = "UUID-Tiny"; version = "1.04";