profile
viewpoint

Ask questionsNix flakes should not cache evaluation errors

Describe the bug

Currently error messages are only showed the first time they appear. After that the error message looks like this:

$ sudo nixos-rebuild switch
building the system configuration...
error: --- EvalError -------------------------------------------------------------------------- nix
cached failure of attribute 'nixosConfigurations.turingmachine.config.system.build.toplevel.drvPath'

The problem is that the error message of the first time might be no longer visible, so users would get stuck not knowing what its going on.

Steps To Reproduce

  1. Create an invalid nixos configuration i.e. add two conflicting options (but valid nix syntax)
  2. Run nixos-rebuild switch:
error: --- ThrownError --------------------------------------------------------------------------- nix
The option `system.nixos.versionSuffix' has conflicting definitions, in `<unknown-file>' and `<unknown-file>'.
(use '--show-trace' to show detailed location information)
  1. Run nixos-rebuild switch again:
building the system configuration...
error: --- EvalError -------------------------------------------------------------------------- nix
cached failure of attribute 'nixosConfigurations.turingmachine.config.system.build.toplevel.drvPath'

Expected behavior

It should not cache evaluation failures and show me the message agin

nix-env --version output

$ nix-env --version
nix-env (Nix) 2.4pre20200721_ff314f1
NixOS/nix

Answer questions domenkozar

What if the error message was also cached?

useful!
source:https://uonfu.com/
answerer
Domen Kožar domenkozar @cachix Ljubljana, Slovenia https://www.domenkozar.com Instilling sanity into building and distribution of software.
Github User Rank List