From: ludo@gnu.org (Ludovic Courtès)
To: Eric Bavier <ericbavier@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] list-packages: Display package usage count.
Date: Sun, 26 Oct 2014 22:17:14 +0100 [thread overview]
Message-ID: <87zjcifs4l.fsf@gnu.org> (raw)
In-Reply-To: <87fveay412.fsf@gmail.com> (Eric Bavier's message of "Sun, 26 Oct 2014 15:22:49 -0500")
Eric Bavier <ericbavier@gmail.com> skribis:
> Mark H Weaver writes:
>
>> Eric Bavier <ericbavier@gmail.com> writes:
>>
>>> Ludovic Courtès writes:
>>>
>>>> Eric Bavier <ericbavier@gmail.com> skribis:
>>>>
>>>>> + (define (users package)
>>>>> + (let ((n (length (package-transitive-dependents
>>>>> + (find-packages-by-name* (package-name package)
>>>>> + (package-version package))))))
>>>>
>>>> Why not just (package-transitive-dependents package)?
>>>
>>> Because that would not accurately count the "true" number of dependents.
>>
>> Agreed, but what you wrote doesn't fully address the problem either.
>>
>> If we modify 'gnu-make', that's also going to affect 'gnu-make-boot0' in
>> commencement.scm. Since that one has a different name ("make-boot0"),
>> your logic won't catch it.
>>
>> Similarly, if you modify 'gcc-4.7', that's also going to affect
>> 'gcc-4.8' (different version) which affects 'gcc-boot0' (with a
>> different name and version).
>
> True. This is part of the reason the documentation for 'guix refresh
> -l' notes the *approximate* accuracy of the reported dependents. The
> yet-to-be-pushed rewrite with the bags api improves things, but doesn't
> address these issues.
In the examples Mark gave, the various packages use the same origin. I
think a good fix would be to somehow map <origin> objects to packages
that refer to them.
However, that seems mostly useful to ‘guix refresh -l’, and not really
for list-packages.scm. WDYT?
>> So, it seems to me that we need a way to find all packages that
>> 'inherit' from the package we're changing, transitively. I'm not sure
>> off-hand if that information is preserved, but if not, we should
>> probably arrange to preserve it somehow.
>
> I was just thinking of this possibility earlier while working with 'guix
> lint', regarding the patch-name warnings. Perhaps each package could
> have an 'ancestor' field that is auto-populated when (inherit foo) is
> used, and #f otherwise? That information could be included in the
> DAG created by (package-dependencies).
That’s an option, but I’d like to avoid going this far. Notably because
it might lead to a growth in heap usage as ancestors would remain
reachable, but also because I feel we may not be looking at things from
the right angle.
Conceptually, there’s an object DAG and we’re trying to enumerate the
those that depend on a given object. What you did works well for
package objects, but ignores edges in the DAG between a package and an
origin, or between a package and a file. Perhaps the fix would be to
account for those edges?
Thanks,
Ludo’.
prev parent reply other threads:[~2014-10-26 21:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-20 17:15 [PATCH] list-packages: Display package usage count Eric Bavier
2014-10-25 21:47 ` Ludovic Courtès
2014-10-26 18:23 ` Eric Bavier
2014-10-26 19:46 ` Mark H Weaver
2014-10-26 20:22 ` Eric Bavier
2014-10-26 21:17 ` Ludovic Courtès [this message]
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=87zjcifs4l.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.