From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id MDB+IV4cPGLmZAEAgWs5BA (envelope-from ) for ; Thu, 24 Mar 2022 08:23:10 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 2GIAH14cPGL59AAA9RJhRA (envelope-from ) for ; Thu, 24 Mar 2022 08:23:10 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 39AB4DF59 for ; Thu, 24 Mar 2022 08:23:10 +0100 (CET) Received: from localhost ([::1]:33968 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nXHoK-0004ML-Qk for larch@yhetil.org; Thu, 24 Mar 2022 03:23:08 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39538) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXHoE-0004Lw-Fa for guix-patches@gnu.org; Thu, 24 Mar 2022 03:23:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52793) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nXHoE-0006PT-6t for guix-patches@gnu.org; Thu, 24 Mar 2022 03:23:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nXHoE-0004Pe-1H for guix-patches@gnu.org; Thu, 24 Mar 2022 03:23:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54539] [PATCH 0/6] Start breaking up import cycles Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 24 Mar 2022 07:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54539 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos , 54539@debbugs.gnu.org Received: via spool by 54539-submit@debbugs.gnu.org id=B54539.164810654016897 (code B ref 54539); Thu, 24 Mar 2022 07:23:01 +0000 Received: (at 54539) by debbugs.gnu.org; 24 Mar 2022 07:22:20 +0000 Received: from localhost ([127.0.0.1]:46690 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXHnY-0004OT-At for submit@debbugs.gnu.org; Thu, 24 Mar 2022 03:22:20 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:13846) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXHnQ-0004OE-MX for 54539@debbugs.gnu.org; Thu, 24 Mar 2022 03:22:18 -0400 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4KPGrJ3QRkz1LXt4; Thu, 24 Mar 2022 08:22:08 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4KPGrJ3QRkz1LXt4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1648106528; bh=u6Huo7rr9c1V4JrVmaG5yzmUN80rh8K/BVxDksbeSy4=; h=Subject:From:To:Date:In-Reply-To:References:From; b=AQgfwbLct+DPaCXxLhGLZytgRLseOBNIKyLgF8a9OAu7nCOlPPbNmj1yEK5DINe2m Po/YfmzDcuqvigtFkaRrB3kbyZfmkEBqJTXAtq/wwzORAqDsnK9/JwbrY4Y4LNNRaX hLbsRTYdIex8drr9YsQd19LLfPYt5Dc7U8D/q1iU= Message-ID: <5ab234b577c15dd50c36aaf427cce593404b52dc.camel@ist.tugraz.at> From: Liliana Marie Prikler Date: Thu, 24 Mar 2022 08:22:09 +0100 In-Reply-To: References: <5a87d6f772ff7424cb6fccea7c45276bef7797aa.camel@telenet.be> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1648106590; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=u6Huo7rr9c1V4JrVmaG5yzmUN80rh8K/BVxDksbeSy4=; b=eHTgpu2P6NjLq9jjDoG4kqrIeZNhzpR+P1qcDn4KJkjpuH5lyjfNYvb4FcHo4x6PP2Rrhv JWYwrJW492UbdgDG2Ba9NVeRujclKr1ZzeNNVxtbGQJEZG0OZj7QF2cmGAqZecBZGbXj4K ij3PAVsU6mDeXzfbErZb/7ecop0ij4zuKrA7H/tIRnUeIS4svtTSEHbmLFKXqCOR/nOb/J 47gelmuOUoLhsXJ4QFsmxFGRiy5RVYUVySULimR5XBYTT4Obj0SqNazfDANPKoydMJcJlL NtXQHNFqj046yZYFurWT/a8WEx7EBzHdae7r/0uM6lerCIW5LoYghxzWRAqb5w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1648106590; a=rsa-sha256; cv=none; b=DfR8DiY+dQGbcfm9oNs88nW2xZGt8XYdW0Gtt9V8sPIWjqRrCDEwxd+XzZ2qxun2QAP7Pa w3sN41e6apsSCUCdXnaN5mEKYeTfC/CjJHoQHVdArMlIN2FVL7yTl01Y71VcgSG07Ktq7y R7GwTOwzwyzh279XwK3Vfok14G0mgBipcLYeuSGOsJm2+fZ1al7qtBdt9ZxS7wRRDeUIuh xJUrwNX7bk/P+VdhBKyHD0GsODw9UiwaTYSpmhQVd+EI2Ong4v+nM5kUyHIp0OifNrT/4N J1Q04JTbDn48DcFFiHr69VdsImXt3VWwsGH379YizPnXRhQmwA7Wq6sjiNAdJw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tugraz.at header.s=mailrelay header.b=AQgfwbLc; dmarc=fail reason="SPF not aligned (relaxed)" header.from=tugraz.at (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 5.71 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tugraz.at header.s=mailrelay header.b=AQgfwbLc; dmarc=fail reason="SPF not aligned (relaxed)" header.from=tugraz.at (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 39AB4DF59 X-Spam-Score: 5.71 X-Migadu-Scanner: scn1.migadu.com X-TUID: va5qHFBGv4X7 Hi Maxime, Am Mittwoch, dem 23.03.2022 um 19:49 +0100 schrieb Maxime Devos: > Maxime Devos schreef op wo 23-03-2022 om 19:46 [+0100]: > > Import cycles make some packaging things harder and prevent some > > proposed optimisations to "guix pull", let's start eliminating > > them. > > TBC ... > > The copyright lines are based on a mix of "git blame" and "git log -- > grep the-package"; I might have missed some people ... I agree that breaking up cycles is a good thing, but I disagree with some of the decisions you've made here. For instance, I oppose the use of single-package modules, because those more often than not simply clutter the file system. I'm not sure if Guile's #:autoload could do anything to fix these issues (I suppose not), but long term I think guile modules should support a style that is basically (resolve-interface) + (module-ref) in the manner Guix needs, but declaratively. While we do not have that in place yet, I suggest something like the following: (define (check-package-ref pkg) (module-ref (resolve-interface '(gnu packages check)) pkg)) ... or (define check-package-ref (let ((iface (resolve-interface '(gnu packages check)))) (lambda (pkg) (resolve-interface iface pkg)))) I'm not sure if the second will have the intended effect. It appears to me as though the key to breaking these cycles is moving them into a context that is not evaluated on the top of the file, e.g. a thunked field or in the case of my first suggestion a procedure. In either case, declaring all these lazy dependencies near the module definition would have the added benefit, that people could see them being lazily imported and thus no longer need the #:use-modules comment. WDYT?