Conversation
|
Cool. Could you write a changelog message for this? This is a major UX improvement. |
ffd65d7 to
8513598
Compare
| // Backward compatibility hack: throw an exception if access | ||
| // to this path is not allowed. |
There was a problem hiding this comment.
Yeah where is FilteringSourceAccessor even being used anymore? I only see it used with GitExportIgnoreSourceAccessor
| // Backward compatibility hack: throw an exception if access | ||
| // to this path is not allowed. |
| auto storePath = fetchToStore(*state.store, accessor, FetchMode::Copy, input.getName()); | ||
|
|
||
| state.allowPath(storePath); | ||
| state.allowPath(storePath); // FIXME: should just whitelist the entire virtual store |
There was a problem hiding this comment.
Not a bug:
| state.allowPath(storePath); // FIXME: should just whitelist the entire virtual store | |
| state.allowPath(storePath); // TODO: we could simply whitelist the entire virtual store, because all of that is created by the evaluator and its allowed external sources |
This could use some clarification so that others can follow.
What you're suggesting as the next step is to provide lazy copying. I hope I'm not adding to the confusion. |
|
I suggest we do this in conjunction with #12531 |
|
I changed #12531 as discussed in the meeting, and then rebased this on top in https://github.com/Ericson2314/nix/tree/source-path-errors |
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| ];
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.
8513598 to
addec3c
Compare
|
@edolstra I assume this was closed by accident? |
|
This has been implemented in #14050 and released in 2.32. |
|
Cherry-picked the tests in #14352 |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
Motivation
Based on #12532 but heavily modified.
We now "mount" the source accessors of flake inputs on top of /nix/store (i.e. the MountedSourceAccessor named storeFS). 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.
For example, instead of
you now get
Context
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.