Skip to content

Instantly share code, notes, and snippets.

@domenkozar
Last active November 28, 2019 16:08
Show Gist options
  • Save domenkozar/cc0dfd056466f2dd11e5de9dcbc1a126 to your computer and use it in GitHub Desktop.
Save domenkozar/cc0dfd056466f2dd11e5de9dcbc1a126 to your computer and use it in GitHub Desktop.
Nix error messages gig

Nix error messaging improvements

The goal is to improve beginner experience in Nix.

1. Create github.com/NixOS/nix-message-catalog

Go through Nix issues, move those related to error messages in our new repo.

2. Display the snippet of code where the error happened based on the source position

Print the actual line with the error (and 2 before and 2 after) and point with a carot to the char producing the error.

3. Improve existing evaluation errors

Scope:

$ git grep EvalError | wc -l
84

For each error:

  • turn error into multi-line, with the gist of the error in the first line

  • followed by a blank line and explanations why this could happen and possibly how to fix it. If the explanation is too long, we can put an http link.

  • reword errors for easier understanding

The idea is for you to give a quote for the work involved, then I'll organize crowdfunding to help fund that.

4. Get rid of (most) unknown position in source code

For each noPos:

  1. If we can acquire source position, do so

  2. If not (since it's C++ code), try to log C++ position or at least some code/string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment