all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Eric Bavier <ericbavier@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] guix: refresh: Use bags.
Date: Mon, 13 Oct 2014 23:31:39 +0200	[thread overview]
Message-ID: <87ppdvodvo.fsf@gnu.org> (raw)
In-Reply-To: <87fvervkw1.fsf@gmail.com> (Eric Bavier's message of "Mon, 13 Oct 2014 14:18:22 -0500")

Eric Bavier <ericbavier@gmail.com> skribis:

> Ludovic Courtès writes:
>
>> Eric Bavier <ericbavier@gmail.com> 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 <bavier@member.fsf.org>
> 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	other threads:[~2014-10-13 21:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-10 19:32 [PATCH] guix: refresh: Use bags Eric Bavier
2014-10-10 19:42 ` David Thompson
2014-10-10 20:42 ` Ludovic Courtès
2014-10-11  1:46   ` Eric Bavier
2014-10-11  4:49   ` Eric Bavier
2014-10-11 22:09     ` Ludovic Courtès
2014-10-13 19:18       ` Eric Bavier
2014-10-13 21:31         ` Ludovic Courtès [this message]
2014-10-14 17:06           ` Eric Bavier
2014-10-14 19:09             ` Ludovic Courtès
2014-10-20 16:58           ` Eric Bavier
2014-10-25 21:36             ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ppdvodvo.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=ericbavier@gmail.com \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.