From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id SFf3Hf+FXmLe6wAAbAwnHQ (envelope-from ) for ; Tue, 19 Apr 2022 11:50:55 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id aEDzHf+FXmKrKgAAauVa8A (envelope-from ) for ; Tue, 19 Apr 2022 11:50:55 +0200 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 28C8E353D1 for ; Tue, 19 Apr 2022 11:50:55 +0200 (CEST) Received: from localhost ([::1]:60314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ngkVZ-0007ek-Qd for larch@yhetil.org; Tue, 19 Apr 2022 05:50:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41910) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ngkM2-0005lp-Vo for guix-patches@gnu.org; Tue, 19 Apr 2022 05:41:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:47773) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ngkM2-0004SY-9K for guix-patches@gnu.org; Tue, 19 Apr 2022 05:41:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ngkM2-000548-50 for guix-patches@gnu.org; Tue, 19 Apr 2022 05:41:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54539] [PATCH 0/6] Start breaking up import cycles Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 19 Apr 2022 09:41:02 +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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 54539@debbugs.gnu.org Received: via spool by 54539-submit@debbugs.gnu.org id=B54539.165036124919447 (code B ref 54539); Tue, 19 Apr 2022 09:41:02 +0000 Received: (at 54539) by debbugs.gnu.org; 19 Apr 2022 09:40:49 +0000 Received: from localhost ([127.0.0.1]:41670 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ngkLo-00053b-U9 for submit@debbugs.gnu.org; Tue, 19 Apr 2022 05:40:49 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:41968) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ngkLm-00053S-Mw for 54539@debbugs.gnu.org; Tue, 19 Apr 2022 05:40:47 -0400 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by xavier.telenet-ops.be with bizsmtp id LZgk2700c4UW6Th01ZgkrU; Tue, 19 Apr 2022 11:40:45 +0200 Message-ID: From: Maxime Devos Date: Tue, 19 Apr 2022 11:40:39 +0200 In-Reply-To: <875yn5totd.fsf@gnu.org> References: <5a87d6f772ff7424cb6fccea7c45276bef7797aa.camel@telenet.be> <875yn5totd.fsf@gnu.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-AKWquGh7SdQzh7AbUZ/v" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1650361245; bh=+4aDE15kYIeqnOn6sfsFF9Y+orjyIS9/MeOY6WA1rVM=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=RA3y74FF5UdXbgXHJhdeGe3XFWB7uRmmpIbX6mbka/U07we+eJxVHpIMWBWl0HZyt HCFYUeCxNcwWniPpXErF52o7k8KE46G17flWCcQa6ukZ0c1Fg2CmPfDztO/VzuYJuG +rgEY7DH+PxY8Cr57DOFKFT9hbB2qVOGoORNEmDwqvwgukNjJKv+fqVh8cVNhD2ezA uinc236rkiZO8cO/q1bD/8/e643PtjpcTZYZkIPdFiaDiWQeeTWbb8VMSOkZh1iweq ta8/wNskIzxUC2Cf7BEhvOTuvbA/itbsWUvvuhoZbrzJdV6MV7kMBXR/AHafG1UQZV 7RXkAX7EAVo4Q== 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=1650361855; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: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=+4aDE15kYIeqnOn6sfsFF9Y+orjyIS9/MeOY6WA1rVM=; b=XBGYrdRgb30lAlYQo+tJ9TyiL8ed+L0toknvRHpzL8CFVxnpIa9lVXuZoXRBZphhUYTcRA b0se3iiVZ37yCUaQBZTORY+Ad/ohJcfuNW0KQjARy5QC6Zag1oTioJWnVEz/QqwTQuCvvi lPW2Q6KAM+2QmOTN+h7XnaAyQZ/xceJYxl4uoYlfKz/JIEni9/aiHdoaNu74ovG1eSu8O5 JBSM3pX8DUrQ5p9AOicMD5l5NsvnfACrZ0HgxYsv1Enw4qauWLrCucQDRwFQkuKqAXK8cc Q9bpjLwSzmyhE/zGKBmgLNchD7z6qin67e1feyDSb7QHnSRA0xcalDssBdN+nQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1650361855; a=rsa-sha256; cv=none; b=MNOZjPvHX+Qoc7N6J47dru9VRm44gOgYIn2Kigc9eNiAEM0hV4w+BWImqX6EMCPviJCY6s VCD6FHQAFovwfXFCHXDBskLfOYnPZFVXC+8ZChBH/xT/llwe9dc8AIb2sLL4fNxL97iI4T 6YGh43qr6lUnuzRbacdcS+5K/gv9M0kqP2lWQomRQKyyj9IVxW8ToBCLdVIrRouHwHzrja 33q+46mxSBPZMzM2ohTIC2DOGN0GOdUc4TEoiMR/UJv3ZAbpF9OTprNshMXgGU7ygyYM/z NYi0oD7D9MfPQqUsMUFQtwVHC1jSdLAJrgQ7R/srR/Jjmt14Eh4jK1ABhRcXrg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=RA3y74FF; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (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: 3.86 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=RA3y74FF; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (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: 28C8E353D1 X-Spam-Score: 3.86 X-Migadu-Scanner: scn1.migadu.com X-TUID: uahJuFmy/wd6 --=-AKWquGh7SdQzh7AbUZ/v Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s schreef op di 19-04-2022 om 11:17 [+0200]: > If you follow the logic, breaking up import cycles would mean, in the > end, having one file per package. Not necessarily, (gnu packages minetest) has multiple packages (minetest and some of its mods) but it doesn't cause any cycles (no other module, except sort-of (guix build-system minetest), imports it.) That one appears to be, at least currently, a bit of a special case though. > But would that be enough? Probably not, because low-level packages > are bound to depend on high-level packages=E2=80=94e.g., glibc depends on > Python, some other low-level tool might depend on Pandoc (GHC), > librsvg depends on Rust, and so on. > > IOW, since the graph of build dependency really is a graph, and not a > tree, there=E2=80=99ll always be import cycles. The graph of build dependencies (in terms of derivations) is a tree, the build daemon doesn't allow cyclic derivations. So I think that by letting the module graph be a coarser version of the derivation graph but still a tree (except for the bootstrap packages gcc, sed, ... whose modules may import each other). > (guix self), the module that =E2=80=98guix pull=E2=80=99 uses, already au= tomatically > splits package modules into two groups.=C2=A0 It=E2=80=99s not as modular= as we=E2=80=99d > like, but it=E2=80=99s a start.=C2=A0 What would be useful is to come up = with metrics > and tools to reduce the closure of the =E2=80=9Cguix-packages-base=E2=80= =9D group. >=20 > WDYT? Maybe: a tool that determines a minimal set of (importing module -> imported module tuples) that needs to be lazified to reduce the closure size (in number of modules) in guix-packages-base by N and: extend "guix style" to perform these changes Maybe the =E2=80=98number of imports lazified -> number of modules in guix- packages-base=E2=80=99 function has some sweet spot somewhere. I think it would be easier though to work our way up before going to "guix pull" -- first "hello", then "util-linux, then "guile-avahi", then "guile-ssh", then "sqlite" ... and only eventually guix itself. Also, even if the closure of "guix-packages-base" cannot be reduced, making it (mostly) a tree would allow splitting the group into multiple parts (see =E2=80=98Faster "guix pull" by incremental compilation and non- circular modules?=E2=80=99). Alternative: * make _all_ package module imports lazy -- #:autoload everything! guix-packages-base might then need to be set manually though ... Greetings, Maxime. --=-AKWquGh7SdQzh7AbUZ/v Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYl6DlxccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7uCKAP9AakyPVN5WEsiyo9aUZWB/g0fn nYlZDEMAaoD83b5HnQEAu5Ubu6GcAK8hwD0KSRj/AECHY8juz25R8UCqKHJGWwo= =xTeP -----END PGP SIGNATURE----- --=-AKWquGh7SdQzh7AbUZ/v--