-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Don't copy nix store path to nix store #11229
base: master
Are you sure you want to change the base?
Conversation
I think this would violate the postcondition that the resulting store path is named |
hmm, i see your point. but nix store paths aren't content addressable to begin with (unless (and besides, i can still bypass all this by naming my derivation "source") |
They are content addressed to begin with without that feature, just not ones produced by derivations. |
@Ericson2314 is there a real way to tell them apart? is it possible to tell apart store paths that are actually content-addressable, vs store paths that just happen to be named "source"? |
I have observed assertion failure from nix if I name my derivation "source" (without this patch). I think this is poorly thought out. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2024-08-07-nix-team-meeting-minutes-167/50287/1 |
Based on today's meeting, returning a path named |
would naming a derivation "source" become prohibited in the future? |
@yshui No, I don't think we would need to prohibit that. |
The reason to hold off is that we may need to revert this change in behavior soon, so that we don't have to track the custom name in the lazy path value returned by
I agree and in fact it is desirable when performing file set filtering in a content-addressed derivation. If that derivation is also named |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/confused-about-nix-copying-nixpkgs/53737/4 |
Motivation
Avoid unnecessary store -> store copies
Context
See #11228
I checked the PR introduced this change, and didn't find an explanation why this
== "source"
check is necessary.IMO all store -> store copies are unnecessary. And even if there is indeed a valid reason this is only done for store paths named "source", it's not like the user can't just name their derivation "source".
Priorities and Process
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.