-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix flake evaluation in chroot stores #10345
Conversation
This is a temporary fix until we can pass `SourcePath`s rather than `StorePath`s to `call-flake.nix`. Fixes NixOS#10331.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why the special-casing is needed, but it seems sound.
Can you add a test for it? The chroot stores are quite fragile and under-tested
auto path = sourcePath.path.abs(); | ||
if (auto store = state.store.dynamic_pointer_cast<LocalFSStore>()) { | ||
auto realStoreDir = store->getRealStoreDir(); | ||
if (isInDir(path, realStoreDir)) | ||
path = store->storeDir + path.substr(realStoreDir.size()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't this use store.getFSAccessor->toRealPath()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No because this does the opposite (it converts a real path to a store path).
3cc22ab
to
8930772
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-03-27-nix-team-meeting-134/42961/1 |
Motivation
This is a temporary fix until we can pass
SourcePath
s rather thanStorePath
s tocall-flake.nix
.Fixes #10331, #10267.
Context
Priorities and Process
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.