From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Reproducible environments Date: Tue, 06 Oct 2015 18:44:47 +0200 Message-ID: <87mvvwj69s.fsf@gnu.org> References: <22035.42892.444833.212704@Konrad-Hinsens-MacBook-Pro-2.local> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54947) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjaZs-0000ic-Cw for guix-devel@gnu.org; Tue, 06 Oct 2015 18:19:21 -0400 In-Reply-To: <22035.42892.444833.212704@Konrad-Hinsens-MacBook-Pro-2.local> (Konrad Hinsen's message of "Tue, 6 Oct 2015 12:50:52 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Konrad Hinsen Cc: guix-devel@gnu.org Hi Konrad, Just to complete what Pjotr already wrote: Konrad Hinsen skribis: > Section 4.1 of that paper says that a given environment, defined by a Gui= x profile, can be reproduced given (1) a manifest and (2) the Guix commit d= efining all the packages. > > Problem #1: After reading the manual twice, I still don't see how I can t= ell "guix package" to use a given Guix commit. Currently the =E2=80=98guix=E2=80=99 commands cannot be provided with a com= mit. So in practice, you have to git clone the Guix repo, jump to the commit of interest, and run =E2=80=98./pre-inst-env guix package -i whatever=E2=80=99= from there. There have been discussions to improve this, such as =E2=80=9Cversioning=E2= =80=9D the ~/.config/guix/latest symlink (which is created by =E2=80=98guix pull=E2=80= =99), 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 =E2=80=98guix package --manifest=E2=80=99, possibly with a different commit= , allows you to reproduce the profile =E2=80=9Csymbolically=E2=80=9D: same environment, = but possibly different package versions or builds. > Problem #2: What if my profile contains packages from several Guix commit= s (typically for getting specific older versions)? Or if it contains packag= es defined outside of the Guix distribution, in Guile modules on GUIX_PACKA= GE_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 der= ivation files. Would it be feasible to collect all the derivation files und= erlying a profile in a tar archive, and then have them rebuilt and added to= a fresh profile in an automatized way? Yes, that=E2=80=99s a good idea. :-) Assuming you know the profile=E2=80=99s derivation=C2=B9, you can always ru= n: guix archive -r --export /gnu/store/=E2=80=A6-profile.drv > foo.nar The resulting archive will be relatively small and can be carried around. Then one can run: guix build /gnu/store/=E2=80=A6-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=E2=80=99. =C2=B9 =E2=80=98guix package=E2=80=99 prints the .drv file name, but otherw= ise 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 (readl= ink (readlink "/home/ludo/.guix-profile"))))) $2 =3D "/gnu/store/8bgskqk38hr9qkbzn53g54iwxkh32y88-profile.drv" --8<---------------cut here---------------end--------------->8---