tests.nixpkgs-check-by-name: Fix for aliases to packages in pkgs/by-name and better testing#281390
Merged
infinisil merged 3 commits intoNixOS:masterfrom Jan 17, 2024
Merged
tests.nixpkgs-check-by-name: Fix for aliases to packages in pkgs/by-name and better testing#281390infinisil merged 3 commits intoNixOS:masterfrom
pkgs/by-name and better testing#281390infinisil merged 3 commits intoNixOS:masterfrom
Conversation
This test actually fails right now
This was an oversight in NixOS#275539 not accounted for, which would've failed in CI
This was referenced Jan 16, 2024
Ericson2314
approved these changes
Jan 16, 2024
Member
Author
|
@ofborg build tests.nixpkgs-check-by-name tests.nixpkgs-check-by-name.tests |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
philiptaron
approved these changes
Jan 16, 2024
Contributor
philiptaron
left a comment
There was a problem hiding this comment.
Sad but makes sense.
quantenzitrone
approved these changes
Jan 16, 2024
Contributor
quantenzitrone
left a comment
There was a problem hiding this comment.
all changes are trivial enough for me to understand
so LGTM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
In #275539 I made an oversight which shows itself when you run the tool on the current Nixpkgs:
See #281374 to prevent the broken tooling from being used on master, that should be merged fairly soon before the nixos-unstable channel updates in like a day.
The problem
The problem is that there's some detection logic that makes sure the internal
_internalCallByNamePackageFileattribute isn't used by packages.If such a top-level attribute that's not in
pkgs/by-namewas detected to use this, an error is thrown. However, the detection logic can't distinguish between aliases and non-aliases.So it gives errors even for aliases to packages defined in
pkgs/by-name, e.g.nixpkgs/pkgs/top-level/aliases.nix
Line 1099 in 5df0c94
https://github.com/NixOS/nixpkgs/blob/5df0c94c5ed9c4b9664d63047f2f3a7f93c0bb43/pkgs/top-level/all-packages.nix#L28854
The solution
It would be non-trivial to improve the detection logic, so instead this PR just changes the tool to not give an error in these cases.
Furthermore, a
passthru.testsis added, addressing #256789 and preventing future such problems. It should be triggered automatically after ofborg finishes evaluation of a PR with atests.nixpkgs-check-by-name: ...commit.Add a 👍 reaction to pull requests you find important.