Conversation
|
I think this is really great, and the evaluation performance report indicates this is basically free -- nice! One concern:
I like this option better because it is a word somebody can say without needing to know more than English. (@infinisil suggested this specific change in a chat with him.) |
|
Furthermore, as @andir pointed out, the lambda and delta aren't rendered by the kernel in a TTY. (« and » do) |
|
What happens if definitions are very large values (or even circular/infinite, like derivations)? |
|
@edolstra |
|
Not that it needs to be of scope in this PR (as it already improves the status quo), For example when there's a conflict the user can either remove one value or use |
|
@domenkozar Oh great idea! I think I'll leave this for another PR indeed though. @grahamc I just pushed a change to the |
|
Turns out this is what the |
The type's check function already ensured that it can't be passed non-lists
4538c0d to
465f66c
Compare
For pretty-printing definitions, including file and values
If multiple definitions are passed, this evaluates them all as if they were the only one, for a better error message. In particular this won't show module-internal properties like `_type = "override"` and co.
465f66c to
8908766
Compare
|
Changes since last revision:
As an example showcasing all of this, the error you get when you set the |
|
This PR improves |
Motivation for this change
This updates NixOS module system errors to print the actual values of the definitions. It also updates the error formatting a bit. Related issues:
generators.toPretty#97133 will improvegenerators.toPretty, which is used by these error messagesPing @Profpatsch @roberth @grahamc
Here is an overview of the new error messages, reproducable with the following file:
Details
Non-existant option
Multiple readOnly definitions
Wrong type
Unmergable definitions (when no type specified)
Unique option defined multiple times
Note: This is pretty much the same error condition for
readOnlyoptions, however this failure is specified by the type itself, rather than the option. This happens e.g. withuniq (listOf str)ortypes.packageConflicting definitions
Things done