unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Hartmut Goebel <h.goebel@crazy-compilers.com>
Cc: 30710@debbugs.gnu.org
Subject: bug#30710: guix graph gives duplicate nodes
Date: Wed, 07 Mar 2018 16:18:51 +0100	[thread overview]
Message-ID: <87efkvsylg.fsf@gnu.org> (raw)
In-Reply-To: <c9c92f41-65ea-3ac8-daa8-2cc9b7fbddf5@crazy-compilers.com> (Hartmut Goebel's message of "Tue, 6 Mar 2018 21:28:31 +0100")

Hello,

Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:

>> This is expected.  Strictly speaking, we’re talking about two different
>> package objects, hence the different IDs.
>
> I wonder
>
> a) whether it is useful to have different graph nodes for the same package.
>
> This is about usability of the resulting graph, esp. since this is the
> default graph output format. Does it help *users* for their analysis? Or
> is this some *expert* insight?

As explained in “Invoking guix graph”, the tool provides different graph
types, each at its own abstraction level.

The package graph is high-level, but as a side-effect it has this
artifact.

To developers it’s actually useful to see the graph of package objects.
There are cases where, with functions that return packages, you would
notice that you’re generating lots of package objects for the same
underlying derivation, which is super inefficient (in particular it
defeats memoization).

Most of the time, there’s exactly one package object for each
derivation; if not, that’s usually a bug.

> b) how there can be different package objects for the same package
>
> To my understanding, e.g. (gnu packages base) is loaded once, defining
> package object abcd once and assigning it to a variable. All packages
> referring to abcd use the some package object. So there should be only
> *one* package object.

(eq? foo (package (inherit foo))) => #false

Yet, these two packages map to the very same derivation.

HTH,
Ludo’.

  reply	other threads:[~2018-03-07 15:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-05  9:37 bug#30710: guix graph gives duplicate nodes Hartmut Goebel
2018-03-05 17:19 ` Ludovic Courtès
2018-03-06 20:28   ` Hartmut Goebel
2018-03-07 15:18     ` Ludovic Courtès [this message]
2018-03-09 10:09       ` Björn Höfling
2018-03-09 22:59         ` Ludovic Courtès
     [not found]           ` <20180310111335.53c3bb1b@alma-ubu>
2018-03-10 16:31             ` Hartmut Goebel
2018-03-12 14:27               ` 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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=87efkvsylg.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=30710@debbugs.gnu.org \
    --cc=h.goebel@crazy-compilers.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).