Nix 2.32.0 released

A thing that we have overlooked in the release notes is a rather big flake error messages improvement. Now error messages include the original location of files and not their copies in the nix store. As a result, error messages about missing files are now much more legible. When trying to import a non-existent file in a flake:

{
  outputs =
    { ... }:
    {
      a = import ./foo;
    };
}

instead of error messages like:

error:
       … while calling the 'import' builtin
         at /nix/store/jddhnbpcfn3l6vb4i6z21n7xmcig1m09-source/flake.nix:5:11:
            4|     {
            5|       a = import ./foo;
             |           ^
            6|     };

       error: path '/nix/store/jddhnbpcfn3l6vb4i6z21n7xmcig1m09-source/foo' does not exist

You now get:

error:
       … while calling the 'import' builtin
         at /tmp/tmp.scdeeC8Gm1/flake.nix:5:11:
            4|     {
            5|       a = import ./foo;
             |           ^
            6|     };

       error: Path 'foo' does not exist in Git repository "/tmp/tmp.scdeeC8Gm1".

This supersedes #12915 and has been implemented as a side-effect of another bugfix in #14050. This does surface a pre-existing issue with impure evaluation and builtins.readDir builtins.storeDir (Fix fetchToStore caching by edolstra · Pull Request #14050 · NixOS/nix · GitHub), but that is expected to be resolved soonish.

9 Likes