From unknown Sun Jun 15 08:02:21 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#46776 <46776@debbugs.gnu.org> To: bug#46776 <46776@debbugs.gnu.org> Subject: Status: [PATCH] inferior: Extend cached-channel-instance scope. Reply-To: bug#46776 <46776@debbugs.gnu.org> Date: Sun, 15 Jun 2025 15:02:21 +0000 retitle 46776 [PATCH] inferior: Extend cached-channel-instance scope. reassign 46776 guix-patches submitter 46776 Mathieu Othacehe severity 46776 normal tag 46776 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 25 12:21:07 2021 Received: (at submit) by debbugs.gnu.org; 25 Feb 2021 17:21:07 +0000 Received: from localhost ([127.0.0.1]:39144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lFKK2-0005aV-Ta for submit@debbugs.gnu.org; Thu, 25 Feb 2021 12:21:07 -0500 Received: from lists.gnu.org ([209.51.188.17]:44772) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lFKJz-0005aL-Ux for submit@debbugs.gnu.org; Thu, 25 Feb 2021 12:21:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lFKJz-0005IE-Nh for guix-patches@gnu.org; Thu, 25 Feb 2021 12:21:03 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59991) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lFKJz-000796-HC for guix-patches@gnu.org; Thu, 25 Feb 2021 12:21:03 -0500 Received: from [2a01:e0a:19b:d9a0:bceb:3bde:446a:14b] (port=32880 helo=localhost.localdomain) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lFKJw-0006rt-3P; Thu, 25 Feb 2021 12:21:02 -0500 From: Mathieu Othacehe To: guix-patches@gnu.org Subject: [PATCH] inferior: Extend cached-channel-instance scope. Date: Thu, 25 Feb 2021 18:20:48 +0100 Message-Id: <20210225172048.22398-1-othacehe@gnu.org> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: Mathieu Othacehe 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 (---) * guix/inferior.scm (cached-channel-instance): Turn channels argument into channels-or-instances. Adapt the rest of the procedure. --- guix/inferior.scm | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/guix/inferior.scm b/guix/inferior.scm index 0990696e6c..06a187b879 100644 --- a/guix/inferior.scm +++ b/guix/inferior.scm @@ -709,20 +709,30 @@ prefix, resolve it; and if 'commit' is unset, fetch CHANNEL's branch tip." commit)))) (define* (cached-channel-instance store - channels + channels-or-instances #:key (authenticate? #t) (cache-directory (%inferior-cache-directory)) (ttl (* 3600 24 30))) - "Return a directory containing a guix filetree defined by CHANNELS, a list of channels. -The directory is a subdirectory of CACHE-DIRECTORY, where entries can be reclaimed after TTL seconds. -This procedure opens a new connection to the build daemon. AUTHENTICATE? -determines whether CHANNELS are authenticated." + "Return a directory containing a guix filetree defined by +CHANNELS-OR-INSTANCES, a list of channels or channel instances. The directory +is a subdirectory of CACHE-DIRECTORY, where entries can be reclaimed after TTL +seconds. This procedure opens a new connection to the build daemon. +AUTHENTICATE? determines whether CHANNELS are authenticated." + ;; Determine if we are dealing with channels or channel instances. + (define channels? + (match (pk channels-or-instances) + (((? channel? c) rest ...) + #t) + (else #f))) + (define commits ;; Since computing the instances of CHANNELS is I/O-intensive, use a ;; cheaper way to get the commit list of CHANNELS. This limits overhead ;; to the minimum in case of a cache hit. - (map channel-full-commit channels)) + (if channels? + (map channel-full-commit channels-or-instances) + (map channel-instance-commit channels-or-instances))) (define key (bytevector->base32-string @@ -756,9 +766,12 @@ determines whether CHANNELS are authenticated." cached (run-with-store store (mlet* %store-monad ((instances - -> (latest-channel-instances store channels - #:authenticate? - authenticate?)) + -> (if channels? + (latest-channel-instances + store channels-or-instances + #:authenticate? + authenticate?) + channels-or-instances)) (profile (channel-instances->derivation instances))) (mbegin %store-monad -- 2.30.1 From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 01 09:47:34 2021 Received: (at 46776) by debbugs.gnu.org; 1 Mar 2021 14:47:34 +0000 Received: from localhost ([127.0.0.1]:48619 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lGjpe-0003OK-FH for submit@debbugs.gnu.org; Mon, 01 Mar 2021 09:47:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58692) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lGjpd-0003O8-Ow for 46776@debbugs.gnu.org; Mon, 01 Mar 2021 09:47:34 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46034) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGjpY-0007Fu-FP for 46776@debbugs.gnu.org; Mon, 01 Mar 2021 09:47:28 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=54548 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lGjpR-0007Yp-43; Mon, 01 Mar 2021 09:47:23 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Mathieu Othacehe Subject: Re: bug#46776: [PATCH] inferior: Extend cached-channel-instance scope. References: <20210225172048.22398-1-othacehe@gnu.org> Date: Mon, 01 Mar 2021 15:47:19 +0100 In-Reply-To: <20210225172048.22398-1-othacehe@gnu.org> (Mathieu Othacehe's message of "Thu, 25 Feb 2021 18:20:48 +0100") Message-ID: <87blc3rkw8.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46776 Cc: 46776@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.7 (-) Hi, Mathieu Othacehe skribis: > * guix/inferior.scm (cached-channel-instance): Turn channels argument into > channels-or-instances. Adapt the rest of the procedure. [...] > (define* (cached-channel-instance store > - channels > + channels-or-instances > #:key > (authenticate? #t) > (cache-directory (%inferior-cache-dire= ctory)) > (ttl (* 3600 24 30))) > - "Return a directory containing a guix filetree defined by CHANNELS, a = list of channels. > -The directory is a subdirectory of CACHE-DIRECTORY, where entries can be= reclaimed after TTL seconds. > -This procedure opens a new connection to the build daemon. AUTHENTICATE? > -determines whether CHANNELS are authenticated." > + "Return a directory containing a guix filetree defined by > +CHANNELS-OR-INSTANCES, a list of channels or channel instances. The dir= ectory > +is a subdirectory of CACHE-DIRECTORY, where entries can be reclaimed aft= er TTL > +seconds. This procedure opens a new connection to the build daemon. > +AUTHENTICATE? determines whether CHANNELS are authenticated." > + ;; Determine if we are dealing with channels or channel instances. > + (define channels? > + (match (pk channels-or-instances) > + (((? channel? c) rest ...) > + #t) > + (else #f))) > + > (define commits > ;; Since computing the instances of CHANNELS is I/O-intensive, use a > ;; cheaper way to get the commit list of CHANNELS. This limits over= head > ;; to the minimum in case of a cache hit. > - (map channel-full-commit channels)) > + (if channels? > + (map channel-full-commit channels-or-instances) > + (map channel-instance-commit channels-or-instances))) This would only accept homogeneous lists, which is kinda weird. Could we instead have a separate procedure taking channel instances, and arrange to factorize common code in a third procedure? Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 26 05:54:45 2021 Received: (at 46776-done) by debbugs.gnu.org; 26 Mar 2021 09:54:45 +0000 Received: from localhost ([127.0.0.1]:40485 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lPjAz-0000Zo-49 for submit@debbugs.gnu.org; Fri, 26 Mar 2021 05:54:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59102) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lPjAx-0000Za-Bs for 46776-done@debbugs.gnu.org; Fri, 26 Mar 2021 05:54:43 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50751) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPjAs-0001qz-34; Fri, 26 Mar 2021 05:54:38 -0400 Received: from [2a01:cb18:832e:5f00:6ddb:76f4:5f3e:7dde] (port=45220 helo=mathieu-HP-EliteBook-840-G1) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lPjAq-0000JT-ND; Fri, 26 Mar 2021 05:54:37 -0400 From: Mathieu Othacehe To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#46776: [PATCH] inferior: Extend cached-channel-instance scope. References: <20210225172048.22398-1-othacehe@gnu.org> <87blc3rkw8.fsf@gnu.org> Date: Fri, 26 Mar 2021 10:54:35 +0100 In-Reply-To: <87blc3rkw8.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Mon, 01 Mar 2021 15:47:19 +0100") Message-ID: <871rc2b5pg.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46776-done Cc: 46776-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.7 (-) Hello, > This would only accept homogeneous lists, which is kinda weird. > > Could we instead have a separate procedure taking channel instances, and > arrange to factorize common code in a third procedure? I managed to rewrite Cuirass evaluation without modifying the inferior API. Closing this one. Thanks for having a look, Mathieu From unknown Sun Jun 15 08:02:21 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 23 Apr 2021 11:24:12 +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