From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:5f26::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id UIuRGoNsmGWzbwAAkFu2QA (envelope-from ) for ; Fri, 05 Jan 2024 21:54:27 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id ULJ2E4NsmGUfFAEAqHPOHw (envelope-from ) for ; Fri, 05 Jan 2024 21:54:27 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; 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"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1704488067; 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; bh=ugQIEVnHO/ZjryAVa4Q0iaGXC9tEJpjlMHvAGLLWL9k=; b=rnRibitCgOS+wUOLIKAXcvECz/E0/ZCer4sYPREiKQR78KyIXqMkRnSypZeH0MyI9VtaIw IqdZdCh5qkywhMyDOG9YJES8uoZJIn4DPiXfPo8oz7AawHn5IEPJoB3d+DLK7Ha2MUsUOk kpXwssKW7TepGyIPRi06qwC9UWGrweanythbeOwcolANSsYWJzVBZNmuJtzL90EGhGMJJ8 tBhdwZZL+ueX/oiNLGl8Xcu7lLPPzwOnb4u7iM6IFlxBT85PFbj0vVcdC3HoS+PePjJcXZ bbGl+sTT5I0o5RG7v4KgMNb0Svq4ZkaAwRblgRxNHHQ8/JL28uOvIYXoxK7RHQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1704488067; a=rsa-sha256; cv=none; b=MhrO8GoYwe6OtnxH/f0xgaoE3NGGFKWICx3UGP4TcfYre/Q+oesJMHtNtbGFdZa19JPWON xxha0zw6+S+MrJVdgoHqffDhOAfhOvcs9tgceVWBIkmNGrUMsCWN6pgzXXLHrEFAoib10t cm2gZUx/V7k8ap1M9NuhXFHCiG+rLNbmmgwMSEKxWmJKHlk83k7AvjoRVOKgAGyB04cIpX bnEdiYeDdshZEtIkGMWcZJxhZICKcEXmCCVIuUYcpQ9tZTz3FBg9Zn/aM0iH8CMms5zuaW 07r/+aMp2GiB//AZ/x1FMwKrAqIzmvKAvhqtF3ZMY+c9hVVdMyZGyhFWyR+Y2A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; 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"; dmarc=none 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 2472716DC0 for ; Fri, 5 Jan 2024 21:54:27 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLrCc-0005wb-RB; Fri, 05 Jan 2024 15:54:02 -0500 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 1rLrCb-0005wK-2t for guix-patches@gnu.org; Fri, 05 Jan 2024 15:54:01 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLrCa-0007WU-Qa; Fri, 05 Jan 2024 15:54:00 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rLrCc-00046v-Sc; Fri, 05 Jan 2024 15:54:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68271] [PATCH 3/3] guix: packages: Speed up deduplicating inputs. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Fri, 05 Jan 2024 20:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68271 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68271@debbugs.gnu.org Cc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 68271-submit@debbugs.gnu.org id=B68271.170448803115766 (code B ref 68271); Fri, 05 Jan 2024 20:54:02 +0000 Received: (at 68271) by debbugs.gnu.org; 5 Jan 2024 20:53:51 +0000 Received: from localhost ([127.0.0.1]:58040 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rLrCC-00045z-5h for submit@debbugs.gnu.org; Fri, 05 Jan 2024 15:53:51 -0500 Received: from mira.cbaines.net ([2a01:7e00:e000:2f8:fd4d:b5c7:13fb:3d27]:47199) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rLrC7-00045N-B8 for 68271@debbugs.gnu.org; Fri, 05 Jan 2024 15:53:34 -0500 Received: from localhost (unknown [217.155.61.229]) by mira.cbaines.net (Postfix) with ESMTPSA id 30C1B27BBEA for <68271@debbugs.gnu.org>; Fri, 5 Jan 2024 20:53:24 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 0c47e6c0 for <68271@debbugs.gnu.org>; Fri, 5 Jan 2024 20:53:23 +0000 (UTC) From: Christopher Baines Date: Fri, 5 Jan 2024 20:53:22 +0000 Message-ID: <7bb6eeca77516fdd01e9b0b98eb9e21ac87c7509.1704488002.git.mail@cbaines.net> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -3.29 X-Spam-Score: -3.29 X-Migadu-Queue-Id: 2472716DC0 X-Migadu-Scanner: mx12.migadu.com X-TUID: 3cMQaqrDUiVs Use delete-duplicates/sort rather than delete-duplicates, as this seems to perform a little better, at least when testing by computing derivations targeting i586-pc-gnu for all packages. * guix/packages.scm (inputcross-derivation): Use deduplicate-inputs. Change-Id: Ic47b50aa52f11d701e5aefa2a095219e3a98cfd1 --- guix/packages.scm | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/guix/packages.scm b/guix/packages.scm index 930b1a3b0e..09dc88e2af 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -1889,6 +1889,21 @@ (define (input=? input1 input2) (derivation=? obj1 obj2)) (equal? obj1 obj2)))))))) +(define (inputderivation bag #:optional context) "Return the derivation to build BAG for SYSTEM. Optionally, CONTEXT can be a package object describing the context in which the call occurs, for improved @@ -1911,7 +1926,7 @@ (define* (bag->derivation bag #:optional context) ;; that lead to the same derivation. Delete those duplicates to avoid ;; issues down the road, such as duplicate entries in '%build-inputs'. (apply (bag-build bag) (bag-name bag) - (delete-duplicates input-drvs input=?) + (deduplicate-inputs input-drvs) #:search-paths paths #:outputs (bag-outputs bag) #:system system (bag-arguments bag))))) @@ -1951,9 +1966,9 @@ (define* (bag->cross-derivation bag #:optional context) all)))) (apply (bag-build bag) (bag-name bag) - #:build-inputs (delete-duplicates build-drvs input=?) - #:host-inputs (delete-duplicates host-drvs input=?) - #:target-inputs (delete-duplicates target-drvs input=?) + #:build-inputs (deduplicate-inputs build-drvs) + #:host-inputs (deduplicate-inputs host-drvs) + #:target-inputs (deduplicate-inputs target-drvs) #:search-paths paths #:native-search-paths npaths #:outputs (bag-outputs bag) -- 2.41.0