-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
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
module system: Clean up and improve an error message #242812
module system: Clean up and improve an error message #242812
Conversation
byName is not an abstraction. This is the first commit in a series that refactors it away.
This is a non-trivial refactor that slightly changes the semantics of the internal definition lists. Whereas previously only individual list items would trigger the exception, now the error is promoted to the whole list. This is mostly ok, because we compute the value, it is wrong to ignore a definition. However, we don't always compute the value. For instance `readOnly` only needs to count definitions. That won't be possible anymore when the error is raised for one of the items. As a consequence, an error will be raised for the errant definition instead of the number of definitions.
5505bdb
to
8014460
Compare
checkedConfigs = | ||
assert | ||
lib.all | ||
(c: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is called module
in the other functions, which seems like a really bad name for something that's only remotely module-like.
I've scoped out renaming more of it because I think we should first get our definitions straight and then rename it everywhere. Meanwhile, I can't approve of module
so I just called it c
for config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good!
Description of changes
This is mostly about refactoring away
byName
which was a non-abstraction.Most of the commits are the small refactoring steps, separated out so they can be followed and checked.
The only commits that aren't pure refactoring are the ones titled
These changes were motivated by #242339 (comment)
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)