From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id SOeXKflyfmKtIAAAbAwnHQ (envelope-from ) for ; Fri, 13 May 2022 17:02:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id gMhqKflyfmL02wAA9RJhRA (envelope-from ) for ; Fri, 13 May 2022 17:02:17 +0200 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 8091514285 for ; Fri, 13 May 2022 17:02:17 +0200 (CEST) Received: from localhost ([::1]:39252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npWo4-0001BL-NN for larch@yhetil.org; Fri, 13 May 2022 11:02:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npWnq-0000td-JG for guix-patches@gnu.org; Fri, 13 May 2022 11:02:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50645) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npWnq-0000xb-B1 for guix-patches@gnu.org; Fri, 13 May 2022 11:02:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1npWnq-0008As-7p for guix-patches@gnu.org; Fri, 13 May 2022 11:02:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55398] [PATCH 2/3] packages: Use separate package/graft cache. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 13 May 2022 15:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55398 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 55398@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 55398-submit@debbugs.gnu.org id=B55398.165245406831297 (code B ref 55398); Fri, 13 May 2022 15:02:02 +0000 Received: (at 55398) by debbugs.gnu.org; 13 May 2022 15:01:08 +0000 Received: from localhost ([127.0.0.1]:44531 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npWmx-00088h-Ls for submit@debbugs.gnu.org; Fri, 13 May 2022 11:01:07 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41704) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npWmt-00087h-QS for 55398@debbugs.gnu.org; Fri, 13 May 2022 11:01:04 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34262) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npWmo-0000rH-H3; Fri, 13 May 2022 11:00:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=0cQFKIpDUfvrcCbC9mkJ6n1Bs20ZI4Mt7Tm0RlaPSiw=; b=F7b7jBxOSBtNzCzqR0i2 0eMUtdVJ41aY3zprKFvNt6s8kabCG8QtGHaV5Pl6D5O2XNZhzjS9MPQ4HAw3ZRnkKsAswk+fAY6I6 /wmv2d/9Cobz/jsEcxmSwJ7kBTku95CdXQn0z22JZnoChWe8AHHEHXrT00iPw9dmoC2otHEtolsws 7eKNAIR8jn7UbdZsK5KAEN1gNK7a6VUZLGWtQ6FfieSwgUJyqHL/cUKcN+8ZRGMO2ZChNOXpba35F WFwFtCccfAk5GWI1iZmJYVHX4L0itn3pSAcZegrF4sg3uS0Z1AGD97szCjDTMH3qbtiL2a1mRXpxF VScEWpATABiHdw==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=44956 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npWmo-0002Q4-4D; Fri, 13 May 2022 11:00:58 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Fri, 13 May 2022 17:00:43 +0200 Message-Id: <20220513150044.11991-2-ludo@gnu.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220513150044.11991-1-ludo@gnu.org> References: <20220513150044.11991-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1652454137; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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:dkim-signature; bh=0cQFKIpDUfvrcCbC9mkJ6n1Bs20ZI4Mt7Tm0RlaPSiw=; b=QDJqwtROn0wSgDDAJDN+R4tQ/kiLKC5JC5TkBQv8gHunmEna/D3E/JcXHRVbAmrkg8JRjA q0CXmzDz5pA8qTnSSnSaA8XOMZMj8N6ylKgmduBL5zRjJ3gJDE2dHNCFnqpBVGnD7SK0TE khiO7fFYhkc92YE0V2wOJ5SskfW0Sk4gMWPmJxzCdysWUOGOFd/C3KPxc3DuKNDL2tT9k9 vPkEaByWHTNir25lfBofDGlETK8d7v9Gb9qmsSgYWZggSrJ+mtIhZJOvcXAj87ehwNLHHY p6wLE1gKXYcT/ghPxBVOjEyZKJ2DfWDmeBBsLjbVbKknOdZE6kYbZ0y3gtbJ+w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652454137; a=rsa-sha256; cv=none; b=VAXu5tsA9rICNYBDCSg5mB98+LmpTQ24dUIXT0WroufWA+TGCIUyewEVH39kyOTUN6ZKm4 YL792Veo/4qEvRkVj5KFj883P736jYwJS+zl/5bFQYNLXD3KsFFYBJnaqh5HpQ0QW0U+OL cuxTq8oVtPtTEm8N3L0SyyalUEz/4eY5LoTgstH3ahJOjzF8fnMC10SiJQDhpLBg6b86vI 023vtBUfTORwX7dSv/VcL8H+bhYP9rUu7tqCdotJKUJy0gIDFNsEnjaasDyfL3apjR2bQC aOI/5a7Xpj7lCZt3Gu7CJtD/rpyKKVCgs4AreGW2Hxq4jmoOhZHnBfe+ZLWFMQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=F7b7jBxO; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.43 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=F7b7jBxO; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 8091514285 X-Spam-Score: -2.43 X-Migadu-Scanner: scn1.migadu.com X-TUID: +ddBw7Wievl0 * guix/packages.scm (%package-graft-cache): New variable. (input-graft): Add (=> %package-graft-cache). --- guix/packages.scm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/guix/packages.scm b/guix/packages.scm index a79b36d03d..7ee65e9b6b 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -1618,6 +1618,11 @@ (define* (package->bag package #:optional (&package-error (package package)))))))))))) +(define %package-graft-cache + ;; Cache mapping records to records, for packages that + ;; have a replacement. + (allocate-store-connection-cache 'package-graft-cache)) + (define (input-graft system) "Return a monadic procedure that, given a package with a graft, returns a graft, and #f otherwise." @@ -1626,9 +1631,8 @@ (define (input-graft system) (((? package? package) output) (let ((replacement (package-replacement package))) (if replacement - ;; XXX: We should use a separate cache instead of abusing the - ;; object cache. - (mcached (mlet %store-monad ((orig (package->derivation package system + (mcached eq? (=> %package-graft-cache) + (mlet %store-monad ((orig (package->derivation package system #:graft? #f)) (new (package->derivation replacement system #:graft? #t))) @@ -1637,7 +1641,7 @@ (define (input-graft system) (origin-output output) (replacement new) (replacement-output output)))) - package 'graft output system) + package output system) (return #f)))) (_ (return #f))))) -- 2.36.0