Skip to content

check-meta: fix 'hasNoMaintainers'#412184

Merged
Aleksanaa merged 1 commit intoNixOS:masterfrom
LordGrimmauld:meta-maintainer-check
Jun 12, 2025
Merged

check-meta: fix 'hasNoMaintainers'#412184
Aleksanaa merged 1 commit intoNixOS:masterfrom
LordGrimmauld:meta-maintainer-check

Conversation

@LordGrimmauld
Copy link
Contributor

broken in 650eb61

Previously, if any of meta.teams or meta.maintainers was undefined, hasNoMaintainers would return false, suggesting e.g. bash had a maintainer - it does not.

The old logic before meta.teams was:

  hasNoMaintainers = attrs: attrs ? meta.maintainers && (length attrs.meta.maintainers) == 0;

This meant a package that did not define meta.maintainers would appear maintained by this check, while a package with meta.maintainers = [] would be listed as unmaintained.

This might have been a bug.
If it was not, that logic could be restored by prepending an extra check to the condition:

  (attrs ? meta.maintainers || attrs ? meta.teams) && (attrs.meta.maintainers or [] == []) && (attrs.meta.teams or [] == [])

I believe this makes little sense though. if no maintainer is listed, a package should be considered unmaintained. If really desired, this can still be bypassed by setting meta.maintainers = null; or something.

Analogous to #357674, but adjusted for meta.teams as the logic now fully broke for anything not defining both teams and maintainers.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • Nixpkgs 25.11 Release Notes (or backporting 24.11 and 25.05 Nixpkgs Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
  • NixOS 25.11 Release Notes (or backporting 24.11 and 25.05 NixOS Release notes)
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added the 6.topic: stdenv Standard environment label May 29, 2025
@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels May 29, 2025
@LordGrimmauld LordGrimmauld force-pushed the meta-maintainer-check branch 3 times, most recently from 45ea1e2 to 7c4327a Compare May 31, 2025 16:56
@LordGrimmauld LordGrimmauld marked this pull request as draft May 31, 2025 16:57
@LordGrimmauld LordGrimmauld force-pushed the meta-maintainer-check branch from 7c4327a to c0c6b19 Compare May 31, 2025 17:11
@LordGrimmauld LordGrimmauld marked this pull request as ready for review May 31, 2025 17:11
broken in 650eb61

Previously, if any of `meta.teams` or `meta.maintainers`
was undefined, `hasNoMaintainers` would return false,
suggesting e.g. bash had a maintainer - it does not.

The old logic before meta.teams was:
```nix
  hasNoMaintainers = attrs: attrs ? meta.maintainers && (length attrs.meta.maintainers) == 0;
```
This meant a package that did not define `meta.maintainers` would
appear maintained by this check, while a package with `meta.maintainers = []` would be listed as unmaintained.

This might have been a bug.
If it was not, that logic could be restored by prepending an extra check to the condition:
```nix
  (attrs ? meta.maintainers || attrs ? meta.teams) && (attrs.meta.maintainers or [] == []) && (attrs.meta.teams or [] == [])
```

I believe this makes little sense though. if no maintainer is listed, a package should be considered unmaintained.
If really desired, this can still be bypassed by setting `meta.maintainers = null;` or something.
@LordGrimmauld LordGrimmauld force-pushed the meta-maintainer-check branch from c0c6b19 to 1ae214f Compare June 12, 2025 14:28
Copy link
Member

@Aleksanaa Aleksanaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels good enough for me.

@Aleksanaa
Copy link
Member

After trying out nixpkgs = import ./. { config.showDerivationWarnings = [ "maintainerless" ]; } with some packages, I found that if a package itself is unmaintained, the unmaintained packages it depends on aren't printed. It has nothing to do with this PR though.

And we really have a lot of packages without maintainers at the moment! We should resolve this situation sooner.

@Aleksanaa Aleksanaa merged commit eb48029 into NixOS:master Jun 12, 2025
15 of 18 checks passed
@github-project-automation github-project-automation bot moved this to Done in Stdenv Jun 12, 2025
@Ma27
Copy link
Member

Ma27 commented Jul 3, 2025

Backporting since this is also broken on stable (and I was very confused when I tried it out after being reminded that this exists and getting zero results).

@nixpkgs-ci
Copy link
Contributor

nixpkgs-ci bot commented Jul 3, 2025

Successfully created backport PR for release-25.05:

@github-actions github-actions bot added the 8.has: port to stable This PR already has a backport to the stable release. label Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: stdenv Standard environment 8.has: port to stable This PR already has a backport to the stable release. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants