From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] guix: refresh: Use bags. Date: Mon, 13 Oct 2014 23:31:39 +0200 Message-ID: <87ppdvodvo.fsf@gnu.org> References: <87lhonvhz6.fsf@member.fsf.org> <87zjd3ac79.fsf@gnu.org> <87iojrus6j.fsf@gmail.com> <87ppdy45t5.fsf@gnu.org> <87fvervkw1.fsf@gmail.com> 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]:46043) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XdnDO-0001Va-BF for guix-devel@gnu.org; Mon, 13 Oct 2014 17:31:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XdnDJ-0008CH-9M for guix-devel@gnu.org; Mon, 13 Oct 2014 17:31:38 -0400 Received: from hera.aquilenet.fr ([2a01:474::1]:57828) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XdnDI-0008C6-RI for guix-devel@gnu.org; Mon, 13 Oct 2014 17:31:33 -0400 In-Reply-To: <87fvervkw1.fsf@gmail.com> (Eric Bavier's message of "Mon, 13 Oct 2014 14:18:22 -0500") 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: Eric Bavier Cc: guix-devel@gnu.org Eric Bavier skribis: > Ludovic Court=C3=A8s writes: > >> Eric Bavier skribis: >> >>> Ludovic Court=C3=A8s writes: [...] >> Of course it would be good to use the full DAG. For that we=E2=80=99d n= eed >> something that uses =E2=80=98fold-packages=E2=80=99 to get the =E2=80=9C= entry points=E2=80=9D of the >> DAG, and then traverses it all to also get the private packages. >> >> From there we could perhaps build a =E2=80=98fold-package*=E2=80=99 that= would iterate >> on the whole DAG. > > Updated patch attached. It defines a `fold-package*', and uses it in > `guix refresh' to get all packages of a given name. Nice! > This patch may need to go in core-updates. Why? > From 1d22367e0806cea004631e22a782b7db3ffe65b0 Mon Sep 17 00:00:00 2001 > From: Eric Bavier > Date: Mon, 13 Oct 2014 13:46:09 -0500 > Subject: [PATCH] guix: refresh: Use bags. > > * guix/packages.scm (bag-direct-inputs): New procedure. > * gnu/packages.scm (package-dependencies): Use it. > (fold-packages*): New procedure. > * guix/scripts/refresh.scm (guix-refresh)[list-dependent]: Use it. [...] > --- a/guix/scripts/refresh.scm > +++ b/guix/scripts/refresh.scm > @@ -232,16 +232,27 @@ update would trigger a complete rebuild." > (with-error-handling > (cond > (list-dependent? > - (let* ((rebuilds (map package-full-name > - (package-covering-dependents packages))) > + (let* ((packages* > + ;; Need to consider private packages, which are not foun= d by > + ;; find-packages-by-name > + (fold-packages* > + (let ((package-names (map package-name packages))) > + (lambda (p r) > + (if (find (cut string=3D? (package-name p) <>) > + package-names) > + (cons p r) > + r))) > + '())) > + (rebuilds (map package-full-name > + (package-covering-dependents packages*))) Could you move the computation of the package list to a different procedure? Possibly merging it with the existing expression that computes =E2=80=98packages=E2=80=99 and which is already quite big. > I'm also attaching the script I used to produce the package dependency > count table I included previously. With this updated patch, the numbers > look much more reasonable and complete for the "core" packages. > > > > And the revised output, if anyone doesn't want to take the time to run > the script themselves. > > binutils-bootstrap-0......................... 974 (99.39%) > bootstrap-binaries-0......................... 974 (99.39%) > file-5.19.................................... 974 (99.39%) > findutils-4.4.2.............................. 974 (99.39%) > diffutils-3.3................................ 974 (99.39%) Looks good. It would be nice to show this info on the output of build-aux/list-packages.scm (used to build .) Thanks, Ludo=E2=80=99.