From unknown Wed Aug 20 06:04:21 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#29181] [PATCH core-updates 0/1] Shrink Mesa Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 Nov 2017 21:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 29181 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 29181@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.151000448631881 (code B ref -1); Mon, 06 Nov 2017 21:42:01 +0000 Received: (at submit) by debbugs.gnu.org; 6 Nov 2017 21:41:26 +0000 Received: from localhost ([127.0.0.1]:54697 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eBp94-0008I9-Bv for submit@debbugs.gnu.org; Mon, 06 Nov 2017 16:41:26 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56349) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eBp92-0008Hw-Uw for submit@debbugs.gnu.org; Mon, 06 Nov 2017 16:41:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eBp8w-0003pk-Kr for submit@debbugs.gnu.org; Mon, 06 Nov 2017 16:41:19 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:42780) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eBp8w-0003pd-I5 for submit@debbugs.gnu.org; Mon, 06 Nov 2017 16:41:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eBp8v-0004RQ-9l for guix-patches@gnu.org; Mon, 06 Nov 2017 16:41:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eBp8u-0003oz-70 for guix-patches@gnu.org; Mon, 06 Nov 2017 16:41:17 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52441) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eBp8r-0003nS-Gk; Mon, 06 Nov 2017 16:41:13 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=57686 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eBp8q-0007wM-UJ; Mon, 06 Nov 2017 16:41:13 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Mon, 6 Nov 2017 22:40:57 +0100 Message-Id: <20171106214057.12590-1-ludo@gnu.org> X-Mailer: git-send-email 2.14.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Hello Guix! This patch divides the nar size of ‘mesa’ (as reported by ‘guix size’) almost by a factor of four. It does so by replacing hard links created upon “make install” with symlinks. The new post-install phase prints things like: --8<---------------cut here---------------start------------->8--- starting phase `symlinks-instead-of-hard-links' creating 7 symlinks to '/gnu/store/l1iwgjgp88snlzp9nafdpd0vvsqv7lsi-mesa-17.2.1/lib/dri/i915_dri.so' creating 3 symlinks to '/gnu/store/l1iwgjgp88snlzp9nafdpd0vvsqv7lsi-mesa-17.2.1/lib/dri/i965_dri.so' creating 1 symlinks to '/gnu/store/l1iwgjgp88snlzp9nafdpd0vvsqv7lsi-mesa-17.2.1/lib/dri/nouveau_drv_video.so' creating 1 symlinks to '/gnu/store/l1iwgjgp88snlzp9nafdpd0vvsqv7lsi-mesa-17.2.1/lib/libXvMCnouveau.so.1.0.0' creating 2 symlinks to '/gnu/store/l1iwgjgp88snlzp9nafdpd0vvsqv7lsi-mesa-17.2.1/lib/vdpau/libvdpau_nouveau.so.1.0.0' phase `symlinks-instead-of-hard-links' succeeded after 0.0 seconds --8<---------------cut here---------------end--------------->8--- The nar size does not reflect disk usage since deduplication would recreate the hard links anyway, but it reflects how much we have to transfer over the wire since the nar format does not represent hard links. A similar problem arose with Git a while back, see . I’d like to push to ‘core-updates’. Thoughts? Ludo’. Ludovic Courtès (1): gnu: mesa: Use symlinks instead of hard links. gnu/packages/gl.scm | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) -- 2.14.2 From unknown Wed Aug 20 06:04:21 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#29181] [PATCH 1/1] gnu: mesa: Use symlinks instead of hard links. References: <20171106214057.12590-1-ludo@gnu.org> In-Reply-To: <20171106214057.12590-1-ludo@gnu.org> Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 Nov 2017 21:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29181 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 29181@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 29181-submit@debbugs.gnu.org id=B29181.151000459532117 (code B ref 29181); Mon, 06 Nov 2017 21:44:02 +0000 Received: (at 29181) by debbugs.gnu.org; 6 Nov 2017 21:43:15 +0000 Received: from localhost ([127.0.0.1]:54709 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eBpAp-0008Lx-2Q for submit@debbugs.gnu.org; Mon, 06 Nov 2017 16:43:15 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56967) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eBpAn-0008Li-Mm for 29181@debbugs.gnu.org; Mon, 06 Nov 2017 16:43:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eBpAe-0004OP-QA for 29181@debbugs.gnu.org; Mon, 06 Nov 2017 16:43:08 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52484) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eBpAc-0004Nr-GP; Mon, 06 Nov 2017 16:43:02 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=57742 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eBpAc-00087P-0d; Mon, 06 Nov 2017 16:43:02 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Mon, 6 Nov 2017 22:42:52 +0100 Message-Id: <20171106214252.12702-1-ludo@gnu.org> X-Mailer: git-send-email 2.14.2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) This reduces the nar size (as shown by 'guix size') by 124 MiB, from 169 MiB to 45 MiB (almost divided by 4!). * gnu/packages/gl.scm (mesa)[arguments]: Add #:modules. Add 'symlinks-instead-of-hard-links' phase. --- gnu/packages/gl.scm | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm index 5f96ab303..be0eddfdb 100644 --- a/gnu/packages/gl.scm +++ b/gnu/packages/gl.scm @@ -305,6 +305,10 @@ also known as DXTn or DXTC) for Mesa.") "--enable-llvm")) ; default is x86/x86_64 only (_ '("--with-dri-drivers=nouveau,r200,radeon,swrast")))) + #:modules ((ice-9 match) + (srfi srfi-1) + (guix build utils) + (guix build gnu-build-system)) #:phases (modify-phases %standard-phases (add-after @@ -339,6 +343,41 @@ also known as DXTn or DXTC) for Mesa.") ;; egl_gallium support. (("\"gbm_dri\\.so") (string-append "\"" out "/lib/dri/gbm_dri.so"))) + #t))) + (add-after 'install 'symlinks-instead-of-hard-links + (lambda* (#:key outputs #:allow-other-keys) + ;; All the drivers and gallium targets create hard links upon + ;; installation (search for "hardlink each megadriver instance" + ;; in the makefiles). This is no good for us since we'd produce + ;; nars that contain several copies of these files. Thus, turn + ;; them into symlinks, which saves ~124 MiB. + (let* ((out (assoc-ref outputs "out")) + (lib (string-append out "/lib")) + (files (find-files lib + (lambda (file stat) + (and (string-contains file ".so") + (eq? 'regular + (stat:type stat)))))) + (inodes (map (compose stat:ino stat) files))) + (for-each (lambda (inode) + (match (filter-map (match-lambda + ((file ino) + (and (= ino inode) file))) + (zip files inodes)) + ((_) + #f) + ((reference others ..1) + (format #t "creating ~a symlinks to '~a'~%" + (length others) reference) + (for-each delete-file others) + (for-each (lambda (file) + (if (string=? (dirname file) + (dirname reference)) + (symlink (basename reference) + file) + (symlink reference file))) + others)))) + (delete-duplicates inodes)) #t)))))) (home-page "https://mesa3d.org/") (synopsis "OpenGL implementation") -- 2.14.2 From unknown Wed Aug 20 06:04:21 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#29181] [PATCH 1/1] gnu: mesa: Use symlinks instead of hard links. Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 07 Nov 2017 19:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29181 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 29181@debbugs.gnu.org Received: via spool by 29181-submit@debbugs.gnu.org id=B29181.151008210921645 (code B ref 29181); Tue, 07 Nov 2017 19:16:01 +0000 Received: (at 29181) by debbugs.gnu.org; 7 Nov 2017 19:15:09 +0000 Received: from localhost ([127.0.0.1]:57010 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eC9L2-0005d3-W0 for submit@debbugs.gnu.org; Tue, 07 Nov 2017 14:15:09 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:47985) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eC9L1-0005cv-Dz for 29181@debbugs.gnu.org; Tue, 07 Nov 2017 14:15:07 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id DE65520964; Tue, 7 Nov 2017 14:15:06 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Tue, 07 Nov 2017 14:15:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=Yub7afbL2YqCI81VsT+kbMFDk5ck8SvVrShDWaCq2wo=; b=bOQ9+Vnt VF0x+VXpgyeHdvHbcIkzkzQi9MEDs/obGnpn6AZZhjPJzr2dxMNz8T8kaP/xkb9V OwSNv8wOW+BuH3p+EP4DkDmxFwIaTdVfkZ92uzsQSa/7da6kuyDINZFZDfOsRfNr 2ok4+fsr7sKNT2HNytsdXaZ/cv0b1g6bh4aybxFPBHwTvvd8n+IdUGUqsI0F+zNW +opOSvs1SywikhdMpao86yPH2f1ZoIU2vYxQ57zHMhmbQQ4o211Z6pKEv0FSjDiB MyeZi1nJV3pavjFOgipb9c3IgiFfHeTo/zcuJT7APml4mMmkfngY6ax9E+trhMsG RLJvTsDY6qs97Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=Yub7afbL2YqCI81VsT+kbMFDk5ck8 SvVrShDWaCq2wo=; b=YBmLZrLC3clTHec4D0SoFzftzzLzTixna6Rz0gnczPGFz KJnWf69pWKwxg+9b9tsHvCaoFMJTPleU+mbAVIo80FN6jvgVk29H62aQrbklk+KQ rEzPRzR8f72WeKoKyko+kR6WRBy4J/BE4oEXypJWk8f8PzT8u5jLe8B1gi9NHTRy vGechAgGRbf60Cd0GMo9Ghow2lAX6aJ0UqUb1MztEjOFNBLEvWOsOEvI77hEUryE r+geARxJOqtS8Lwaj93zDXt+yenLNtcD5L1cGsPZRXF3JeQ5JF1eI7KCUvxwgVDd tj5JJ2Qi7bT48VMHjyQrj4dwEgx1kPrsiv5GnX66g== X-ME-Sender: Received: from localhost (cm-84.214.173.174.getinternet.no [84.214.173.174]) by mail.messagingengine.com (Postfix) with ESMTPA id 787D47F982; Tue, 7 Nov 2017 14:15:06 -0500 (EST) From: Marius Bakke In-Reply-To: <20171106214252.12702-1-ludo@gnu.org> References: <20171106214057.12590-1-ludo@gnu.org> <20171106214252.12702-1-ludo@gnu.org> User-Agent: Notmuch/0.25.1 (https://notmuchmail.org) Emacs/25.3.1 (x86_64-pc-linux-gnu) Date: Tue, 07 Nov 2017 20:15:04 +0100 Message-ID: <87r2t93npj.fsf@fastmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > This reduces the nar size (as shown by 'guix size') by 124 MiB, from > 169 MiB to 45 MiB (almost divided by 4!). Wow, nice catch. If I read the code correctly, it detects hard links and replaces them with symlinks. Could we do this unconditionally in a gnu-build-system phase? Are there any legitimate uses of hard links in outputs? That said, the patch LGTM. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAloCBjkACgkQoqBt8qM6 VPo1Hgf/TEy0ENdnCATU5uagJ+nj4XhyzSGivxLQ3O2YrhIPXV76A5u5WzYDPGpn CQVe+vqBMTz64QjYO5PdlNU8zF3tvFX8cORluFDBR30hW5Rwj+gtwSGOQMhfusxv tlv21eiefQ7GoqEiOsCINeNvhfanpRb9kyFKll3iw0+o9ToKL7UrEaFeiifaSU0d wvuHk7lgKsM44ls7vTYbMCdjOymGLP8MH3cSLtqeaTXVE7SpZzEu4cCNhFjYxMuc 9cA4fTEEDD+WMzDilDHZ82pxf9bQ+g5OwIyeyjT2MVavsgaB/Q/WHT77f16Vn6YV yBvSU6oGiFOw4gbenraAWf/9ZP4Bjw== =lMy7 -----END PGP SIGNATURE----- --=-=-=-- From unknown Wed Aug 20 06:04:21 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: bug#29181: closed (Re: [bug#29181] [PATCH 1/1] gnu: mesa: Use symlinks instead of hard links.) Message-ID: References: <87k1z1w4y6.fsf@gnu.org> <20171106214057.12590-1-ludo@gnu.org> X-Gnu-PR-Message: they-closed 29181 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 29181@debbugs.gnu.org Date: Wed, 08 Nov 2017 08:28:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1510129681-15937-1" This is a multi-part message in MIME format... ------------=_1510129681-15937-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #29181: [PATCH core-updates 0/1] Shrink Mesa which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 29181@debbugs.gnu.org. --=20 29181: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D29181 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1510129681-15937-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 29181-done) by debbugs.gnu.org; 8 Nov 2017 08:27:35 +0000 Received: from localhost ([127.0.0.1]:57533 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCLhu-00048H-O4 for submit@debbugs.gnu.org; Wed, 08 Nov 2017 03:27:34 -0500 Received: from hera.aquilenet.fr ([141.255.128.1]:40821) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCLhs-000489-W2 for 29181-done@debbugs.gnu.org; Wed, 08 Nov 2017 03:27:33 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 7D769F80C; Wed, 8 Nov 2017 09:27:33 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TvLWNeCjGcJm; Wed, 8 Nov 2017 09:27:32 +0100 (CET) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 7B405F692; Wed, 8 Nov 2017 09:27:32 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Marius Bakke Subject: Re: [bug#29181] [PATCH 1/1] gnu: mesa: Use symlinks instead of hard links. References: <20171106214057.12590-1-ludo@gnu.org> <20171106214252.12702-1-ludo@gnu.org> <87r2t93npj.fsf@fastmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 18 Brumaire an 226 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, 08 Nov 2017 09:27:29 +0100 In-Reply-To: <87r2t93npj.fsf@fastmail.com> (Marius Bakke's message of "Tue, 07 Nov 2017 20:15:04 +0100") Message-ID: <87k1z1w4y6.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 29181-done Cc: 29181-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Hi, Marius Bakke skribis: > Ludovic Court=C3=A8s writes: > >> This reduces the nar size (as shown by 'guix size') by 124 MiB, from >> 169 MiB to 45 MiB (almost divided by 4!). > > Wow, nice catch. If I read the code correctly, it detects hard links > and replaces them with symlinks. Yes. > Could we do this unconditionally in a gnu-build-system phase? Are > there any legitimate uses of hard links in outputs? Good question. There might be situations where the software relies on having regular files (not symlinks), so I would rather do it on a case-by-case basis than have a standard phase. WDYT? Besides, a phase that looks at all the files would have to be efficient than this na=C3=AFve implementation. > That said, the patch LGTM. Pushed as dcc00f54c619118d11982383102d2e9a1b86d080, thanks! Ludo=E2=80=99. ------------=_1510129681-15937-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 6 Nov 2017 21:41:26 +0000 Received: from localhost ([127.0.0.1]:54697 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eBp94-0008I9-Bv for submit@debbugs.gnu.org; Mon, 06 Nov 2017 16:41:26 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56349) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eBp92-0008Hw-Uw for submit@debbugs.gnu.org; Mon, 06 Nov 2017 16:41:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eBp8w-0003pk-Kr for submit@debbugs.gnu.org; Mon, 06 Nov 2017 16:41:19 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:42780) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eBp8w-0003pd-I5 for submit@debbugs.gnu.org; Mon, 06 Nov 2017 16:41:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eBp8v-0004RQ-9l for guix-patches@gnu.org; Mon, 06 Nov 2017 16:41:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eBp8u-0003oz-70 for guix-patches@gnu.org; Mon, 06 Nov 2017 16:41:17 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52441) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eBp8r-0003nS-Gk; Mon, 06 Nov 2017 16:41:13 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=57686 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eBp8q-0007wM-UJ; Mon, 06 Nov 2017 16:41:13 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: guix-patches@gnu.org Subject: [PATCH core-updates 0/1] Shrink Mesa Date: Mon, 6 Nov 2017 22:40:57 +0100 Message-Id: <20171106214057.12590-1-ludo@gnu.org> X-Mailer: git-send-email 2.14.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Hello Guix! This patch divides the nar size of ‘mesa’ (as reported by ‘guix size’) almost by a factor of four. It does so by replacing hard links created upon “make install” with symlinks. The new post-install phase prints things like: --8<---------------cut here---------------start------------->8--- starting phase `symlinks-instead-of-hard-links' creating 7 symlinks to '/gnu/store/l1iwgjgp88snlzp9nafdpd0vvsqv7lsi-mesa-17.2.1/lib/dri/i915_dri.so' creating 3 symlinks to '/gnu/store/l1iwgjgp88snlzp9nafdpd0vvsqv7lsi-mesa-17.2.1/lib/dri/i965_dri.so' creating 1 symlinks to '/gnu/store/l1iwgjgp88snlzp9nafdpd0vvsqv7lsi-mesa-17.2.1/lib/dri/nouveau_drv_video.so' creating 1 symlinks to '/gnu/store/l1iwgjgp88snlzp9nafdpd0vvsqv7lsi-mesa-17.2.1/lib/libXvMCnouveau.so.1.0.0' creating 2 symlinks to '/gnu/store/l1iwgjgp88snlzp9nafdpd0vvsqv7lsi-mesa-17.2.1/lib/vdpau/libvdpau_nouveau.so.1.0.0' phase `symlinks-instead-of-hard-links' succeeded after 0.0 seconds --8<---------------cut here---------------end--------------->8--- The nar size does not reflect disk usage since deduplication would recreate the hard links anyway, but it reflects how much we have to transfer over the wire since the nar format does not represent hard links. A similar problem arose with Git a while back, see . I’d like to push to ‘core-updates’. Thoughts? Ludo’. Ludovic Courtès (1): gnu: mesa: Use symlinks instead of hard links. gnu/packages/gl.scm | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) -- 2.14.2 ------------=_1510129681-15937-1--