-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
A function rebuildDependencyClosure
that produces an efficient closure for offline rebuilds
#180529
Comments
1526: Integration test r=roberth a=roberth TODO - [x] #1484 - [x] provide a Hercules CI agent for running this VM test (requires KVM) Scoped out: - reduce build dependency outputs closure? (currently adds all deps all the way up to bootstrap deps) # NixOS/nixpkgs#180529 Co-authored-by: Robert Hensing <[email protected]>
1526: Integration test r=roberth a=roberth TODO - [x] #1484 - [x] provide a Hercules CI agent for running this VM test (requires KVM) Scoped out: - reduce build dependency outputs closure? (currently adds all deps all the way up to bootstrap deps) # NixOS/nixpkgs#180529 Co-authored-by: Robert Hensing <[email protected]>
1526: Integration test r=roberth a=roberth TODO - [x] #1484 - [x] provide a Hercules CI agent for running this VM test (requires KVM) Scoped out: - reduce build dependency outputs closure? (currently adds all deps all the way up to bootstrap deps) # NixOS/nixpkgs#180529 Co-authored-by: Robert Hensing <[email protected]>
I have some doubts whether this is feasible without pulling all of the build closure's outputs as dependencies of the produced derivation (which in turn produces the optimized list) We'll need to
It seems that we'll need RFC92 |
@roberth and I talked about, but for the record 92 just needs review/rebase, and some things can be cleaned up based upon us exploring what |
I think this can be achieved by querying the closure in the same derivation that computes the closure difference stuff.
I've previously found that Nix is eager to check for paths from the whole derivation closure, even if those should in theory not be known to the current derivation. Therefore this item may not be an obstacle? |
Let's assume I got the |
@baloo I'm not sure either. Maybe
Maybe |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/more-airgap-questions/38748/12 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/more-airgap-questions/38748/11 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/pre-rfc-implement-dependency-retrieval-primitive/43418/6 |
I'm leaning towards implementing this as a function in the language, because this is an operation on "derivable paths", and not an operation an realised paths. By performing this little graph computation in the sandbox, we cause too many inputs to be added, and for them to be realised, which is all unnecessary and slow. Realisation is only needed when this set of "derivable paths" - ie strings with context - are used in the final derivation (e.g. As a practical benefit of this approach, it works without fixing Nix's behavior of assuming "DrvDeep" behavior in a few places, which arguably should be done, but will be slow to trickle through. The expression language simply runs on the client, without any need to upgrade the daemon, remote builders, etc. That way it's simple: if you have the builtin, it works; otherwise update your client, which you may even do temporarily without upgrading your system. |
In case of RFC 92 dynamic derivations:
I don't know how much of a problem that would be, but if we come up with a stable protocol for ingesting derivations, we actually have the tech to do "recursive nix"-style FODs dynamically to cover this for the quasi-offline use case: hermetic building and testing in the Nix sandbox. Perhaps then, to avoid IFD and recursive-nix-like weirdness, it should be something in the builder after all? |
Project description
Some tests need to build configuration files and such in the sandbox. Currently, we manually list packages as extra dependencies in such tests, e.g.
nixpkgs/nixos/tests/installer.nix
Lines 320 to 353 in dbf41bb
This tends to bitrot.
A current alternative is to provide all of the build closure's outputs and sources. This doesn't bitrot, but it includes many paths that aren't used, such as ~10G of unpacked llvm sources.
Instead, I propose to write a function that produces a closure that is specifically suited for a particular rebuild.
While this building block may have a use case in the package set, the main use case will be in NixOS tests.
This can be facilitated by a new NixOS module that adds the required dependencies to
system.extraDependencies
.Here's a draft of the interface:
Metadata
The text was updated successfully, but these errors were encountered: