guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] guix: refresh: Use bags.


From: Ludovic Courtès
Subject: Re: [PATCH] guix: refresh: Use bags.
Date: Mon, 13 Oct 2014 23:31:39 +0200
User-agent: Gnus/5.130011 (Ma Gnus v0.11) Emacs/24.3 (gnu/linux)

Eric Bavier <address@hidden> skribis:

> Ludovic Courtès writes:
>
>> Eric Bavier <address@hidden> skribis:
>>
>>> Ludovic Courtès writes:

[...]

>> Of course it would be good to use the full DAG.  For that we’d need
>> something that uses ‘fold-packages’ to get the “entry points” of the
>> DAG, and then traverses it all to also get the private packages.
>>
>> From there we could perhaps build a ‘fold-package*’ 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 <address@hidden>
> 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 found by
> +                ;; find-packages-by-name
> +                (fold-packages*
> +                 (let ((package-names (map package-name packages)))
> +                   (lambda (p r)
> +                     (if (find (cut string=? (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 ‘packages’ 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
<https://www.gnu.org/software/guix/package-list.html>.)

Thanks,
Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]