Added builtins.warn` which takes two arguments: a message that is displayed as a warning during evaluation which must be a string and a value that is returned from the expression. The next commits add new settings to control the behavior of the new builtin: `debugger-on-warn` allows the user to start the debugger and `abort-on-warn` aborts evaluation with an error. Unlike upstream, I chose not to mark evaluation warnings from `builtins.warn` as distinct from other warnings because that breaks the commonly expected logging format `level: message`. Co-authored-by: Qyriad <qyriad@qyriad.me> Upstream-PR: https://github.com/NixOS/nix/pull/10592 Fixes: https://git.lix.systems/lix-project/lix/issues/579 Change-Id: I8658c88e5c27952b65e8b9f5525a572e0680cc1f
11 lines
287 B
Plaintext
11 lines
287 B
Plaintext
error:
|
|
… while calling the 'warn' builtin
|
|
at /pwd/in.nix:1:1:
|
|
1| builtins.warn { cat = "girl"; } 1337
|
|
| ^
|
|
2|
|
|
|
|
… while evaluating message for builtins.warn
|
|
|
|
error: expected a string but found a set: { cat = "girl"; }
|