[Nix#9636] Better "attribute 'x' missing" error message #82
Labels
No labels
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/store
bug
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
RFD
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
ux
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#82
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Upstream-Issue: NixOS/nix#9636
Is your feature request related to a problem? Please describe.
Recently while messing around I encountered an error similar to this:
The solution was quite simple: as the flake I was depending on had the export as
default
but not by name, changing the finalfoo
todefault
allowed my build to progress. Unfortunately, due to the attribute and the initial objectfoo
sharing the same name, the caret pointing to the initialfoo
caused me to think the problem lied with the initial foo and not the attribute.Describe the solution you'd like
I see two changes that would make this a simpler error to understand:
I would not have been confused and would have known where to look immediately
error: attribute 'foo' of 'foo.outputs.packages."x86_64-linux"' missing
. This could also help in more admittedly convoluted cases like the following:Note how even though the caret position is unchanged from before, the error message helps differentiate between the initial
foo
, the attributefoo
ofbar
, and the attributefoo
ofbaz
Thanks for taking the time to read through this!
@rbt didn't you have a PR for this one?