Files
nixpkgs/maintainers/scripts/haskell/transitive-broken-packages.nix
sternenseemann 21df8c56b8 maintainers/haskell: record pnames, not attr names to transitive broken
The attribute names in haskellPackages no longer match the Hackage package
names in all cases (which hackage2nix uses to match its config files against
packages), but the pnames do, so let's use those here.

To prevent accidentally disabling a package because a versioned package
depends on a broken one, we need to filter out all versioned attributes
as well. This doesn't change anything since they already have empty
hydraPlatforms.
2026-02-08 12:15:50 +01:00

23 lines
625 B
Nix

let
nixpkgs = import ../../..;
inherit (nixpkgs { }) pkgs lib;
isVersioned = attr: builtins.match "[A-Za-z0-9-]+(_[0-9]+)+" attr != null;
getEvaluating =
x:
lib.mapAttrsToList (_: v: v.pname) (
lib.filterAttrs (
n: v:
!(isVersioned n)
&& (builtins.tryEval (v.outPath or null)).success
&& lib.isDerivation v
&& !v.meta.broken
) x
);
brokenDeps = lib.subtractLists (getEvaluating pkgs.haskellPackages) (
getEvaluating (nixpkgs { config.allowBroken = true; }).haskellPackages
);
in
''
${lib.concatMapStringsSep "\n" (x: " - ${x}") brokenDeps}
''