GNU bug report logs - #37586
Import cycles in unrelated packages should not be an error

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix; Reported by: "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN>; dated Wed, 2 Oct 2019 17:16:01 UTC; Maintainer for guix is bug-guix@HIDDEN.

Message received at 37586 <at> debbugs.gnu.org:


Received: (at 37586) by debbugs.gnu.org; 6 Oct 2019 10:40:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 06 06:40:19 2019
Received: from localhost ([127.0.0.1]:45642 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iH3xb-0008DM-9L
	for submit <at> debbugs.gnu.org; Sun, 06 Oct 2019 06:40:19 -0400
Received: from pelzflorian.de ([5.45.111.108]:43466 helo=mail.pelzflorian.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pelzflorian@HIDDEN>) id 1iH3xZ-0008DD-8E
 for 37586 <at> debbugs.gnu.org; Sun, 06 Oct 2019 06:40:18 -0400
Received: from pelzflorian.localdomain (unknown [5.45.111.108])
 by mail.pelzflorian.de (Postfix) with ESMTPSA id 109563602A4;
 Sun,  6 Oct 2019 12:40:14 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pelzflorian.de;
 s=mail; t=1570358415;
 bh=Y4mASjZzHNVW94odRjBCNoHjijug7Jbv1wq38UwvJKQ=;
 h=Date:From:To:Cc:Subject:References:In-Reply-To;
 b=my9LdelEE70oFsRHIozZC9svjnofktBGyx26oaTKhpDLwW3UMITZyFqpH1ZrLGfyU
 k6kcoQuQkghUekoYMmtUX6zRnWQ3l8iUcYv80BoKyNqhEqZyMN+xXkZtvOAxQCxKTg
 4kSrFGVOmkKJXjU8aMI15vzBhYHWp9ahTP4TMzwY=
Date: Sun, 6 Oct 2019 12:40:14 +0200
From: "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: bug#37586: Import cycles in unrelated packages should not be an
 error
Message-ID: <20191006104014.oumwicescs7w3fe7@HIDDEN>
References: <20191002171547.ncb2hmujdwoxtquy@HIDDEN>
 <877e5ifb2c.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <877e5ifb2c.fsf@HIDDEN>
User-Agent: NeoMutt/20180716
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 37586
Cc: 37586 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Sun, Oct 06, 2019 at 12:00:27PM +0200, Ludovic Courtès wrote:
> "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN> skribis:
> > Is it possible to make import cycles not an error in Guix packages?
> 
> Unfortunately no, it’s fundamentally impossible.  When you have:
> 
>   (define-module (a) #:use-module (b))
>   (define-public var-a 42)
> 
> and:
> 
>   (define-module (b) #:use-module (a))
>   (define-public var-b (+ var-a 1))
> 
> you can understand that it will or will not work depending on whether
> (b) or (a) is loaded first.  This is what’s happening here.
> […]
> When you use ‘guix show’ or similar, that goes through the package cache
> created during ‘guix pull’, which allows Guix to load directly the
> module that contains the package.  That order could be different from
> the one you have in your checkout.
> 

Thank you for the explanation.  I now understand that eliminating the
error is not possible within define-module.  Currently, all packages
rely on define-module’s “global” #:use-module form.  How about adding
an alternative per-package, “local” use-module, to load and unload the
dependent module just for this one package?  It appears to be
preferrable to splitting modules.  Is it worth it?

Regards,
Florian




Information forwarded to bug-guix@HIDDEN:
bug#37586; Package guix. Full text available.

Message received at 37586 <at> debbugs.gnu.org:


Received: (at 37586) by debbugs.gnu.org; 6 Oct 2019 10:00:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 06 06:00:38 2019
Received: from localhost ([127.0.0.1]:45621 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iH3LC-0007Do-3W
	for submit <at> debbugs.gnu.org; Sun, 06 Oct 2019 06:00:38 -0400
Received: from eggs.gnu.org ([209.51.188.92]:37527)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1iH3L8-0007D6-FS
 for 37586 <at> debbugs.gnu.org; Sun, 06 Oct 2019 06:00:36 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:54571)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1iH3L3-0003cL-6l; Sun, 06 Oct 2019 06:00:29 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36876 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1iH3L2-0007pX-Ly; Sun, 06 Oct 2019 06:00:29 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: "pelzflorian \(Florian Pelz\)" <pelzflorian@HIDDEN>
Subject: Re: bug#37586: Import cycles in unrelated packages should not be an
 error
References: <20191002171547.ncb2hmujdwoxtquy@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 15 =?utf-8?Q?Vend=C3=A9miaire?= an 228 de la
 =?utf-8?Q?R=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Sun, 06 Oct 2019 12:00:27 +0200
In-Reply-To: <20191002171547.ncb2hmujdwoxtquy@HIDDEN>
 (pelzflorian@HIDDEN's message of "Wed, 2 Oct 2019 19:15:47
 +0200")
Message-ID: <877e5ifb2c.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 37586
Cc: 37586 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi Florian,

"pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN> skribis:

> I am annoyed by another import cycle similar to
> <https://issues.guix.info/issue/37346> in an unfinished package I=E2=80=
=99m
> writing.  They needlessly complicate packaging and make packagers
> split modules that logically should not be split.

I agree that this is annoying.

> Is it possible to make import cycles not an error in Guix packages?

Unfortunately no, it=E2=80=99s fundamentally impossible.  When you have:

  (define-module (a) #:use-module (b))
  (define-public var-a 42)

and:

  (define-module (b) #:use-module (a))
  (define-public var-b (+ var-a 1))

you can understand that it will or will not work depending on whether
(b) or (a) is loaded first.  This is what=E2=80=99s happening here.

> These errors do not surface during module compilation but only when
> running guix show or guix build or similar.  I suppose that means
> changing the way they are evaluated could make packages not care about
> dependencies in unrelated packages that just happen to be in the same
> module, could it?

When you use =E2=80=98guix show=E2=80=99 or similar, that goes through the =
package cache
created during =E2=80=98guix pull=E2=80=99, which allows Guix to load direc=
tly the
module that contains the package.  That order could be different from
the one you have in your checkout.

Thanks,
Ludo=E2=80=99.




Information forwarded to bug-guix@HIDDEN:
bug#37586; Package guix. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 2 Oct 2019 17:15:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 02 13:15:58 2019
Received: from localhost ([127.0.0.1]:38250 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iFiEI-0005S6-5g
	for submit <at> debbugs.gnu.org; Wed, 02 Oct 2019 13:15:58 -0400
Received: from lists.gnu.org ([209.51.188.17]:43877)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pelzflorian@HIDDEN>) id 1iFiEG-0005Rx-79
 for submit <at> debbugs.gnu.org; Wed, 02 Oct 2019 13:15:56 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:38363)
 by lists.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <pelzflorian@HIDDEN>) id 1iFiED-0007F3-HA
 for bug-guix@HIDDEN; Wed, 02 Oct 2019 13:15:55 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,DOS_RCVD_IP_TWICE_B
 autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <pelzflorian@HIDDEN>) id 1iFiEC-0004kd-BC
 for bug-guix@HIDDEN; Wed, 02 Oct 2019 13:15:53 -0400
Received: from pelzflorian.de ([5.45.111.108]:54676 helo=mail.pelzflorian.de)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <pelzflorian@HIDDEN>)
 id 1iFiEB-0004jk-RL
 for bug-guix@HIDDEN; Wed, 02 Oct 2019 13:15:52 -0400
Received: from pelzflorian.localdomain (unknown [5.45.111.108])
 by mail.pelzflorian.de (Postfix) with ESMTPSA id 310853602A4
 for <bug-guix@HIDDEN>; Wed,  2 Oct 2019 19:15:48 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pelzflorian.de;
 s=mail; t=1570036548;
 bh=JI2h17oT81k8Ow+EH6Po2eXtc2FtGF29Z9eawHBzSVc=;
 h=Date:From:To:Subject;
 b=oOzazpps6XymZVvtXMBjr5QDtkTBVsxhC9fgYIqqYde9xpfds5rF3lxd3ad672Qbg
 JDYgjE7QW5/JNMBEdwE6cj8MszbCzB5tjb1iiZr36SeKj/CXOyGFe30feoIm3ovYAE
 3wR04/pxDp4UO/11HNrxnN8gXCqdoBwFBCHaAqhw=
Date: Wed, 2 Oct 2019 19:15:47 +0200
From: "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN>
To: bug-guix@HIDDEN
Subject: Import cycles in unrelated packages should not be an error
Message-ID: <20191002171547.ncb2hmujdwoxtquy@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
User-Agent: NeoMutt/20180716
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-Received-From: 5.45.111.108
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

I am annoyed by another import cycle similar to
<https://issues.guix.info/issue/37346> in an unfinished package I=E2=80=99=
m
writing.  They needlessly complicate packaging and make packagers
split modules that logically should not be split.

Is it possible to make import cycles not an error in Guix packages?

These errors do not surface during module compilation but only when
running guix show or guix build or similar.  I suppose that means
changing the way they are evaluated could make packages not care about
dependencies in unrelated packages that just happen to be in the same
module, could it?

Regards,
Florian




Acknowledgement sent to "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guix@HIDDEN. Full text available.
Report forwarded to bug-guix@HIDDEN:
bug#37586; Package guix. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.