Hi Konrad, Just to complete what Pjotr already wrote:
Konrad Hinsen <[email protected]> skribis: > Section 4.1 of that paper says that a given environment, defined by a Guix > profile, can be reproduced given (1) a manifest and (2) the Guix commit > defining all the packages. > > Problem #1: After reading the manual twice, I still don't see how I can tell > "guix package" to use a given Guix commit. Currently the ‘guix’ commands cannot be provided with a commit. So in practice, you have to git clone the Guix repo, jump to the commit of interest, and run ‘./pre-inst-env guix package -i whatever’ from there. There have been discussions to improve this, such as “versioning” the ~/.config/guix/latest symlink (which is created by ‘guix pull’), but nothing concrete at this point. Note that there are several levels of reproducibility that may be interesting. Having the Git commit allows you to rebuild the same profile bit-for-bit (assuming deterministic package builds.) Using ‘guix package --manifest’, possibly with a different commit, allows you to reproduce the profile “symbolically”: same environment, but possibly different package versions or builds. > Problem #2: What if my profile contains packages from several Guix commits > (typically for getting specific older versions)? Or if it contains packages > defined outside of the Guix distribution, in Guile modules on > GUIX_PACKAGE_PATH? For that, you can always export the bits of the profile: guix archive -r --export $(readlink -f ~/.guix-profile) and reimport them elsewhere. This gives bitwise reproducibility, at the expense of composability, similar to Docker or VM images. > If my understanding of Guix is correct, all the required information for > rebuilding everything identically is available at a lower level, in the > derivation files. Would it be feasible to collect all the derivation files > underlying a profile in a tar archive, and then have them rebuilt and added > to a fresh profile in an automatized way? Yes, that’s a good idea. :-) Assuming you know the profile’s derivation¹, you can always run: guix archive -r --export /gnu/store/…-profile.drv > foo.nar The resulting archive will be relatively small and can be carried around. Then one can run: guix build /gnu/store/…-profile.drv to rebuild it. The pieces are in place, but the UIs could definitely be improved to handle those use cases more easily. Thanks, Ludo’. ¹ ‘guix package’ prints the .drv file name, but otherwise this can be retrieved with hacks like this: --8<---------------cut here---------------start------------->8--- scheme@(guile-user)> ,use(guix) scheme@(guile-user)> (define s (open-connection)) scheme@(guile-user)> (path-info-deriver (query-path-info s (readlink (readlink (readlink "/home/ludo/.guix-profile"))))) $2 = "/gnu/store/8bgskqk38hr9qkbzn53g54iwxkh32y88-profile.drv" --8<---------------cut here---------------end--------------->8---
