Skip to content

check-meta: wrap maintainers attribute to include team members#402991

Merged
winterqt merged 2 commits intoNixOS:masterfrom
SigmaSquadron:push-trqvyxvzpntx
May 7, 2025
Merged

check-meta: wrap maintainers attribute to include team members#402991
winterqt merged 2 commits intoNixOS:masterfrom
SigmaSquadron:push-trqvyxvzpntx

Conversation

@SigmaSquadron
Copy link
Contributor

@SigmaSquadron SigmaSquadron commented Apr 30, 2025

This is a work-around that resolves the issues that spawned from #400458 by adding the team members from teams declared in meta.teams to meta.maintainers, effectively restoring the original behaviour of the maintainers attribute, and thus allowing downstreams to keep consuming meta.maintainers without any extra changes to support meta.teams.

Follow-up to #394797.

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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (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 6.topic: python Python is a high-level, general-purpose programming language. 6.topic: GNOME GNOME desktop environment and its underlying platform 6.topic: haskell General-purpose, statically typed, purely functional programming language 6.topic: kernel The Linux kernel 6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. 6.topic: golang Go is a high-level general purpose programming language that is statically typed and compiled. 6.topic: vim Advanced text editor 6.topic: erlang General-purpose, concurrent, functional high-level programming language 6.topic: ocaml OCaml is a general-purpose, high-level, multi-paradigm programming language. 6.topic: xfce The Xfce Desktop Environment 6.topic: fetch Fetchers (e.g. fetchgit, fetchsvn, ...) 6.topic: stdenv Standard environment 6.topic: pantheon The Pantheon desktop environment 6.topic: testing Tooling for automated testing of packages and modules 6.topic: cinnamon Desktop environment 6.topic: java Including JDK, tooling, other languages, other VMs 6.topic: R R is a programming language for statistical computing and data visualization. 6.topic: LXQt The Lightweight Qt Desktop Environment 6.topic: Lumina DE The Lumina Desktop Environment 6.topic: Enlightenment DE The Enlightenment Desktop Environment 6.topic: cuda Parallel computing platform and API 6.topic: mate The MATE Desktop Environment 6.topic: vscode A free and versatile code editor that supports almost every major programming language. 6.topic: zig Zig is an imperative, general-purpose, statically typed, compiled system programming language. 6.topic: jupyter Interactive computing tooling: kernels, notebook, jupyterlab 6.topic: rocm ROCm is an Advanced Micro Devices software stack for graphics processing unit programming. 6.topic: php PHP is a general-purpose scripting language geared towards web development. 6.topic: k3s Kubernates distribution (https://k3s.io/) 6.topic: deepin 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related labels Apr 30, 2025
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label May 6, 2025
@numinit numinit force-pushed the push-trqvyxvzpntx branch from 205bb1f to 92bd743 Compare May 6, 2025 06:45
@numinit
Copy link
Contributor

numinit commented May 6, 2025

Did some prodding at it tonight to make sure this does not break anything that depends on it (notably, maintainer pings). Also added a comment asking to please not break this again since it is an external API and Repology depends on it.

Comment on lines +610 to +612
maintainers =
attrs.meta.maintainers or [ ]
++ concatMap (team: team.members or [ ]) attrs.meta.teams or [ ];
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add this? Unsure if it's common enough to be worth the complexity, though... probably not.

Suggested change
maintainers =
attrs.meta.maintainers or [ ]
++ concatMap (team: team.members or [ ]) attrs.meta.teams or [ ];
maintainers =
lib.unique (attrs.meta.maintainers or [ ]
++ concatMap (team: team.members or [ ]) attrs.meta.teams or [ ]);

Copy link
Contributor

Choose a reason for hiding this comment

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

I saw it come up in a couple of the places I tried. Another idea is a listToAttrs, but that'll probably be slightly heavier on memory since we'll just throw out the attrset anyway. May be worth a shot, though, since it's not N^2 at least?

Copy link
Member

Choose a reason for hiding this comment

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

I mean, we could always just punt it back onto the consumer -- we already had this potential duplication pre-meta.teams, so it wouldn't be a change, just a nicety.

Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed that this change introduced duplication in the qgis package: team.members seem to be first added to qgis.unwrapped and then again in the main derivation because qgis inherits its meta.

Copy link
Contributor

@numinit numinit Jun 25, 2025

Choose a reason for hiding this comment

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

Now that Nix has tracing support, it'll be interesting to use it to test dedup while computing meta. It's what I was mostly missing here.

Comment on lines +65 to +66
((drv.meta or { }).maintainersPosition or null)
((drv.meta or { }).teamsPosition or null)
Copy link
Member

Choose a reason for hiding this comment

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

Why not

Suggested change
((drv.meta or { }).maintainersPosition or null)
((drv.meta or { }).teamsPosition or null)
(builtins.unsafeGetAttrPos "maintainers" (drv.meta or { }))
(builtins.unsafeGetAttrPos "teams" (drv.meta or { }))

? Ideally we wouldn't add (slight!) extra eval overhead just for CI scripts (which AFAIU check-meta will do).

Copy link
Contributor

Choose a reason for hiding this comment

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

The new maintainers attribute was actually clobbering the original one's position, so it would return check-meta.nix every time rather than the real declaring file. I needed a way to pull the location of the original maintainers (pre-teams concatenation) out of there, and just did the same with teams. If it's written this way, it'll return a position pointing to check-meta.nix.

check-meta.nix is a little counterintuitive, but it's a bunch of // attrset updates that both prefers certain things in the meta and overrides other things in it. Maintainers is written as one of the overrides so I made sure we're holding onto the original.

Copy link
Member

@winterqt winterqt left a comment

Choose a reason for hiding this comment

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

Thanks! :)

@winterqt winterqt merged commit a7eef26 into NixOS:master May 7, 2025
37 checks passed
@github-project-automation github-project-automation bot moved this to Done in Stdenv May 7, 2025
@github-project-automation github-project-automation bot moved this from New to ✅ Done in CUDA Team May 7, 2025
@nixpkgs-ci
Copy link
Contributor

nixpkgs-ci bot commented May 7, 2025

Backport failed for release-24.11, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release-24.11
git worktree add -d .worktree/backport-402991-to-release-24.11 origin/release-24.11
cd .worktree/backport-402991-to-release-24.11
git switch --create backport-402991-to-release-24.11
git cherry-pick -x d807892d1f42210129f9fc18f81e5f828150cf4d 92bd743239823dc7c80572539528398f722a9278

@SigmaSquadron SigmaSquadron removed this from Stdenv May 7, 2025
@SigmaSquadron SigmaSquadron deleted the push-trqvyxvzpntx branch May 7, 2025 21:13
@winterqt
Copy link
Member

winterqt commented May 7, 2025

(Why remove from the stdenv board?)

Also, I didn't know we backported this change to 24.11. oof.

@SigmaSquadron
Copy link
Contributor Author

I removed it from Stdenv and CUDA because this isn't part of their projects. The projects are added automatically if we touch certain files during treewides.

We also didn't backport this; it was another mishap caused by changing files in the ci/ directory.

@winterqt
Copy link
Member

winterqt commented May 7, 2025

Makes sense.

Ah, right, forgot about that. Sorry!

@numinit
Copy link
Contributor

numinit commented May 7, 2025

Thanks for the work and the merge, y'all.

@wolfgangwalther
Copy link
Contributor

We also didn't backport this; it was another mishap caused by changing files in the ci/ directory.

The idea for the automated backport label whenever you touch ci/ (except OWNERS) is, that we don't want a diff between stable and unstable for the workflows/ and ci/ folders. This will allow us to easily backport other changes related to CI whenever they come up, without hitting conflicts.

Thus, I opened #405159 to do just that.

marcin-serwin added a commit to marcin-serwin/repology-updater that referenced this pull request Jun 19, 2025
This partially reverts 3fb04fa.

As noted in a comment on repology#1497 (comment) [1] the addition of
`meta.teams` to `meta.maintainers` was just a return to the status quo
before the introduction of separate field. In the long run it makes
sense to handle teams as single entities but while it isn't implemented
let's leave them as is, since some people rely on this [2].

FWIW the largest team in nixpkgs counts 10 members so most of the team
owned packages will likely still be under the limit.

[1]: repology#1497 (comment)
[2]: NixOS/nixpkgs#402991 (comment)

Signed-off-by: Marcin Serwin <[email protected]>
marcin-serwin added a commit to marcin-serwin/repology-updater that referenced this pull request Jun 19, 2025
This partially reverts 3fb04fa.

As noted in a comment on repology#1497 [1] the addition of `meta.teams` to
`meta.maintainers` was just a return to the status quo before the
introduction of separate field. In the long run it makes sense to handle
teams as single entities but while it isn't implemented let's leave them
as is, since some people rely on this [2].

FWIW the largest team in nixpkgs counts 10 members so most of the team
owned packages will likely still be under the limit.

[1]: repology#1497 (comment)
[2]: NixOS/nixpkgs#402991 (comment)

Signed-off-by: Marcin Serwin <[email protected]>
marcin-serwin added a commit to marcin-serwin/repology-updater that referenced this pull request Jun 19, 2025
This partially reverts 3fb04fa.

As noted in a comment on repology#1497 [1] the addition of `meta.teams` to
`meta.maintainers` was just a return to the status quo before the
introduction of separate field. In the long run it makes sense to handle
teams as single entities but while it isn't implemented let's leave them
as is, since some people rely on this [2].

FWIW the largest team in nixpkgs counts 10 members so most of the team
owned packages will likely still be under the limit.

[1]: repology#1497 (comment)
[2]: NixOS/nixpkgs#402991 (comment)

Signed-off-by: Marcin Serwin <[email protected]>
AMDmi3 pushed a commit to repology/repology-updater that referenced this pull request Jun 25, 2025
This partially reverts 3fb04fa.

As noted in a comment on #1497 [1] the addition of `meta.teams` to
`meta.maintainers` was just a return to the status quo before the
introduction of separate field. In the long run it makes sense to handle
teams as single entities but while it isn't implemented let's leave them
as is, since some people rely on this [2].

FWIW the largest team in nixpkgs counts 10 members so most of the team
owned packages will likely still be under the limit.

[1]: #1497 (comment)
[2]: NixOS/nixpkgs#402991 (comment)

Signed-off-by: Marcin Serwin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: continuous integration Affects continuous integration (CI) in Nixpkgs, including Ofborg and GitHub Actions 6.topic: stdenv Standard environment 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.

9 participants