Hi Chris, Chris Marusich <cmmarus...@gmail.com> skribis:
> My understanding is that Nix builds derivations in a temporary > directory. My understanding is that eventually, we copy the results of > the build into the final, content-addressed store path. Since we don't > know the final, content-addressed store path until after we calculate > the hash of the output, how do we prevent that final store path from > being garbage collected while the build process is running? Do we use > addTempRoot to add the final, content-addressed store path as a > temporary root, too? I looked in the code but couldn't figure this out. Store items are not content-addressed, except for fixed-output derivations and things added with ‘add-to-store’ and ‘add-text-to-store’. Leaving these two special cases aside, store file names are computed as a function of the build inputs of a derivation. In Eelco Dolstra’s thesis, both models are described: the “extensional model” (the one Nix and Guix use) and the “intensional model” (content-addressability, which has never been deployed, and which is challenging in many ways.) HTH! Ludo’.