-
-
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
Separate stores for evaluation, building and storing the result #5025
Comments
With this, we don't have to copy the entire .drv closure to the destination store ahead of time (or at all). Instead, buildPaths() reads .drv files from the eval store and copies inputSrcs to the destination store if it needs to build a derivation. Issue NixOS#5025.
With this, we don't have to copy the entire .drv closure to the destination store ahead of time (or at all). Instead, buildPaths() reads .drv files from the eval store and copies inputSrcs to the destination store if it needs to build a derivation. Issue NixOS#5025.
Another use case is #3946 |
So the fully general solution would be that
|
If something like And while I'm here wishing for stuff, I could just as well throw in something like |
When @edolstra writes
This means it is doing exactly what you want! Substitution and remote building in fact does use the store abstraction already. Hooray! The fact that remote building first shells to the (In fact, we could perhaps have a "store with hooked building" adapter for backwards compat if someone really wants it!) |
More progress on issue NixOS#5729 The method trivially generalizes to be store-implementation-agnostic, in fact. However, we force it to continue to be unimplemented with `RemoteStore` and `LegacySSHStore` because the implementation we'd get via the generalization is probably not the one users expect. This keeps our hands untied to do it right going forward. For more about the tension between the scheduler logic being store-type-agnostic and remote stores doing their own scheduling, see issues NixOS#5025 and NixOS#5056.
More progress on issue NixOS#5729 The method trivially generalizes to be store-implementation-agnostic, in fact. However, we force it to continue to be unimplemented with `RemoteStore` and `LegacySSHStore` because the implementation we'd get via the generalization is probably not the one users expect. This keeps our hands untied to do it right going forward. For more about the tension between the scheduler logic being store-type-agnostic and remote stores doing their own scheduling, see issues NixOS#5025 and NixOS#5056.
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/peer-to-peer-binary-cache-rfc-working-group-poll/29568/43 |
I don't love the way this code looks. There are two larger problems: - eval, build/scratch, destination stores (NixOS#5025) should have different types to reflect the fact that they are used for different purposes and those purposes correspond to different operations. It should be impossible to "use the wrong store" in my cases. - Since drvs can end up in both the eval and build/scratch store, we should have some sort of union/layered store (not on the file sytem level, just conceptual level) that allows accessing both. This would get rid of the ugly "check both" boilerplate in this PR. Still, it might be better to land this now / soon after minimal cleanup, so we have a concrete idea of what problem better abstractions are supposed to solve.
I don't love the way this code looks. There are two larger problems: - eval, build/scratch, destination stores (NixOS#5025) should have different types to reflect the fact that they are used for different purposes and those purposes correspond to different operations. It should be impossible to "use the wrong store" in my cases. - Since drvs can end up in both the eval and build/scratch store, we should have some sort of union/layered store (not on the file sytem level, just conceptual level) that allows accessing both. This would get rid of the ugly "check both" boilerplate in this PR. Still, it might be better to land this now / soon after minimal cleanup, so we have a concrete idea of what problem better abstractions are supposed to solve.
For several use cases it would be useful to distinguish between the stores used to store .drv files, to build derivations, and to store the resulting closure.
For example:
nix path-info --store https://cache.nixos.org nixpkgs#hello
doesn't work because the evaluation ofnixpkgs#hello
tries to create .drv files incache.nixos.org
./nix/store
is a high-latency remote store (as with flox), then copying lots of little .drv files to the remote is slow. So it's better to evaluate locally and only copy .drv closures to the remote as needed and in a single round-trip.The text was updated successfully, but these errors were encountered: