-
-
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
Make builtins.fetchTree
return a path as its outPath
element
#10115
Comments
It turns out that this is not really possible without lazy trees, since it causes an undesirable double copying of source trees. For instance, on master we currently have this behaviour:
But if
This is because On the lazy-trees branch, we don't get this double copy:
since |
I see. I've underestimated the amount of lazy-trees behavior that is needed. I think it's worth exploring a less lazy lazy-trees that doesn't have impurities and is more compatible with existing code, at the cost of doing |
I think the easiest solution is to keep the current behaviour (i.e. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2024-03-11-nix-team-meeting-132/42960/1 |
Is your feature request related to a problem? Please describe.
(builtins.fetchTree foo).outPath
is currently a string (pointing to a path in the Nix store).This means that something like
(builtins.fetchTree foo).outPath + "/foo"
will copy the whole tree into the store (to get theoutPath
string), and then return that store path +/foo
.Describe the solution you'd like
Make it a path value instead, and benefit from the extra laziness of paths (thus getting part of the
lazy-tree
s benefits).This would mean that
(builtins.fetchTree foo).outPath + "/foo"
would be a path in its own right, and accessing it would only mean copyting the/foo
subdirectory into the store.Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
This is already implemented in the lazy trees branch, would have to be backported to
master
.Priorities
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: