forked from lix-project/lix
Rebecca Turner
7bcb1cac37
Previously, errors while printing values in `nix repl` would be printed
in `«error: ...»` brackets rather than displayed normally:
```
nix-repl> legacyPackages.aarch64-darwin.pythonPackages.APScheduler
«error: Package ‘python-2.7.18.7’ in /nix/store/6s0m1qc31zw3l3kq0q4wd5cp3lqpkq0q-source/pkgs/development/interpreters/python/cpython/2.7/default.nix:335 is marked as insecure, refusing to evaluate.»
```
Now, errors will be displayed normally if they're emitted at the
top-level of an expression:
```
nix-repl> legacyPackages.aarch64-darwin.pythonPackages.APScheduler
error:
… in the condition of the assert statement
at /nix/store/6s0m1qc31zw3l3kq0q4wd5cp3lqpkq0q-source/lib/customisation.nix:268:17:
267| in commonAttrs // {
268| drvPath = assert condition; drv.drvPath;
| ^
269| outPath = assert condition; drv.outPath;
… in the left operand of the OR (||) operator
at /nix/store/6s0m1qc31zw3l3kq0q4wd5cp3lqpkq0q-source/pkgs/development/interpreters/python/passthrufun.nix:28:45:
27| if lib.isDerivation value then
28| lib.extendDerivation (valid value || throw "${name} should use `buildPythonPackage` or `toPythonModule` if it is to be part of the Python packages set.") {} value
| ^
29| else
(stack trace truncated; use '--show-trace' to show the full trace)
error: Package ‘python-2.7.18.7’ in /nix/store/6s0m1qc31zw3l3kq0q4wd5cp3lqpkq0q-source/pkgs/development/interpreters/python/cpython/2.7/default.nix:335 is marked as insecure, refusing to evaluate.
```
Errors emitted in nested structures (like e.g. when printing `nixpkgs`)
will still be printed in brackets.
Change-Id:
|
||
---|---|---|
.. | ||
extra_data | ||
basic.ast | ||
basic.test | ||
basic_repl.test | ||
basic_tidied.ast | ||
basic_tidied.test | ||
errors.test | ||
no_nested_debuggers.nix | ||
no_nested_debuggers.test | ||
regression_9917.nix | ||
regression_9917.test | ||
regression_9918.nix | ||
regression_9918.test | ||
regression_l145.nix | ||
regression_l145.test | ||
repl_overlays.nix | ||
repl_overlays.test | ||
repl_overlays_compose.nix | ||
repl_overlays_compose.test | ||
repl_overlays_destructure_without_dotdotdot_errors.test | ||
repl_overlays_destructure_without_formals_ok.test | ||
repl_overlays_error.test | ||
repl_printing.test | ||
stack_vars.nix | ||
stack_vars.test |