Repository navigation
Source path error improvements - #20
Merged
Merged
Conversation
This makes paths in error messages behave similar to lazy-trees,
e.g. instead of store paths like
error: attribute 'foobar' missing
at /nix/store/ddzfiipzqlrh3gnprmqbadnsnrxsmc9i-source/machine/configuration.nix:209:7:
208|
209| pkgs.foobar
| ^
210| ];
you now get
error: attribute 'foobar' missing
at /home/eelco/Misc/eelco-configurations/machine/configuration.nix:209:7:
208|
209| pkgs.foobar
| ^
210| ];
edolstra
force-pushed
the
map-to-original-accessors-2
branch
from
April 1, 2025 15:46
1f13647 to
6d80484
Compare
This way, we don't need the PathDisplaySourceAccessor source accessor hack, since error messages are produced directly by the original source accessor. In fact, we don't even need to copy the inputs to the store at all, so this gets us very close to lazy trees. We just need to know the store path so that requires hashing the entire input, which isn't lazy. But the next step will be to use a virtual store path that gets rewritten to the actual store path only when needed.
edolstra
force-pushed
the
map-to-original-accessors-2
branch
from
April 1, 2025 15:50
6d80484 to
73b1754
Compare
gustavderdrache
approved these changes
Apr 1, 2025
edolstra
added this pull request to the merge queue
Apr 1, 2025
cole-h
approved these changes
Apr 1, 2025
Collaborator
Author
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Based on NixOS#12532 but heavily modified.
We now "mount" the source accessors of flake inputs on top of
/nix/store(i.e. theMountedSourceAccessornamedstoreFS). This allows error messages similar to the lazy-trees branch, i.e. referring to the original source trees (like a Git repo) instead of the store path to which the input was copied.Context
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.