NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.71k stars 1.51k forks source link

Should we allow spitting the derivation output map per output? #4344

Open Ericson2314 opened 3 years ago

Ericson2314 commented 3 years ago

The SQL database necessary stores rows individually, but we have a choice for other types of stores. https://github.com/NixOS/nix/pull/4330 currently stores a file per derivation × output in the binary cache, but we might also consider storing one file for the entire derivation and all its outputs.

The big idea in doing so is that:

Now, this does clash a bit with the important ability we have to GC individual outputs, and exchange them individually as needed between stores. We certainly don't want to loose that ability, nor have to mutate binary cache to add or remove entries from an existing file.

The crux of the solution is to ensure that a mapping for any output must come with, and keep alive, the mappings for all outputs. The slight challenge is to implement this with the local store and SQLite DB. Perhaps we'll need a single-column DrvHash table, with foreign keys from the build mappings to that table, and a restriction that one cannot delete an individual mapping unless one deletes all the mappings for the derivation?

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info

stale[bot] commented 2 years ago

I marked this as stale due to inactivity. → More info