Make fetchTree locked input error message clearer #9626
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Today I was trying to use Nix and I got the error message
This was completely baffling to me -- what's "pure evaluation mode"? What's
fetchTree
? What's a locked input? It didn't mention any line number in my code, so I couldn't figure out which part of my code it even related to.Someone on the Discord helped me understand that the problem was in my call to
fetchGit
(I'd forgotten to setrev = ...
, because thefetchGit
builtin callsfetchTree
.So here's an idea for how to improve the error message, to mention
fetchGit
so that users can figure out which function the error message is coming from. It's a little messy but seems potentially worth it to help people out.Hopefully it compiles, I don't have a toolchain set up.
Priorities
Add 👍 to pull requests you find important.