From unknown Sun Jun 15 08:36:25 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#46776] [PATCH] inferior: Extend cached-channel-instance scope. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 25 Feb 2021 17:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 46776 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 46776@debbugs.gnu.org Cc: Mathieu Othacehe X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.161427366721487 (code B ref -1); Thu, 25 Feb 2021 17:22:01 +0000 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 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-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 unknown Sun Jun 15 08:36:25 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#46776] [PATCH] inferior: Extend cached-channel-instance scope. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 01 Mar 2021 14:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46776 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Mathieu Othacehe Cc: 46776@debbugs.gnu.org Received: via spool by 46776-submit@debbugs.gnu.org id=B46776.161461005413044 (code B ref 46776); Mon, 01 Mar 2021 14:48:01 +0000 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= 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-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 unknown Sun Jun 15 08:36:25 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: Mathieu Othacehe Subject: bug#46776: closed (Re: bug#46776: [PATCH] inferior: Extend cached-channel-instance scope.) Message-ID: References: <871rc2b5pg.fsf_-_@gnu.org> <20210225172048.22398-1-othacehe@gnu.org> X-Gnu-PR-Message: they-closed 46776 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 46776@debbugs.gnu.org Date: Fri, 26 Mar 2021 09:55:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1616752502-2256-1" This is a multi-part message in MIME format... ------------=_1616752502-2256-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #46776: [PATCH] inferior: Extend cached-channel-instance scope. 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 46776@debbugs.gnu.org. --=20 46776: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D46776 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1616752502-2256-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit 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 ------------=_1616752502-2256-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit 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 ------------=_1616752502-2256-1--