From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id AJBLLhQiHWILVgAAgWs5BA (envelope-from ) for ; Mon, 28 Feb 2022 20:27:16 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id CAocJxQiHWKcfwEAG6o9tA (envelope-from ) for ; Mon, 28 Feb 2022 20:27:16 +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 4DA281C8C6 for ; Mon, 28 Feb 2022 20:27:16 +0100 (CET) Received: from localhost ([::1]:54394 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nOl6x-0001k8-QT for larch@yhetil.org; Mon, 28 Feb 2022 13:51:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56836) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nOl6b-0001hh-MH for guix-devel@gnu.org; Mon, 28 Feb 2022 13:50:47 -0500 Received: from [2a02:1800:110:4::f00:19] (port=41150 helo=laurent.telenet-ops.be) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nOl6Z-00022z-6R for guix-devel@gnu.org; Mon, 28 Feb 2022 13:50:45 -0500 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by laurent.telenet-ops.be with bizsmtp id 0iqb2700g4UW6Th01iqcCM; Mon, 28 Feb 2022 19:50:38 +0100 Message-ID: <752f9901f6c3c813b5553534aefc2e4e8f5aad63.camel@telenet.be> Subject: Re: Faster "guix pull" by incremental compilation and non-circular modules? From: Maxime Devos To: Ludovic =?ISO-8859-1?Q?Court=E8s?= Date: Mon, 28 Feb 2022 19:50:28 +0100 In-Reply-To: <875yozdta6.fsf@gnu.org> References: <2067ba1e606855eace261fd0b0ae9721b369bbd5.camel@telenet.be> <878ru5epyv.fsf@elephly.net> <753ba5897ed397b5e95175cd139137975245945b.camel@telenet.be> <875yozdta6.fsf@gnu.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-16ug3kP59UCDioQNz5pD" 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=1646074238; bh=fwuDzkaXyv6LT69LgafNBDGJkA+54GnSQUQpeCGp3Dk=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=NJrGjj3e7yUOZAuQabWji37zOz2+9sQehgRNdV8W5TrDjVD2C4qEVmK+a4dBEVzdR fV4Ocaw9bd58XX0W/Rx0vtwssEpAiqgqhq77/lK0th1A7zTgPAemjHx2BQjrGmnPgC Sgesd/0BOCQ5MNtbqvOIosFaEX5vDQbnQqlf/xGUOfYeEnKQitjHiJAOh+R8Cf/Mju LYFvZEeC0d8oeWUvN984UJ0Qd4CuyYEcAQUjYSSPU6AjePLLX7CqV63ArIvh4hn4bk 8Otal2qvvViF3tcgzKpncnJXcY8wjzLexDTjfbM3hy5abHRIfhQojj5vgALnZkbi9Z TiR70LGZO0Wkw== X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a02:1800:110:4::f00:19 (failed) Received-SPF: pass client-ip=2a02:1800:110:4::f00:19; envelope-from=maximedevos@telenet.be; helo=laurent.telenet-ops.be X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ricardo Wurmus , guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1646076436; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=fwuDzkaXyv6LT69LgafNBDGJkA+54GnSQUQpeCGp3Dk=; b=O6xX2BEVb4+Mo2jzk7sPEDb3/MAzcg6dBFwmfVB1dapRrjDzglFPb73GjRxssf87i01YZ5 Oo/zcKhOOM8jBupQZpSMCvGrraGWp0IxRGnQl+Xjk0bYSrxZs43xpJVRqteljTK3d3m6oH e7VZk3FN+lg3EEVxhYwL/Ho0weQHDqD70zw5ij9FAounhKgaMouRJ8zvtK29z1qWxf4shc j97zfQ7lk5Chpgbm4ZB1OwBG4cXmW8gbKByIvwwh9rmUJveP4Rt4laqeQ7Fi/cUIdGYF/4 JIyoaKLobMPIAGk5J/pY6dj9oB3U7Vj/p4oo9qZFFzEWB8JQ6vLd9rfTRzawRg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1646076436; a=rsa-sha256; cv=none; b=D6pT0fAWOlZmh2xr7uIVRQPlahN7KHNFjE1qc7Y4evXta9cEaCU1Da1I+KwUS2pqQTntqE b8CnsQsvCp3oX/fCiY8H7Xss032ztsxqliLBkUiVZlLoHoH2cirQOt1HxhVpoRCqm7VrxJ ZJyo7ByhI8URldX1GSHnaNPO7Wy6oaSHD3gqCWnflkeFFbWVQn1ftP44hBRZ/J2pD7DqAY uJG8ywAi0tbO2Cu9Ix0fdf5ZpkbQlDXSBpWz4ri7azbxzXnsrW6gh2tVGxc8eRjWh/4Itu M8e8gtQVGXuhmsfzfXe/f65ddpWR3CyaxuFEbI24+kIyyGdpxhI7HC2VWZKgzA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=NJrGjj3e; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 4.71 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=NJrGjj3e; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 4DA281C8C6 X-Spam-Score: 4.71 X-Migadu-Scanner: scn0.migadu.com X-TUID: 8O3Dhfli6nmL --=-16ug3kP59UCDioQNz5pD Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s schreef op ma 28-02-2022 om 14:17 [+0100]: > Hi, >=20 > Maxime Devos skribis: >=20 > > =C2=A0=C2=A02. Instead of building all of Guix as a single derivation, > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0create a DAG of derivations. More concre= tely: > >=20 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0First read the *.scm files to determine w= hich module imports > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0which modules. Then to compile, say, (gnu= packages acl), > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0a derivation taking gnu/packages/acl.scm = and its dependencies > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0gnu/packages/attr.go, gnu/packages/base.g= o, ... is made > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0compiling gnu/packages/acl.scm to a gnu/p= ackages/acl.go. > >=20 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0Then to build all of Guix, 'union-build' = or 'file-union' is used. >=20 > This is what (guix self), used by =E2=80=98guix pull=E2=80=99, is already= doing. >=20 > However, currently, package modules are split in just two groups: the > =E2=80=9Cbase=E2=80=9D group is the closure of (guix packages base), and = the second > group has all the rest: >=20 > [...] Looking at (guix self), it also has a few groups for non-package modules (system tests, scripts, ...). > At its core though, the situation pretty much reflects the free software > situation: there are low-level packages (glibc, GCC, GTK, etc.) that > might depend on high-level packages (Python, Pandoc, Rust, etc.). >=20 > It=E2=80=99s not easy to split this spaghetti ball in smaller groups. It's not easy to manually split the spaghetti, but we don't have to, we could let the computer=C2=A0split the spaghetti for us (at least partially, because of the circular imports), by computing the graph of strongly-connected components and considering each SCC to be a =E2=80=98gro= up=E2=80=99, some of which depend on other groups, forming a DAG. I believe Ricardo Wurmus has some script for computing the SCC? Splitting large SCC in smaller parts can be left as an exercise for later, it's a somewhat orthogonal concern. > Thoughts? I think it would be nice to let (guix self) automatically determine the DAG of groups. It would reduce the ad-hocness of the *...-modules* variables (some care required for patches, guix/man-db.scm, .js ...). It would also make the node tree wide, which could reduce memory usage (which might help with the =E2=80=98guix pull segfaults on i686-linux=E2=80= =99 reports). In case of a crash (*), "guix pull" does not have to start over from scratch, which would also help with those reports. (*) This does not help with "failed to compute the derivation of Guix". Some work would be required, but I think it will be worth it, and it only has to be done once. TBC, this was just an idea I wanted to share, I won't be working on it in the forseeable future. Greetings, Maxime. --=-16ug3kP59UCDioQNz5pD 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+4iGRcl7gUCYh0ZdBccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7p99AP4qrAsPHPSatAbfaV2iKWR5WlJH sR/EcTSch0U09Kqc8QD7BYGkli63t7w2EZsoHo32N2/ZAAj048pw6fM2342W9Qw= =6h4X -----END PGP SIGNATURE----- --=-16ug3kP59UCDioQNz5pD--