Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check-meta: Expose checkValidity and add to all-packages #339597

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

Pandapip1
Copy link
Contributor

@Pandapip1 Pandapip1 commented Sep 4, 2024

Description of changes

Cherry-picked from a commit that used to be in #326199 (see discussion at #326199 (comment))

This is useful when a package has an optional dependency on another package that is nonfree or not available for every platform (e.g. #326199, #310138).

CC @natsukium

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/)
  • 24.11 Release Notes (or backporting 23.11 and 24.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 the 6.topic: stdenv Standard environment label Sep 4, 2024
@Pandapip1 Pandapip1 requested a review from natsukium September 4, 2024 18:05
@ofborg ofborg 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 Sep 4, 2024
@Pandapip1
Copy link
Contributor Author

Bump

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/4709

@@ -226,6 +226,8 @@ with pkgs;
}
'');

checkMeta = callPackage ../stdenv/generic/check-meta.nix { };
Copy link
Member

Choose a reason for hiding this comment

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

Why this does not trigger by-name checks?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No derivations added I guess?

Copy link
Contributor

Choose a reason for hiding this comment

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

The checks are for adding a package (more precisely, a function that returns a derivation) to pkgs/top-level/all-packages.nix; this is a function that returns an attrset.

@Pandapip1
Copy link
Contributor Author

Bump!

@Pandapip1 Pandapip1 changed the title checkMeta: Expose checkValidity and add to all-packages check-meta: Expose checkValidity and add to all-packages Jan 3, 2025
@@ -226,6 +226,8 @@ with pkgs;
}
'');

checkMeta = callPackage ../stdenv/generic/check-meta.nix { };
Copy link
Contributor

Choose a reason for hiding this comment

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

The checks are for adding a package (more precisely, a function that returns a derivation) to pkgs/top-level/all-packages.nix; this is a function that returns an attrset.

@philiptaron philiptaron merged commit 798b378 into NixOS:master Jan 23, 2025
34 checks passed
@mweinelt
Copy link
Member

mweinelt commented Jan 23, 2025

This broke eval, because checkMeta expects hostPlatform to be passed.

https://github.com/NixOS/nixpkgs/actions/runs/12929570543/job/36059219164?pr=376113

@philiptaron
Copy link
Contributor

Dang. I saw the ✅ and hit merge. Thanks for the revert @mweinelt.

@mweinelt
Copy link
Member

I would generally advise caution with older PRs, given that they were evaled either against an older nixpkgs or not at all.

@philiptaron
Copy link
Contributor

Yeah, I can see that. Adding "consider rebasing the PR before merging if >1mo old" to my notes.

@Pandapip1
Copy link
Contributor Author

Pandapip1 commented Jan 23, 2025

Might be worth having an action that rebases and checks evaluation upon PR approval?

Also: are these notes public? I'd like a copy for my own reviewing.

@emilazy
Copy link
Member

emilazy commented Jan 23, 2025

The best solution would be to use GitHub merge queues to ensure that each PR gets eval tested on its actual merged parent before landing. Multiple PRs in the queue at once can have their evaluation tested in parallel to not slow down merging too much.

@Pandapip1
Copy link
Contributor Author

I imagine this would require a repository admin to set that up, right?

@philiptaron
Copy link
Contributor

Also: are these notes public? I'd like a copy for my own reviewing.

It's a physical notebook on my desk. 😞

@Pandapip1
Copy link
Contributor Author

It's a physical notebook on my desk. 😞

Would still appreciate a copy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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
None yet
Development

Successfully merging this pull request may close these issues.

6 participants