From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 03 04:46:28 2023 Received: (at submit) by debbugs.gnu.org; 3 Aug 2023 08:46:28 +0000 Received: from localhost ([127.0.0.1]:50813 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRTyV-0002yE-Nc for submit@debbugs.gnu.org; Thu, 03 Aug 2023 04:46:28 -0400 Received: from lists.gnu.org ([2001:470:142::17]:50830) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRTyU-0002y0-16 for submit@debbugs.gnu.org; Thu, 03 Aug 2023 04:46:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRTyO-0005U1-Qn for guix-patches@gnu.org; Thu, 03 Aug 2023 04:46:20 -0400 Received: from mira.cbaines.net ([2a01:7e00:e000:2f8:fd4d:b5c7:13fb:3d27]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRTyM-0003Kl-GP for guix-patches@gnu.org; Thu, 03 Aug 2023 04:46:19 -0400 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:3a91:a0a4:ecee:f157]) by mira.cbaines.net (Postfix) with ESMTPSA id 1BA0527BBE2 for ; Thu, 3 Aug 2023 09:46:14 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 68e668e0 for ; Thu, 3 Aug 2023 08:46:13 +0000 (UTC) From: Christopher Baines To: guix-patches@gnu.org Subject: [PATCH] guix: read-derivation-from-file: Use less open files. Date: Thu, 3 Aug 2023 09:46:12 +0100 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a01:7e00:e000:2f8:fd4d:b5c7:13fb:3d27; envelope-from=mail@cbaines.net; helo=mira.cbaines.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, UNPARSEABLE_RELAY=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit 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.1 (/) The Guix derivation graph isn't that deep, so I don't think this generally opens lots of files, but I think it's still unnecessary to keep more files than needed open. * guix/derivations.scm (read-derivation-from-file): Read each derivation to a string, which is passed as a port to read-derivation. --- guix/derivations.scm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/guix/derivations.scm b/guix/derivations.scm index 9fec7f4f0b..2154bd76f6 100644 --- a/guix/derivations.scm +++ b/guix/derivations.scm @@ -31,6 +31,7 @@ (define-module (guix derivations) #:use-module (ice-9 match) #:use-module (ice-9 rdelim) #:use-module (ice-9 vlist) + #:use-module (ice-9 textual-ports) #:use-module (guix store) #:use-module (guix utils) #:use-module (guix base16) @@ -556,7 +557,14 @@ (define (read-derivation-from-file file) ;; and because the same argument is read more than 15 times on average ;; during something like (package-derivation s gdb). (or (and file (hash-ref %derivation-cache file)) - (let ((drv (call-with-input-file file read-derivation))) + (let ((drv + ;; read-derivation can call read-derivation-from-file, so to + ;; avoid having multiple open files when reading a derivation + ;; with inputs, read it in to a string first. + (call-with-input-string + (call-with-input-file file + get-string-all) + read-derivation))) (hash-set! %derivation-cache file drv) drv))) base-commit: fe3e05d8b3dbb255179d3f85aca870e6085bb71a prerequisite-patch-id: 2322b3b5ce79bdaa763075cdbb96e760168d4c63 -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 09 17:28:51 2023 Received: (at 65033) by debbugs.gnu.org; 9 Aug 2023 21:28:51 +0000 Received: from localhost ([127.0.0.1]:40621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qTqja-0000tW-Ij for submit@debbugs.gnu.org; Wed, 09 Aug 2023 17:28:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53406) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qTqjX-0000tI-MU for 65033@debbugs.gnu.org; Wed, 09 Aug 2023 17:28:48 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qTqjR-0008OJ-Bj; Wed, 09 Aug 2023 17:28:41 -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=YgRUsiDSrVyACbMAYbG+D/281P3AXaGwNkyokesdSx4=; b=VT96fZPDmtaRDFDI1gih cG4Izjm/wIRuHzqII2EEEZCnJG02Mo3iH7X4mSn1XxmVgeJhzqN4l6fkph49PHcTj4hsN9bo+Ld9w K1yx7UYZWPW9ao8WKnOaJFWeSD3H48j0Y+77eOLGFJgeJwL5yTcTA7GHMl25SUOq5EzF0qRd2yWrb Ps5CCUMjXwGjjZLbpyTSzFuqsTXWuDIp3Ro21rFqKkHbfdWcHi3MvUSp/skE2ObpVs1pxHghKEh2S 9LGzEtVfLyNsaQ7YiW+MmZTnCvhP5ImsfNC8r5Slx5YLjExwh+3o1DAratw6GEGPvr+YBXR09gOIq Wu2GozcvfhRTbQ==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Christopher Baines Subject: Re: [bug#65033] [PATCH] guix: read-derivation-from-file: Use less open files. References: X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Duodi 22 Thermidor an 231 de la =?utf-8?Q?R=C3=A9vol?= =?utf-8?Q?ution=2C?= jour du =?utf-8?Q?C=C3=A2prier?= 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, 09 Aug 2023 23:28:37 +0200 In-Reply-To: (Christopher Baines's message of "Thu, 3 Aug 2023 09:46:12 +0100") Message-ID: <87il9noqgq.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65033 Cc: Josselin Poiret , Simon Tournier , Mathieu Othacehe , Tobias Geerinckx-Rice , Ricardo Wurmus , 65033@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: -3.3 (---) Hey Chris, Christopher Baines skribis: > The Guix derivation graph isn't that deep, so I don't think this generally > opens lots of files, but I think it's still unnecessary to keep more files > than needed open. > > * guix/derivations.scm (read-derivation-from-file): Read each derivation = to a > string, which is passed as a port to read-derivation. [...] > - (let ((drv (call-with-input-file file read-derivation))) > + (let ((drv > + ;; read-derivation can call read-derivation-from-file, so to > + ;; avoid having multiple open files when reading a derivati= on > + ;; with inputs, read it in to a string first. > + (call-with-input-string > + (call-with-input-file file > + get-string-all) > + read-derivation))) How real is the risk of having too many open files due to a =E2=80=98read-derivation=E2=80=99 call? (Where too many is >=3D 100.) You might think it=E2=80=99s likely because: --8<---------------cut here---------------start------------->8--- $ guix gc -R $(guix build -d --no-grafts emacs) |grep drv$ | wc -l 2234 --8<---------------cut here---------------end--------------->8--- But in fact, due to the shape of the graph + memoization (I suppose=C2=B9), there are at most 27 open file descriptors in this case: --8<---------------cut here---------------start------------->8--- $ strace -o /tmp/log.strace -e openat guile -c "(use-modules (guix)) (read-= derivation-from-file \"$(guix build -d --no-grafts emacs)\")" $ cut -d '=3D' -f 2- < /tmp/log.strace |sort -un | tail 18 19 20 21 22 23 24 25 26 27 --8<---------------cut here---------------end--------------->8--- So to me the status quo is probably okay. The reason I=E2=80=99m paying attention to this is that allocating a string= port plus a string for the whole contents every time would put pressure on memory, which is worth avoiding if we can. WDYT? Thanks, Ludo=E2=80=99. =C2=B9 Here=E2=80=99s an excerpt of the log of open/close calls: --8<---------------cut here---------------start------------->8--- openat(AT_FDCWD, "/gnu/store/0i35jrxk605w30kg5rbi8llrmn0p5d3z-rust-1.58.1.d= rv", O_RDONLY) =3D 20 openat(AT_FDCWD, "/gnu/store/hxb2q20kqni626v1qnnp48qp9c31xk26-rustc-1.58.1-= src.tar.xz.drv", O_RDONLY) =3D 21 openat(AT_FDCWD, "/gnu/store/99j3sbiv8yrgvw7nlyykfk92wr6s2ckn-rustc-1.58.1-= src.tar.gz.drv", O_RDONLY) =3D 22 close(22) =3D 0 close(21) =3D 0 openat(AT_FDCWD, "/gnu/store/0p87fpbbjgjy0mj9z3frinml75yyhkwj-rust-1.57.0.d= rv", O_RDONLY) =3D 21 openat(AT_FDCWD, "/gnu/store/dshfgf4i6jigvr7plf79bz256gq6rnvs-rustc-1.57.0-= src.tar.xz.drv", O_RDONLY) =3D 22 openat(AT_FDCWD, "/gnu/store/casv57vivd9zp90sqp7ky8kk0zzs9di5-rustc-1.57.0-= src.tar.gz.drv", O_RDONLY) =3D 23 close(23) =3D 0 close(22) =3D 0 openat(AT_FDCWD, "/gnu/store/bhw4sm7wdsxdl4kjr9jbxg7yh26naarh-rust-1.56.1.d= rv", O_RDONLY) =3D 22 openat(AT_FDCWD, "/gnu/store/f5x8avmf1llkvhiprjimbnzps5g3a9zs-rust-1.55.0.d= rv", O_RDONLY) =3D 23 openat(AT_FDCWD, "/gnu/store/skaj2s179s6irdz92fsb0pyfd1y0z8cr-rust-1.54.0.d= rv", O_RDONLY) =3D 24 openat(AT_FDCWD, "/gnu/store/j1h5zijffi9z03q9ixvxgzvrx8bh06hy-mrustc-0.10-2= .597593a-checkout.drv", O_RDONLY) =3D 25 openat(AT_FDCWD, "/gnu/store/x5yag0vxmj8kyl9b7a1x8pksyvxh4bx9-mrustc-0.10-2= .597593a-checkout.drv", O_RDONLY) =3D 26 close(26) =3D 0 close(25) =3D 0 openat(AT_FDCWD, "/gnu/store/i4ilq3iirdyyk9pga22dhldr5khm2v27-openssl-1.1.1= q.drv", O_RDONLY) =3D 25 openat(AT_FDCWD, "/gnu/store/d8s5zhx5lhlfngshbzbszyqm4nbnczzn-openssl-1.1.1= q.tar.xz.drv", O_RDONLY) =3D 26 openat(AT_FDCWD, "/gnu/store/hgkr5j4y9y8kgsriyc94drs1mjfmdq7b-openssl-1.1.1= q.tar.gz.drv", O_RDONLY) =3D 27 close(27) =3D 0 close(26) =3D 0 close(25) =3D 0 openat(AT_FDCWD, "/gnu/store/0c5f6lqiqspbf9vhxil0zwxgw0dw9qfr-rustc-1.54.0-= src.tar.xz.drv", O_RDONLY) =3D 25 openat(AT_FDCWD, "/gnu/store/jpr1x3p9vv8cvjvw3bhbwljfpwcp5drv-rustc-1.54.0-= src.tar.gz.drv", O_RDONLY) =3D 26 close(26) =3D 0 close(25) =3D 0 close(24) =3D 0 openat(AT_FDCWD, "/gnu/store/bsllkwnaj5ssad7lmwc5y82vaw7rxn2z-rustc-1.55.0-= src.tar.xz.drv", O_RDONLY) =3D 24 openat(AT_FDCWD, "/gnu/store/wb8yxyj5i741h07y7mrvmqx3zgqjjdps-rustc-1.55.0-= src.tar.gz.drv", O_RDONLY) =3D 25 close(25) =3D 0 close(24) =3D 0 close(23) =3D 0 openat(AT_FDCWD, "/gnu/store/86hdkc84zp1xjzqp9nsfhqzqpi7wxr8m-rustc-1.56.1-= src.tar.xz.drv", O_RDONLY) =3D 23 openat(AT_FDCWD, "/gnu/store/8y3kwcvsw72rdbari8irvhfwh872y4gd-rustc-1.56.1-= src.tar.gz.drv", O_RDONLY) =3D 24 close(24) =3D 0 close(23) =3D 0 close(22) =3D 0 close(21) =3D 0 close(20) =3D 0 close(19) =3D 0 close(18) =3D 0 close(17) =3D 0 openat(AT_FDCWD, "/gnu/store/vc4vah8yz98f1vq0fdf57b9r0v2255y9-rustc-1.62.1-= src.tar.xz.drv", O_RDONLY) =3D 17 openat(AT_FDCWD, "/gnu/store/xxklgspj41zwb0n3kd33bilq9n08pp58-rustc-1.62.1-= src.tar.gz.drv", O_RDONLY) =3D 18 close(18) =3D 0 close(17) =3D 0 close(16) =3D 0 close(15) =3D 0 close(14) =3D 0 close(13) =3D 0 close(12) =3D 0 --8<---------------cut here---------------end--------------->8--- From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 05 10:51:38 2023 Received: (at control) by debbugs.gnu.org; 5 Sep 2023 14:51:38 +0000 Received: from localhost ([127.0.0.1]:57648 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdXP0-00035o-DW for submit@debbugs.gnu.org; Tue, 05 Sep 2023 10:51:38 -0400 Received: from mail-qt1-x82b.google.com ([2607:f8b0:4864:20::82b]:47354) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdXOx-00035V-Mh for control@debbugs.gnu.org; Tue, 05 Sep 2023 10:51:36 -0400 Received: by mail-qt1-x82b.google.com with SMTP id d75a77b69052e-414b3a1a24aso17366991cf.2 for ; Tue, 05 Sep 2023 07:51:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693925489; x=1694530289; darn=debbugs.gnu.org; h=subject:from:to:message-id:date:from:to:cc:subject:date:message-id :reply-to; bh=GrXlHjY6NeHCkq+zUOCGXxZVzNzy02CJj3RuS4Ahd+s=; b=pYwbxXWqrOfxC9NJoKXxGA6G7e07PkmHqrGvwBMmjZ4OrjUdaho0KPO6CiSFA/DovS cGc07AEa3Tw6QUKU9smL14+PY7B1vMJb5VtTRUbnBxAg2bNiYh++pCzZo47eAF6cxYNn R7CJUV6KipjRIL77sjYiEdWJnD6H7XM1iK2fEs/6uOyBQD8FdAH2whf4MnF/x0McUMlZ djhzB/NmCh2kH1N1gDoutkG80ft258ooWiZSUFeInEUWzcKxnyuYxxMgUsM+rfR566I3 LGBiESbKoVQKG8uStGyPTs+zsBNwo/RBti0QWF7URAtv4QLbxDZnOQt6qKK2T9kxi6V7 oSoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693925489; x=1694530289; h=subject:from:to:message-id:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GrXlHjY6NeHCkq+zUOCGXxZVzNzy02CJj3RuS4Ahd+s=; b=Fq6JsIMvVPZQ0LL2TqtGSkCGtV8WsmQS1lcywhELZmVkBCPBtu1lhGH3VNk3obtrQm AbNZgTyEJEfgdXfYqiZVcaS0/o9J+dEZGrjx9lLCWnfdFbI0qRafZmebT0bXd2Fmw5RP gqENEvu69i5a3Fsml8Fgz3cUSVnuFr9H2I5fl70J2NsTNIQ8YFOD6NIoh5R6Gx1ytra+ JDnjOWmvfcJgSZBL5nOTduWg0E4xqybFhvZ7aVJ7E49hs1EGO6AadRAaj9neOJKN3dZ9 i/2n6qQ4MvwyQy/NUgdk1Mstr5+KTeY3HTDUNV7irVpQV+8bEudBEaHtBzfjgT97rMtA 20UA== X-Gm-Message-State: AOJu0Yy4nX1lFUCjTOwXxTSbZVNprN/Oz2oPkL6FQd5zgVQkeppt9apl 4j9JcCLIrSc3SjAkKPgvyHBal9Ccn0CT5w== X-Google-Smtp-Source: AGHT+IES/OQhIDOZW7FkTaaOlx7sOxaFxBInrmBauzIX0yW9K1rXmWlfkIvLzLjM6OybudNLVsqHvQ== X-Received: by 2002:a05:622a:18d:b0:401:e1e7:a2a4 with SMTP id s13-20020a05622a018d00b00401e1e7a2a4mr17921820qtw.35.1693925489215; Tue, 05 Sep 2023 07:51:29 -0700 (PDT) Received: from hurd (dsl-153-125.b2b2c.ca. [66.158.153.125]) by smtp.gmail.com with ESMTPSA id c12-20020ac84e0c000000b004035843ec96sm4405068qtw.89.2023.09.05.07.51.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Sep 2023 07:51:28 -0700 (PDT) Date: Tue, 05 Sep 2023 10:51:27 -0400 Message-Id: <875y4ok70w.fsf@gmail.com> To: control@debbugs.gnu.org From: Maxim Cournoyer Subject: control message for bug #65033 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control 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 (-) tags 65033 + moreinfo quit From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 12 04:33:49 2023 Received: (at 65033-close) by debbugs.gnu.org; 12 Sep 2023 08:33:49 +0000 Received: from localhost ([127.0.0.1]:56101 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfyqD-0008DJ-Ad for submit@debbugs.gnu.org; Tue, 12 Sep 2023 04:33:49 -0400 Received: from mira.cbaines.net ([212.71.252.8]:42898) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfyq9-0008D5-6q for 65033-close@debbugs.gnu.org; Tue, 12 Sep 2023 04:33:47 -0400 Received: from localhost (unknown [217.155.61.229]) by mira.cbaines.net (Postfix) with ESMTPSA id D15C727BBE2; Tue, 12 Sep 2023 09:33:39 +0100 (BST) Received: from felis (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 3f82d11c; Tue, 12 Sep 2023 08:33:39 +0000 (UTC) References: <87il9noqgq.fsf@gnu.org> User-agent: mu4e 1.10.5; emacs 28.2 From: Christopher Baines To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#65033] [PATCH] guix: read-derivation-from-file: Use less open files. Date: Tue, 12 Sep 2023 09:29:23 +0100 In-reply-to: <87il9noqgq.fsf@gnu.org> Message-ID: <87wmwvvli6.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 65033-close Cc: 65033-close@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 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > Hey Chris, > > Christopher Baines skribis: > >> The Guix derivation graph isn't that deep, so I don't think this general= ly >> opens lots of files, but I think it's still unnecessary to keep more fil= es >> than needed open. >> >> * guix/derivations.scm (read-derivation-from-file): Read each derivation= to a >> string, which is passed as a port to read-derivation. > > [...] > >> - (let ((drv (call-with-input-file file read-derivation))) >> + (let ((drv >> + ;; read-derivation can call read-derivation-from-file, so = to >> + ;; avoid having multiple open files when reading a derivat= ion >> + ;; with inputs, read it in to a string first. >> + (call-with-input-string >> + (call-with-input-file file >> + get-string-all) >> + read-derivation))) > > How real is the risk of having too many open files due to a > =E2=80=98read-derivation=E2=80=99 call? (Where too many is >=3D 100.) > > You might think it=E2=80=99s likely because: > > $ guix gc -R $(guix build -d --no-grafts emacs) |grep drv$ | wc -l > 2234 > > > But in fact, due to the shape of the graph + memoization (I suppose=C2=B9= ), > there are at most 27 open file descriptors in this case: > > $ strace -o /tmp/log.strace -e openat guile -c "(use-modules (guix)) (rea= d-derivation-from-file \"$(guix build -d --no-grafts emacs)\")" > $ cut -d '=3D' -f 2- < /tmp/log.strace |sort -un | tail > 18 > 19 > 20 > 21 > 22 > 23 > 24 > 25 > 26 > 27 > > > So to me the status quo is probably okay. > > The reason I=E2=80=99m paying attention to this is that allocating a stri= ng port > plus a string for the whole contents every time would put pressure on > memory, which is worth avoiding if we can. > > WDYT? I guess there should be a way of arranging the code so that it doesn't keep unnecessary ports, but also doesn't use strings, but that will require some rearranging. I think I just got thinking about this as the build coordinator was using excessive file descriptors, but this isn't the cause. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmUAImFfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9XfPLw//SFxXs0oarvhNuyb8ckPELHh80mLfNLsr rMSxtma9Fij3mAJOPgO4nP+vMesVFggC+Ri//ChhQJXSXADE0ETf4BuN3lgxHVuw Lumby/6SK0zWrUvsP2giGYNytSif9hHCUYQHfonNU0bOThF74WX9Qou8XlT5e2LO Uzflt1L75OmDux2g8vPGDZeYOkR/+zDLrI/uLTjJEUUfWLamg4x0fQV2xzJbdtV1 qWJkbteLQWA8wjRuJrvS2toaR4ZyyI1qWl0OMWBB2f7NjacFsNkZ/jdXRChxZkRm g0EfDc5A+MyiZ+ESj9g4BFil7zYUU8RR4A24KlCOUfTpnGllnmSZYkqO00wd06Mp Na9NOsWPQ0uicrBJirT8yRgbdtXgAQgIMgjwWq6+032dOf5TKKk+zL9BGb9pq18a rIWzzszgSTxXCEkV5sw7cvtFJhdenaFNPlyKcrHqGYMcyrxGTSoM/If8hxhdVtky 5/Bfhrvb51z2o9Qc/E4N+zHxFA1bm0DtrWkKnyyK8cBbz5gtm/x34eQ5KZ+lcVnZ iubjaJKGMHjdAsqTj74D808eFrcDW+tR9zlyX6nlhE9z8nr15mmA75bv8Qx7IUQy 1sXf27Rqeu4MTSVZukzNOaWzmPHfWPzN+5IQVbFT2RIVOo77wFUFV0FdNSpDsGIB xxlZLGhjDfY= =5s6r -----END PGP SIGNATURE----- --=-=-=-- From unknown Fri Jun 20 05:34:07 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 10 Oct 2023 11:24:09 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator