1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +02:00

packaging: Make hydraJobs.build.* complete

This commit is contained in:
Robert Hensing 2025-02-27 17:48:28 +01:00
parent 1293388039
commit d6139a339b

View file

@ -29,7 +29,15 @@ let
# Technically we could just return `pkgs.nixComponents`, but for Hydra it's # Technically we could just return `pkgs.nixComponents`, but for Hydra it's
# convention to transpose it, and to transpose it efficiently, we need to # convention to transpose it, and to transpose it efficiently, we need to
# enumerate them manually, so that we don't evaluate unnecessary package sets. # enumerate them manually, so that we don't evaluate unnecessary package sets.
forAllPackages = lib.genAttrs [ # See listingIsComplete below.
forAllPackages = forAllPackages' { };
forAllPackages' =
{
enableBindings ? false,
enableDocs ? false, # already have separate attrs for these
}:
lib.genAttrs (
[
"nix-everything" "nix-everything"
"nix-util" "nix-util"
"nix-util-c" "nix-util-c"
@ -46,15 +54,61 @@ let
"nix-expr-test-support" "nix-expr-test-support"
"nix-expr-tests" "nix-expr-tests"
"nix-flake" "nix-flake"
"nix-flake-c"
"nix-flake-tests" "nix-flake-tests"
"nix-main" "nix-main"
"nix-main-c" "nix-main-c"
"nix-cmd" "nix-cmd"
"nix-cli" "nix-cli"
"nix-functional-tests" "nix-functional-tests"
]; ]
++ lib.optionals enableBindings [
"nix-perl-bindings"
]
++ lib.optionals enableDocs [
"nix-manual"
"nix-internal-api-docs"
"nix-external-api-docs"
]
);
in in
{ {
/**
An internal check to make sure our package listing is complete.
*/
listingIsComplete =
let
arbitrarySystem = "x86_64-linux";
listedPkgs = forAllPackages' {
enableBindings = true;
enableDocs = true;
} (_: null);
actualPkgs = lib.concatMapAttrs (
k: v: if lib.strings.hasPrefix "nix-" k then { ${k} = null; } else { }
) nixpkgsFor.${arbitrarySystem}.native.nixComponents;
diff = lib.concatStringsSep "\n" (
lib.concatLists (
lib.mapAttrsToList (
k: _:
if (listedPkgs ? ${k}) && !(actualPkgs ? ${k}) then
[ "- ${k}: redundant?" ]
else if !(listedPkgs ? ${k}) && (actualPkgs ? ${k}) then
[ "- ${k}: missing?" ]
else
[ ]
) (listedPkgs // actualPkgs)
)
);
in
if listedPkgs == actualPkgs then
{ }
else
throw ''
Please update the components list in hydra.nix (or fix this check)
Differences:
${diff}
'';
# Binary package for various platforms. # Binary package for various platforms.
build = forAllPackages ( build = forAllPackages (
pkgName: forAllSystems (system: nixpkgsFor.${system}.native.nixComponents.${pkgName}) pkgName: forAllSystems (system: nixpkgsFor.${system}.native.nixComponents.${pkgName})