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

packaging: Make hydraJobs.build.* complete

(cherry picked from commit d6139a339b)
This commit is contained in:
Robert Hensing 2025-02-27 17:48:28 +01:00 committed by Mergify
parent 86271c364d
commit 12f77a2fb9

View file

@ -29,32 +29,86 @@ 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.
"nix-everything" forAllPackages = forAllPackages' { };
"nix-util" forAllPackages' =
"nix-util-c" {
"nix-util-test-support" enableBindings ? false,
"nix-util-tests" enableDocs ? false, # already have separate attrs for these
"nix-store" }:
"nix-store-c" lib.genAttrs (
"nix-store-test-support" [
"nix-store-tests" "nix-everything"
"nix-fetchers" "nix-util"
"nix-fetchers-tests" "nix-util-c"
"nix-expr" "nix-util-test-support"
"nix-expr-c" "nix-util-tests"
"nix-expr-test-support" "nix-store"
"nix-expr-tests" "nix-store-c"
"nix-flake" "nix-store-test-support"
"nix-flake-tests" "nix-store-tests"
"nix-main" "nix-fetchers"
"nix-main-c" "nix-fetchers-tests"
"nix-cmd" "nix-expr"
"nix-cli" "nix-expr-c"
"nix-functional-tests" "nix-expr-test-support"
]; "nix-expr-tests"
"nix-flake"
"nix-flake-c"
"nix-flake-tests"
"nix-main"
"nix-main-c"
"nix-cmd"
"nix-cli"
"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})