From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 5z5qHQuwaWIdQAEAbAwnHQ (envelope-from ) for ; Wed, 27 Apr 2022 23:05:15 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id cN0xHAuwaWJtoAAA9RJhRA (envelope-from ) for ; Wed, 27 Apr 2022 23:05:15 +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 E426835F30 for ; Wed, 27 Apr 2022 23:05:14 +0200 (CEST) Received: from localhost ([::1]:47876 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1njoqX-0002kf-IF for larch@yhetil.org; Wed, 27 Apr 2022 17:05:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52074) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1njoqN-0002kX-OB for guix-patches@gnu.org; Wed, 27 Apr 2022 17:05:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50680) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1njoqM-00084F-LE for guix-patches@gnu.org; Wed, 27 Apr 2022 17:05:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1njoqM-0004zh-FR for guix-patches@gnu.org; Wed, 27 Apr 2022 17:05:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54539] [PATCH 0/6] Start breaking up import cycles Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 27 Apr 2022 21:05: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: Maxime Devos Cc: 54539@debbugs.gnu.org Received: via spool by 54539-submit@debbugs.gnu.org id=B54539.165109349819186 (code B ref 54539); Wed, 27 Apr 2022 21:05:02 +0000 Received: (at 54539) by debbugs.gnu.org; 27 Apr 2022 21:04:58 +0000 Received: from localhost ([127.0.0.1]:44577 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1njoqH-0004zK-NP for submit@debbugs.gnu.org; Wed, 27 Apr 2022 17:04:58 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58746) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1njoqF-0004z3-Vm for 54539@debbugs.gnu.org; Wed, 27 Apr 2022 17:04:56 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37184) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1njoqA-00082V-GB; Wed, 27 Apr 2022 17:04:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=dRCbLDAMRerJEBFmY4dRiUsRLKnaI2jDhZjFxSrpdH0=; b=VlXKPfdRSx169T+IOD77 ywcf+N8CwPBjEVzR323LJJnYLfw/5XlVJ3Iw+59EFIwJwokG/ySBX65Y8WW+GsmGZYj2gHr/vrfAM zEHMaUyHY4fV4SPttK2c1l4Gkv7TCc6bnK7sxU0INlF0wI4jwNoDkU76wMns5VIAUU26oU8J4IT1X kdHxBXOKyVko2E0xjTpIRhVyi3EHWdThQr+tCBSBbcH2Q+YOP6HQGT9XyFsZPGfMnicHyvvKi75BY 48QiDAk6iP7bEgLZK7hBNQkFP24Ds56BRZxsAp/pjCtPGCtw1XIfkxcvlmtCUtmZ8XQPJLSYObtRi MKrhb9oiOfzTRA==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=38882 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1njoqA-0003xY-3e; Wed, 27 Apr 2022 17:04:50 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <5a87d6f772ff7424cb6fccea7c45276bef7797aa.camel@telenet.be> <875yn5totd.fsf@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 8 =?UTF-8?Q?Flor=C3=A9al?= an 230 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: Wed, 27 Apr 2022 23:04:47 +0200 In-Reply-To: (Maxime Devos's message of "Tue, 19 Apr 2022 11:40:39 +0200") Message-ID: <87h76ei6fk.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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=1651093515; 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: 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=dRCbLDAMRerJEBFmY4dRiUsRLKnaI2jDhZjFxSrpdH0=; b=Q62X0IxkzQrHEAbnbpwB2IlQzcjYeV9fHT97hwmodvRNuZ5WT1oOIDB6EBfKrLXWbpi3jN kspnyDIXXZnJw47PwnBo88zmhXF991iPtlpBUlpmuP9ojMRsSi0M7/qe1lHh26Pyh2tjDP StfB2WpPIMf2VyKCSeKbhdpSj80F5ucuXKjX0D7xW4vxqKtY8cs2MPWrHW1xpDqv+iqeRw n7wCY8DUW6a+4pReyXMnidT7mEgnbVDaBh+kuRO6mDnVeYQgin+xs+T7HH/P2nULspvFWx 9oGh3kJxFXDbLsJ6uwHJWf8QLX2NdReRfT+fcgyanKZRjVXHOwIE1NU0UKA0Bg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1651093515; a=rsa-sha256; cv=none; b=hNlIVAPESJ4PL61q8OabeYeVDJj99xcbPbK7SmtGovyYEf65gqkv5/JdXQ3fI0O2xJqIM/ OBOxQde9PwLpnwK+tEMXs1GQEUAshyUEQSBS0ZlyG9gzLmizLcgRSfzJ3Zn4u42+55+ooq Z966HT5laFXIKPCzx2DcAIQVQWcGXMspbKkJa86O7U8J8mYSzBCroGoHKA2qGIU1NeXhuO 3+lWOh2YsN75uqcf0JvQRPyO2vfWEvwfwEbxUGKANod5IyVGIvOyWV+KOV1BzQ3/SqLhwy CqIRi5t/kZEpAdsQX8QQnhuguOrESLz60ZxATpfaOHLslwkmWgMOVV+pBO2tfw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=VlXKPfdR; dmarc=pass (policy=none) header.from=gnu.org; 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.30 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=VlXKPfdR; dmarc=pass (policy=none) header.from=gnu.org; 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: E426835F30 X-Spam-Score: -5.30 X-Migadu-Scanner: scn0.migadu.com X-TUID: elqeBTsdOnkz Maxime Devos skribis: > 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. I think so. All the historical package modules started that way. >> 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, It=E2=80=99s a directed acyclic graph (DAG), not 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). I thought so, but came to the conclusion that it=E2=80=99s hardly feasible = in practice. >> (guix self), the module that =E2=80=98guix pull=E2=80=99 uses, already a= utomatically >> splits package modules into two groups.=C2=A0 It=E2=80=99s not as modula= r 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 Currently =E2=80=98source-module-closure=E2=80=99 considers #:autoloaded mo= dules as part of the closure; we could change that though and indeed, that might prove helpful in this case. > and: > > extend "guix style" to perform these changes > > Maybe the =E2=80=98number of imports lazified -> number of modules in gui= x- > packages-base=E2=80=99 function has some sweet spot somewhere. Could be. > 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 ... I don=E2=80=99t know, having spent some time on this, I feel like there=E2= =80=99s no easy solution. But it could be that using autoloads at least in the right places would help shrink =E2=80=98guix-packages-base=E2=80=99. Worth= a try! Ludo=E2=80=99.