I just found that at least 11 packages that break the assumption that pkg.meta.maintainers is a list of strings.There could be more in packages that do not evaluate and/or are broken.
Not sure if that this is something that should be allowed. It might break automated tooling (or at least add extra complexity that is just needed for these packages)
#usage:
# nix-instantiate --strict --json --eval ./detect-non-list-maintainers.nix | $(nix-build '<nixpkgs>' -A jq)/bin/jq
with (import <nixpkgs> {});
with lib;
let
filter = k: v:
let
evalResult = builtins.tryEval (
if (builtins.typeOf v) == "set" && (builtins.hasAttr "meta" v) && (builtins.hasAttr "maintainers" v.meta)
then if (builtins.typeOf v.meta.maintainers) == "list"
then false
else true
else false
);
in
if evalResult.success
then evalResult.value
else false;
nonListMaintainers = filterAttrs filter pkgs;
in
mapAttrs(k: v: v.meta.maintainers) nonListMaintainers
nix-instantiate --eval --strict --json ./detect-non-list-maintainers.nix | $(nix-build '<nixpkgs>' -A jq)/bin/jq
{
"compton-git": "Ertugrul S枚ylemez <[email protected]>",
"elfutils": "Eelco Dolstra <[email protected]>",
"iops": "David Kleuker <[email protected]>",
"linux_mptcp": "Guillaume Maudoux <[email protected]>",
"multimc": "Michael Bishop <[email protected]>",
"netcdffortran": "Bruno Bzeznik <[email protected]>",
"pws": "Rafa艂 艁asocha <[email protected]>",
"reckon": "[email protected]",
"softhsm": "Michiel Leenaars <[email protected]>",
"synapse": "Matthias Herrmann <[email protected]>",
"telegram-purple": "Arseniy Seroka <[email protected]>"
}
Ran on nixos stable
Note that nixpkgs-lint doesn't detect this condition, but it is documented to be a list.
Hi, this was already fixed in master some time ago. https://github.com/NixOS/nixpkgs/commit/f7e0bc2ae7333c29f3d0c7120f65297d491b63e9.
Most helpful comment
Hi, this was already fixed in master some time ago. https://github.com/NixOS/nixpkgs/commit/f7e0bc2ae7333c29f3d0c7120f65297d491b63e9.