From be5b57be1b3554ab554f9d9acd03169a81b14c59 Mon Sep 17 00:00:00 2001 From: Rick van Schijndel Date: Tue, 10 May 2022 21:31:23 +0200 Subject: [PATCH 1/6] hydra-unstable: remove old assertion I don't think nixpkgs will build with nix 1 anyway, so let's just remove this. --- pkgs/development/tools/misc/hydra/common.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkgs/development/tools/misc/hydra/common.nix b/pkgs/development/tools/misc/hydra/common.nix index 2b0775afc373..5f99403218a2 100644 --- a/pkgs/development/tools/misc/hydra/common.nix +++ b/pkgs/development/tools/misc/hydra/common.nix @@ -15,10 +15,6 @@ with stdenv; -if lib.versions.major nix.version == "1" - then throw "This Hydra version doesn't support Nix 1.x" -else - let perlDeps = buildEnv { name = "hydra-perl-deps"; From 33b01d51040d917513d81b42c3d4048a8b0cd9d1 Mon Sep 17 00:00:00 2001 From: Rick van Schijndel Date: Tue, 10 May 2022 21:35:11 +0200 Subject: [PATCH 2/6] hydra-unstable: drop with stdenv from top It doesn't appear to be needed and can make it harder to read the build description. --- pkgs/development/tools/misc/hydra/common.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/development/tools/misc/hydra/common.nix b/pkgs/development/tools/misc/hydra/common.nix index 5f99403218a2..2314f5f9f64f 100644 --- a/pkgs/development/tools/misc/hydra/common.nix +++ b/pkgs/development/tools/misc/hydra/common.nix @@ -13,8 +13,6 @@ , glibcLocales }: -with stdenv; - let perlDeps = buildEnv { name = "hydra-perl-deps"; From 292c63a5d6d107d15b09099a93af8b98c9f90243 Mon Sep 17 00:00:00 2001 From: Rick van Schijndel Date: Tue, 10 May 2022 21:47:01 +0200 Subject: [PATCH 3/6] hydra: remove multi-version support This is a legacy of when a "stable" version of hydra existed, and this probably won't be coming back. This also removes some obsolete bits which have no effect on the result of evaluation. Unlike the original approach in #157072, we're moving the common expression to "unstable.nix" instead. This allow putting everything in one commit, satisfies git's rename detection, and remains bisectable. Co-Authored-By: Bernardo Meurer Co-Authored-By: Linus Heckemann --- pkgs/development/tools/misc/hydra/default.nix | 26 -------------- .../misc/hydra/{common.nix => unstable.nix} | 34 +++++++++++++++---- pkgs/top-level/all-packages.nix | 3 +- 3 files changed, 29 insertions(+), 34 deletions(-) delete mode 100644 pkgs/development/tools/misc/hydra/default.nix rename pkgs/development/tools/misc/hydra/{common.nix => unstable.nix} (84%) diff --git a/pkgs/development/tools/misc/hydra/default.nix b/pkgs/development/tools/misc/hydra/default.nix deleted file mode 100644 index 5289015d43b2..000000000000 --- a/pkgs/development/tools/misc/hydra/default.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ lib, fetchFromGitHub, callPackage, nixVersions, nixosTests, fetchpatch }: - -{ - hydra-unstable = callPackage ./common.nix { - version = "2022-02-07"; - src = fetchFromGitHub { - owner = "NixOS"; - repo = "hydra"; - rev = "517dce285a851efd732affc084c7083aed2e98cd"; - sha256 = "sha256-abWhd/VLNse3Gz7gcVbFANJLAhHV4nbOKjhVDmq/Zmg="; - }; - 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/common.nix b/pkgs/development/tools/misc/hydra/unstable.nix similarity index 84% rename from pkgs/development/tools/misc/hydra/common.nix rename to pkgs/development/tools/misc/hydra/unstable.nix index 2314f5f9f64f..7d3521702a79 100644 --- a/pkgs/development/tools/misc/hydra/common.nix +++ b/pkgs/development/tools/misc/hydra/unstable.nix @@ -1,16 +1,20 @@ -{ stdenv, nix, perlPackages, buildEnv +{ stdenv +, lib +, nix, perlPackages, buildEnv , makeWrapper, autoconf, automake, libtool, unzip, pkg-config, sqlite, libpqxx_6 , top-git, mercurial, darcs, subversion, breezy, openssl, bzip2, libxslt , perl, postgresql, nukeReferences, git, boehmgc, nlohmann_json , docbook_xsl, openssh, gnused, coreutils, findutils, gzip, xz, gnutar -, rpm, dpkg, cdrkit, pixz, lib, boost, autoreconfHook, src ? null, version ? null -, migration ? false, patches ? [] -, tests ? {}, mdbook +, rpm, dpkg, cdrkit, pixz, boost, autoreconfHook +, mdbook , foreman , python3 , libressl , cacert , glibcLocales +, fetchFromGitHub +, fetchpatch +, nixosTests }: let @@ -88,8 +92,14 @@ let }; in stdenv.mkDerivation rec { pname = "hydra"; + version = "2022-02-07"; - inherit stdenv src version patches; + src = fetchFromGitHub { + owner = "NixOS"; + repo = "hydra"; + rev = "517dce285a851efd732affc084c7083aed2e98cd"; + sha256 = "sha256-abWhd/VLNse3Gz7gcVbFANJLAhHV4nbOKjhVDmq/Zmg="; + }; buildInputs = [ makeWrapper libtool unzip nukeReferences sqlite libpqxx_6 @@ -116,6 +126,15 @@ in stdenv.mkDerivation rec { libressl.nc ]; + patches = [ + ./eval.patch + ./missing-std-string.patch + (fetchpatch { + url = "https://github.com/NixOS/hydra/commit/5ae26aa7604f714dcc73edcb74fe71ddc8957f6c.patch"; + sha256 = "sha256-wkbWo8SFbT3qwVxwkKQWpQT5Jgb1Bb51yiLTlFdDN/I="; + }) + ]; + configureFlags = [ "--with-docbook-xsl=${docbook_xsl}/xml/xsl/docbook" ]; NIX_CFLAGS_COMPILE = "-pthread"; @@ -152,7 +171,10 @@ in stdenv.mkDerivation rec { doCheck = true; - passthru = { inherit perlDeps migration tests; }; + passthru = { + inherit perlDeps; + tests.basic = nixosTests.hydra.hydra-unstable; + }; meta = with lib; { description = "Nix-based continuous build system"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8f432f8e4383..e98ae93e1fc5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17830,8 +17830,7 @@ with pkgs; hwloc = callPackage ../development/libraries/hwloc {}; - inherit (callPackage ../development/tools/misc/hydra { }) - hydra-unstable; + hydra-unstable = callPackage ../development/tools/misc/hydra/unstable.nix { nix = nixVersions.nix_2_6; }; hydra-cli = callPackage ../development/tools/misc/hydra-cli { }; From 3a7f7c1153ba73f21abf761f054aecd8f093f517 Mon Sep 17 00:00:00 2001 From: Rick van Schijndel Date: Tue, 10 May 2022 21:52:13 +0200 Subject: [PATCH 4/6] hydra-unstable -> hydra_unstable --- maintainers/scripts/haskell/hydra-report.hs | 2 +- .../modules/services/continuous-integration/hydra/default.nix | 4 ++-- nixos/tests/hydra/default.nix | 2 +- pkgs/development/tools/misc/hydra/unstable.nix | 2 +- pkgs/top-level/aliases.nix | 3 ++- pkgs/top-level/all-packages.nix | 2 +- pkgs/top-level/release-haskell.nix | 2 +- 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/maintainers/scripts/haskell/hydra-report.hs b/maintainers/scripts/haskell/hydra-report.hs index 360b9f2058de..6f154d90f06f 100755 --- a/maintainers/scripts/haskell/hydra-report.hs +++ b/maintainers/scripts/haskell/hydra-report.hs @@ -1,6 +1,6 @@ #! /usr/bin/env nix-shell #! nix-shell -p "haskellPackages.ghcWithPackages (p: [p.aeson p.req])" -#! nix-shell -p hydra-unstable +#! nix-shell -p hydra_unstable #! nix-shell -i runhaskell {- diff --git a/nixos/modules/services/continuous-integration/hydra/default.nix b/nixos/modules/services/continuous-integration/hydra/default.nix index 90adab7fbf2e..9440382e66a1 100644 --- a/nixos/modules/services/continuous-integration/hydra/default.nix +++ b/nixos/modules/services/continuous-integration/hydra/default.nix @@ -99,8 +99,8 @@ in package = mkOption { type = types.package; - default = pkgs.hydra-unstable; - defaultText = literalExpression "pkgs.hydra-unstable"; + default = pkgs.hydra_unstable; + defaultText = literalExpression "pkgs.hydra_unstable"; description = "The Hydra package."; }; diff --git a/nixos/tests/hydra/default.nix b/nixos/tests/hydra/default.nix index 9fc787842d85..baf18afbc569 100644 --- a/nixos/tests/hydra/default.nix +++ b/nixos/tests/hydra/default.nix @@ -11,7 +11,7 @@ let inherit (import ./common.nix { inherit system; }) baseConfig; hydraPkgs = { - inherit (pkgs) hydra-unstable; + inherit (pkgs) hydra_unstable; }; makeHydraTest = with pkgs.lib; name: package: makeTest { diff --git a/pkgs/development/tools/misc/hydra/unstable.nix b/pkgs/development/tools/misc/hydra/unstable.nix index 7d3521702a79..e375a26b7373 100644 --- a/pkgs/development/tools/misc/hydra/unstable.nix +++ b/pkgs/development/tools/misc/hydra/unstable.nix @@ -173,7 +173,7 @@ in stdenv.mkDerivation rec { passthru = { inherit perlDeps; - tests.basic = nixosTests.hydra.hydra-unstable; + tests.basic = nixosTests.hydra.hydra_unstable; }; meta = with lib; { diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 31e4fa422508..c59baccc5024 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -549,7 +549,8 @@ mapAliases ({ holochain-go = throw "holochain-go was abandoned by upstream"; # Added 2022-01-01 htmlTidy = throw "'htmlTidy' has been renamed to/replaced by 'html-tidy'"; # Converted to throw 2022-02-22 ht-rust = xh; # Added 2021-02-13 - hydra-flakes = throw "hydra-flakes: Flakes support has been merged into Hydra's master. Please use `hydra-unstable` now"; # Added 2020-04-06 + hydra-flakes = throw "hydra-flakes: Flakes support has been merged into Hydra's master. Please use `hydra_unstable` now"; # Added 2020-04-06 + hydra-unstable = hydra_unstable; # added 2022-05-10 ### I ### diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e98ae93e1fc5..8e5503a43bbc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17830,7 +17830,7 @@ with pkgs; hwloc = callPackage ../development/libraries/hwloc {}; - hydra-unstable = callPackage ../development/tools/misc/hydra/unstable.nix { nix = nixVersions.nix_2_6; }; + hydra_unstable = callPackage ../development/tools/misc/hydra/unstable.nix { nix = nixVersions.nix_2_6; }; hydra-cli = callPackage ../development/tools/misc/hydra-cli { }; diff --git a/pkgs/top-level/release-haskell.nix b/pkgs/top-level/release-haskell.nix index a1e72c90bea4..21c54975a283 100644 --- a/pkgs/top-level/release-haskell.nix +++ b/pkgs/top-level/release-haskell.nix @@ -4,7 +4,7 @@ https://hydra.nixos.org/jobset/nixpkgs/haskell-updates. To debug this expression you can use `hydra-eval-jobs` from - `pkgs.hydra-unstable` which prints the jobset description + `pkgs.hydra_unstable` which prints the jobset description to `stdout`: $ hydra-eval-jobs -I . pkgs/top-level/release-haskell.nix From 189a38576e13b61589deb3ebb8f3dc6db2890ff1 Mon Sep 17 00:00:00 2001 From: Rick van Schijndel Date: Tue, 10 May 2022 21:54:07 +0200 Subject: [PATCH 5/6] hydra_unstable: apply nixpkgs-fmt --- .../development/tools/misc/hydra/unstable.nix | 95 ++++++++++++++++--- 1 file changed, 81 insertions(+), 14 deletions(-) diff --git a/pkgs/development/tools/misc/hydra/unstable.nix b/pkgs/development/tools/misc/hydra/unstable.nix index e375a26b7373..36de9f886c19 100644 --- a/pkgs/development/tools/misc/hydra/unstable.nix +++ b/pkgs/development/tools/misc/hydra/unstable.nix @@ -1,11 +1,44 @@ { stdenv , lib -, nix, perlPackages, buildEnv -, makeWrapper, autoconf, automake, libtool, unzip, pkg-config, sqlite, libpqxx_6 -, top-git, mercurial, darcs, subversion, breezy, openssl, bzip2, libxslt -, perl, postgresql, nukeReferences, git, boehmgc, nlohmann_json -, docbook_xsl, openssh, gnused, coreutils, findutils, gzip, xz, gnutar -, rpm, dpkg, cdrkit, pixz, boost, autoreconfHook +, nix +, perlPackages +, buildEnv +, makeWrapper +, autoconf +, automake +, libtool +, unzip +, pkg-config +, sqlite +, libpqxx_6 +, top-git +, mercurial +, darcs +, subversion +, breezy +, openssl +, bzip2 +, libxslt +, perl +, postgresql +, nukeReferences +, git +, boehmgc +, nlohmann_json +, docbook_xsl +, openssh +, gnused +, coreutils +, findutils +, gzip +, xz +, gnutar +, rpm +, dpkg +, cdrkit +, pixz +, boost +, autoreconfHook , mdbook , foreman , python3 @@ -21,7 +54,8 @@ let perlDeps = buildEnv { name = "hydra-perl-deps"; paths = with perlPackages; lib.closePropagation - [ ModulePluggable + [ + ModulePluggable AuthenSASL CatalystActionREST CatalystAuthenticationStoreDBIxClass @@ -90,7 +124,8 @@ let git ]; }; -in stdenv.mkDerivation rec { +in +stdenv.mkDerivation rec { pname = "hydra"; version = "2022-02-07"; @@ -102,9 +137,24 @@ in stdenv.mkDerivation rec { }; buildInputs = - [ makeWrapper libtool unzip nukeReferences sqlite libpqxx_6 - top-git mercurial darcs subversion breezy openssl bzip2 libxslt - perlDeps perl nix + [ + makeWrapper + libtool + unzip + nukeReferences + sqlite + libpqxx_6 + top-git + mercurial + darcs + subversion + breezy + openssl + bzip2 + libxslt + perlDeps + perl + nix postgresql # for running the tests nlohmann_json boost @@ -112,9 +162,26 @@ in stdenv.mkDerivation rec { ]; hydraPath = lib.makeBinPath ( - [ sqlite subversion openssh nix coreutils findutils pixz - gzip bzip2 xz gnutar unzip git top-git mercurial /*darcs*/ gnused breezy - ] ++ lib.optionals stdenv.isLinux [ rpm dpkg cdrkit ] ); + [ + sqlite + subversion + openssh + nix + coreutils + findutils + pixz + gzip + bzip2 + xz + gnutar + unzip + git + top-git + mercurial /*darcs*/ + gnused + breezy + ] ++ lib.optionals stdenv.isLinux [ rpm dpkg cdrkit ] + ); nativeBuildInputs = [ autoreconfHook pkg-config mdbook autoconf automake ]; From d03354ab859fe190bd1916553cf5af69d7619bb6 Mon Sep 17 00:00:00 2001 From: Rick van Schijndel Date: Fri, 13 May 2022 07:19:28 +0200 Subject: [PATCH 6/6] UUID4-Tiny: add potential patch for aarch64 Hopefully ofborg can confirm or deny this works... --- pkgs/top-level/perl-packages.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index 3c1557f52ca6..44b3e1896113 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -24497,6 +24497,12 @@ let url = "mirror://cpan/authors/id/C/CV/CVLIBRARY/UUID4-Tiny-0.002.tar.gz"; sha256 = "e7535b31e386d432dec7adde214348389e1d5cf753e7ed07f1ae04c4360840cf"; }; + postPatch = lib.optionalString (stdenv.isAarch64) '' + # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/asm-generic/unistd.h + # printf SYS_getrandom | gcc -include sys/syscall.h -E - + substituteInPlace lib/UUID4/Tiny.pm \ + --replace "syscall( 318" "syscall( 278" + ''; meta = { description = "Cryptographically secure v4 UUIDs for Linux x64"; license = with lib.licenses; [ artistic1 gpl1Plus ];