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 CPScIGUxmGU/WQEAkFu2QA (envelope-from ) for ; Fri, 05 Jan 2024 17:42:13 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id aO5xGWUxmGWZNQAAqHPOHw (envelope-from ) for ; Fri, 05 Jan 2024 17:42:13 +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=1704472933; 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=gwb8ieiTRfROJDbSVSE7w+6dRB1rvUUXvWXpXe90ICs=; b=PkbhXPpRHSCYpNbDUde8Yu/hhXYzebleEOTuEqjQwHVubK0fnOJn7+XxLNqdae7tDub/1G w45OONEToZK1hBsOzPwJ1P+KTaeb1CCTRBGK9EEcnx+gq4Y6hU3dxayHz6PVBMAKx2dyRu hoqcQlIWJdmNMGJdV9EUXSJl6BTdiH34Usxt1w289tlo0gUvBJZ5pnbIQJtqj4srSjgDJU DZZMwp0vMP+kYK1zgCDRX6sXmJ5zODWpjPZHEdnRVzLI7hYsoTb3Sq55vxf/EArhY1VZV+ gtlX5g8wu6A80jyp1DnhkhVz66RXme3bDbdOyuvsEUCsi2F79h9bE6UU3dz8Fg== 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 ARC-Seal: i=1; s=key1; d=yhetil.org; t=1704472933; a=rsa-sha256; cv=none; b=TVHvNepwwmUPecm2UMiBY9vvNSsvA1ORDjPA/Yp22NTPJWj5rQbHvXth4uwryJq9ArOpyd S/tqw/mho5EcqYBXL/AY7KtaCKmKqpToUiIKE9L6gQXCeV1He0XSu4Autlu0H6eanZdxV4 9W40Vu/isH3K8zQjERi/fCrlrEbQRsm9mFwLcDKdpJ8L7ig0NQ9c0Q44LDOlnz0X/twDy7 UM3oPHB/73Ftsx9oB9TElacfuvNlz8RxlI6M1z9GMIn4qBGzGHsbZWimo3MmJXLjWNK5Y7 a5Md4aQtumXia4DsR+7TClzYODhNJTzllJF/bLoWuUzQvF44q6hFoKfltepzgw== 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 32DEA3B84C for ; Fri, 5 Jan 2024 17:42:13 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLnGq-00086a-S6; Fri, 05 Jan 2024 11:42:10 -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 1rLnGi-00082M-Ii for guix-patches@gnu.org; Fri, 05 Jan 2024 11:42:03 -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 1rLnGg-00036U-Hu; Fri, 05 Jan 2024 11:42:00 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rLnGk-0003vo-TL; Fri, 05 Jan 2024 11:42:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68266] [PATCH 5/7] gnu: Memozise cross-mig results. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, guix-patches@gnu.org Resent-Date: Fri, 05 Jan 2024 16:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68266 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68266@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= X-Debbugs-Original-Xcc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 68266-submit@debbugs.gnu.org id=B68266.170447286415017 (code B ref 68266); Fri, 05 Jan 2024 16:42:02 +0000 Received: (at 68266) by debbugs.gnu.org; 5 Jan 2024 16:41:04 +0000 Received: from localhost ([127.0.0.1]:57736 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rLnFn-0003tz-Iw for submit@debbugs.gnu.org; Fri, 05 Jan 2024 11:41:04 -0500 Received: from mira.cbaines.net ([2a01:7e00:e000:2f8:fd4d:b5c7:13fb:3d27]:33519) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rLnFh-0003s1-8J for 68266@debbugs.gnu.org; Fri, 05 Jan 2024 11:40:59 -0500 Received: from localhost (unknown [217.155.61.229]) by mira.cbaines.net (Postfix) with ESMTPSA id 5C84D27BBEC for <68266@debbugs.gnu.org>; Fri, 5 Jan 2024 16:40:52 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id d12c39fb for <68266@debbugs.gnu.org>; Fri, 5 Jan 2024 16:40:51 +0000 (UTC) From: Christopher Baines Date: Fri, 5 Jan 2024 16:40:47 +0000 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: <13f83a0db585e81572240e35dfef473aa73fe996.1704472849.git.mail@cbaines.net> References: <13f83a0db585e81572240e35dfef473aa73fe996.1704472849.git.mail@cbaines.net> 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -4.77 X-Spam-Score: -4.77 X-Migadu-Queue-Id: 32DEA3B84C X-TUID: QRgDj7ZJSW9v To ensure that it just returns a single package record for some given arguments, as this helps to avoid poor performance of the store connection object cache. * gnu/packages/cross-base.scm (cross-mig): Move code to cross-mig/implementation and call it. (cross-mig/implementation) New procedure. Change-Id: Iaf2a69c48664d2f0766b9d2f6e981653e0e3c44c --- gnu/packages/cross-base.scm | 56 +++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index f966e2f5ac..6c6c6e7636 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -467,37 +467,39 @@ (define* (cross-mig target (xbinutils (cross-binutils target))) "Return a cross-mig for TARGET, where TARGET is a GNU triplet. Use XGCC as the base compiler. Use XBINUTILS as the associated cross-Binutils." - (define xgnumach-headers - (cross-gnumach-headers target - #:xgcc xgcc - #:xbinutils xbinutils)) - (package - (inherit mig) - (name (string-append "mig-cross")) - (arguments - (substitute-keyword-arguments (package-arguments mig) - ((#:configure-flags flags #~'()) - #~(list #$(string-append "--target=" target))) - ((#:tests? _ #f) - #f) - ((#:phases phases #~%standard-phases) - #~(modify-phases #$phases - (add-before 'configure 'set-cross-headers-path - (lambda* (#:key inputs #:allow-other-keys) - (let* ((mach #+xgnumach-headers) - (cpath (string-append mach "/include"))) - (for-each (lambda (variable) - (setenv variable cpath)) - '#$%gcc-cross-include-paths)))))))) - (propagated-inputs - (list xgnumach-headers)) - (native-inputs - (modify-inputs (package-native-inputs mig) - (prepend xgcc xbinutils))))) + (cross-mig/implementation target xgcc xbinutils)) +(define cross-mig/implementation + (mlambda (target xgcc xbinutils) + "Return a cross-mig for TARGET, where TARGET is a GNU triplet. Use XGCC as +the base compiler. Use XBINUTILS as the associated cross-Binutils." + (define xgnumach-headers + (cross-gnumach-headers target + #:xgcc xgcc + #:xbinutils xbinutils)) (package + (inherit mig) + (name (string-append "mig-cross")) (arguments + (substitute-keyword-arguments (package-arguments mig) + ((#:configure-flags flags #~'()) + #~(list #$(string-append "--target=" target))) + ((#:tests? _ #f) + #f) + ((#:phases phases #~%standard-phases) #~(modify-phases #$phases + (add-before 'configure 'set-cross-headers-path + (lambda* (#:key inputs #:allow-other-keys) + (let* ((mach #+xgnumach-headers) + (cpath (string-append mach "/include"))) + (for-each (lambda (variable) + (setenv variable cpath)) + '#$%gcc-cross-include-paths)))))))) + (propagated-inputs + (list xgnumach-headers)) + (native-inputs + (modify-inputs (package-native-inputs mig) + (prepend xgcc xbinutils)))))) (define cross-kernel-headers/implementation (mlambda (target linux-headers xgcc xbinutils) -- 2.41.0