From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id mDFzNrf+PGAbPQAA0tVLHw (envelope-from ) for ; Mon, 01 Mar 2021 14:48:23 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id umJDMrf+PGAKXQAA1q6Kng (envelope-from ) for ; Mon, 01 Mar 2021 14:48:23 +0000 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 3D122B3AF for ; Mon, 1 Mar 2021 15:48:23 +0100 (CET) Received: from localhost ([::1]:47284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGjqQ-0001cC-3Z for larch@yhetil.org; Mon, 01 Mar 2021 09:48:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48574) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGjq6-0001Zu-Ap for guix-patches@gnu.org; Mon, 01 Mar 2021 09:48:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:37073) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lGjq6-0007X3-3A for guix-patches@gnu.org; Mon, 01 Mar 2021 09:48:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lGjq6-0003P1-1T for guix-patches@gnu.org; Mon, 01 Mar 2021 09:48:02 -0500 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1614610103; 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: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=iC/gfnaERz8DUL2GQQlH861IkbgrKEJMGvFJvPkc3qU=; b=LrvQvQGdkxBt71okPleQ6ax+RVXjQKwsOIpoxOi8bLrqD5dup8D6Ax41Q2JgafRJLnBPkz 9vm7JIn92bztVqczE7t4wQgNU8Aom56pXoHRv7SV7+d/XBlt++6feOoBr+5145pwTcOSze nkAbat1XcTgo8J4pSqAy8gR5hQI6albL8exsjiuKZOYy5Cfk5ONtcGUPBzVx0ahlejDoC9 Q9n+3ZwoXm/ytqUhzenUJ4LYTa3e7P6LG5f0uQ7aBLoz42e2NaX4ZxIguAxZuiM/bOO3Ux u2URhlJjRdAYD7PUhbSfGE1aPg/9C7uqcyDQThd3LJl3RAqXeAJbXF9FagRwRw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1614610103; a=rsa-sha256; cv=none; b=Np7o9JVHzsu4eyAk1i1lrWtjwNAKU64p5q70aSAqRoDWJVddBw8aNmQh6aZQ3jxcmRcIjQ ic0ya5jWOGhyhcF1tmE4BbkrEVQZY13DmRKbratvlRGZtAH2rjxCwB61VvXFDFfA4yR2IY ETMok7gVnQwpdA+ZEf5E7iJSzSyEnrXijzZE4gFhu2Ji47BF8SwQj4Uguj/leha3AVASmH fk7bZFlUobRt0JUlI1/sDMsf/s+3uE5oew1MQvUW4sZJCOmzNR28JwCHWlvVQQKNrjJx9G ZgM2PcgBYAFFKidKEKTSPT49iJbI/BaS1X505waSCXXF2S99s+qn2AiM0vDbrA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.87 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 3D122B3AF X-Spam-Score: -2.87 X-Migadu-Scanner: scn1.migadu.com X-TUID: e2nNO0uhUEs3 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.