From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#22990: Grafts leads to inefficient substitute info retrieval Date: Mon, 09 Jan 2017 23:55:38 +0100 Message-ID: <877f633kt1.fsf@gnu.org> References: <8737rxx8gk.fsf@gnu.org> <87k2a5rzue.fsf@gnu.org> 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]:50634) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cQirF-0004XF-Mu for bug-guix@gnu.org; Mon, 09 Jan 2017 17:56:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cQirC-0004yb-IM for bug-guix@gnu.org; Mon, 09 Jan 2017 17:56:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:32850) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cQirC-0004yT-E7 for bug-guix@gnu.org; Mon, 09 Jan 2017 17:56:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cQirC-0002Q1-85 for bug-guix@gnu.org; Mon, 09 Jan 2017 17:56:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87k2a5rzue.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Sun, 08 Jan 2017 22:44:41 +0100") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 22990@debbugs.gnu.org ludo@gnu.org (Ludovic Court=C3=A8s) skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) skribis: [...] >> To achieve this, I=E2=80=99m thinking of extending gexp code such that g= exp >> compilers can return a list of applicable grafts. The =E2=80=98package= =E2=80=99 >> compiler would do #:graft? #f and instead let =E2=80=98gexp->derivation= =E2=80=99 call >> =E2=80=98graft-derivation=E2=80=99. > > The =E2=80=98wip-gexp-grafts=E2=80=99 branch does that. Namely, it=E2=80= =99s possible to know > what grafts would apply to a gexp derivation build, so that one can > first build ungrafted, and then apply the grafts to the results. > So for a profile, we=E2=80=99d first build the profile as is, and only th= en > would we graft it. > > Right now the tip of this branch is a hack such that =E2=80=98guix packag= e=E2=80=99: > > 1. Builds the original (ungrafted) derivation of the profile; > > 2. Manually calls =E2=80=98graft-derivation=E2=80=99 on that, passing i= t the list of > applicable grafts. > > Conceptually it=E2=80=99s what we want to do, but the drawback is that the > caller (here =E2=80=98guix package=E2=80=99) goes through a lot of hops t= o get the list > of grafts and to apply it. > > I think we should instead have a way to annotate a derivation with a > list of grafts, as well as a procedure to build that derivations in two > phases (first the original derivation, then the grafts). The current iteration introduces =E2=80=9Cbuild continuation=E2=80=9D: a de= rivation can be annotated with a continuation, and the =E2=80=98build-things=E2=80=99 pr= ocedure will loop over continuations and return the final results (that only works for derivations directly passed as an argument to =E2=80=98build-things=E2= =80=99.) Example (where Guile 2.0.12 replaced by 2.0.13): --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix package -p foo -i guile-json guile-ssh gdb The following packages will be installed: guile-json 0.5.0 /gnu/store/sd8jm2rw7cp3bnrk421kr97ki6sqxnhz-guile-json-= 0.5.0 guile-ssh 0.10.2 /gnu/store/w90isin9pnm9ri8w9njxby8h98lfnkzq-guile-ssh-0= .10.2 gdb 7.12 /gnu/store/d2a4lmycc13ssdf47a9h410knlfqqq41-gdb-7.12 applying 6 grafts to /gnu/store/s7w6r9ih52kdzcl7kprf2rq48s69zh98-profile 3 packages in profile The following environment variable definitions may be needed: export PATH=3D"foo/bin${PATH:+:}$PATH" $ guix gc -R foo | grep guile /gnu/store/7fisf4frrgsjzmknjbab1dal23wxrp8d-guile-2.0.13 /gnu/store/w90isin9pnm9ri8w9njxby8h98lfnkzq-guile-ssh-0.10.2 /gnu/store/sd8jm2rw7cp3bnrk421kr97ki6sqxnhz-guile-json-0.5.0 --8<---------------cut here---------------end--------------->8--- That seems to be a good model. Now we must make sure that it works also for =E2=80=98guix build foo=E2=80= =99 and =E2=80=98guix system build=E2=80=99. Ludo=E2=80=99.