From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#30710: guix graph gives duplicate nodes Date: Wed, 07 Mar 2018 16:18:51 +0100 Message-ID: <87efkvsylg.fsf@gnu.org> References: <86fb9895-768a-bea0-154c-070861c0bb1d@crazy-compilers.com> <87d10i8mpb.fsf@gnu.org> 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]:33712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etarN-0008JL-HZ for bug-guix@gnu.org; Wed, 07 Mar 2018 10:20:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etarK-0003UJ-9W for bug-guix@gnu.org; Wed, 07 Mar 2018 10:20:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:41775) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etarK-0003Ts-6s for bug-guix@gnu.org; Wed, 07 Mar 2018 10:20:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1etarK-0000T5-06 for bug-guix@gnu.org; Wed, 07 Mar 2018 10:20:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: (Hartmut Goebel's message of "Tue, 6 Mar 2018 21:28:31 +0100") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Hartmut Goebel Cc: 30710@debbugs.gnu.org Hello, Hartmut Goebel skribis: >> This is expected. Strictly speaking, we=E2=80=99re talking about two di= fferent >> package objects, hence the different IDs. > > I wonder > > a) whether it is useful to have different graph nodes for the same packag= e. > > 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 =E2=80=9CInvoking guix graph=E2=80=9D, the tool provides di= fferent 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=E2=80=99s actually useful to see the graph of package obje= cts. There are cases where, with functions that return packages, you would notice that you=E2=80=99re generating lots of package objects for the same underlying derivation, which is super inefficient (in particular it defeats memoization). Most of the time, there=E2=80=99s exactly one package object for each derivation; if not, that=E2=80=99s 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))) =3D> #false Yet, these two packages map to the very same derivation. HTH, Ludo=E2=80=99.