From patchwork Sat Jan 13 07:29:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hilton Chain X-Patchwork-Id: 58832 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id C6B0527BBEA; Sat, 13 Jan 2024 07:30:24 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,PDS_OTHER_BAD_TLD, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 415CC27BBE2 for ; Sat, 13 Jan 2024 07:30:24 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rOYT8-0001ey-Mv; Sat, 13 Jan 2024 02:30:14 -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 1rOYT1-0001ec-UN for guix-patches@gnu.org; Sat, 13 Jan 2024 02:30:10 -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 1rOYT1-0001Lw-Fi; Sat, 13 Jan 2024 02:30:07 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rOYSw-0005wo-S2; Sat, 13 Jan 2024 02:30:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68420] [PATCH 1/1] scripts: size: Add =?utf-8?b?4oCYc3lzdGVt?= =?utf-8?b?4oCZ?= argument to =?utf-8?b?4oCYZW5zdXJlLXN0b3JlLWl0ZW3igJku?= Resent-From: Hilton Chain 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, zhengjunjie@iscas.ac.cn, guix-patches@gnu.org Resent-Date: Sat, 13 Jan 2024 07:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68420 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68420@debbugs.gnu.org Cc: Hilton Chain , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice , Zheng Junjie X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice , Zheng Junjie Received: via spool by 68420-submit@debbugs.gnu.org id=B68420.170513099022780 (code B ref 68420); Sat, 13 Jan 2024 07:30:02 +0000 Received: (at 68420) by debbugs.gnu.org; 13 Jan 2024 07:29:50 +0000 Received: from localhost ([127.0.0.1]:38291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOYSj-0005vM-Ln for submit@debbugs.gnu.org; Sat, 13 Jan 2024 02:29:50 -0500 Received: from mail.boiledscript.com ([144.168.59.46]:37014) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOYSh-0005vD-Q5 for 68420@debbugs.gnu.org; Sat, 13 Jan 2024 02:29:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space; s=dkim; t=1705130976; h=from:from: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: in-reply-to:in-reply-to:references:references; bh=ZH0vL1/d5hAuxBGC+i7JzgNpWOPhMozPvvwiyJlQjTg=; b=3qBnTr/wKvVepP3GipERv1oKQyhTqVPum4o9SFpyxFojfYufpnY+jJo0CAIFz6/tPZLAWI m//zZedcILyZ8LutqOjgtn9pFL7SEkXZCvSJ9PlQYg07pXhbyrurLnOvy8D2AHgq9xSqhk PHqhjjiADE9R9Op04lrNfUKlGO2ZTFKDzYNitMTwnS25/1hxjTH6K03OqwJOGyRAQ1rNzH dW/lihRWCcZco2aGNaPSmqlr8N2gEdwAKRe4h02gnold4i6OlaCLvtrnfY64gJ5/9Oig6s 1+j7zI0B4OHdsyKGXCG+PdbFhicQ2XrGglU5KuhXBLR3+6g25k1rBSYKY+sy9Q== Authentication-Results: mail.boiledscript.com; auth=pass smtp.mailfrom=hako@ultrarare.space Date: Sat, 13 Jan 2024 15:29:33 +0800 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Spamd-Bar: -- 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: , Reply-to: Hilton Chain X-ACL-Warn: , Hilton Chain via Guix-patches X-Patchwork-Original-From: Hilton Chain via Guix-patches via From: Hilton Chain Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches This is a follow-up to c245a54aab348642178129a9aad501b81a3089b4. ‘%current-system’ is already parameterized within ‘run-with-store’, the root cause is that ‘mlet*’ bindings are evaluated before the parameterization. * guix/scripts/size.scm (ensure-store-item): Add ‘system’ argument and pass it to ‘package->derivation’. (guix-size): Adjust accordingly. Change-Id: I910af7c137737bcd0ee079e57a81c4114ab5ae32 --- guix/scripts/size.scm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) -- 2.41.0 diff --git a/guix/scripts/size.scm b/guix/scripts/size.scm index 8a8676a16f..0603c0498a 100644 --- a/guix/scripts/size.scm +++ b/guix/scripts/size.scm @@ -168,7 +168,7 @@ (define (store-profile items) (return (profile item size dependencies))))) sizes))) -(define* (ensure-store-item spec-or-item) +(define* (ensure-store-item spec-or-item #:optional (system (%current-system))) "Return a store file name. If SPEC-OR-ITEM is a store file name, return it as is. Otherwise, assume SPEC-OR-ITEM is a package output specification such as \"guile:debug\" or \"gcc-4.8\" and return its store file name." @@ -177,7 +177,7 @@ (define* (ensure-store-item spec-or-item) (return spec-or-item) (let-values (((package output) (specification->package+output spec-or-item))) - (mlet %store-monad ((drv (package->derivation package))) + (mlet %store-monad ((drv (package->derivation package system))) ;; Note: we don't try building DRV like 'guix archive' does ;; because we don't have to since we can instead rely on ;; substitute meta-data. @@ -317,8 +317,7 @@ (define-command (guix-size . args) ;; Turn off grafts because (1) substitute servers do not serve grafted ;; packages, and (2) they do not make any difference on the ;; resulting size. - (parameterize ((%graft? #f) - (%current-system system)) + (parameterize ((%graft? #f)) (with-store store (set-build-options store #:use-substitutes? #t @@ -326,7 +325,9 @@ (define-command (guix-size . args) (run-with-store store (mlet* %store-monad ((items (mapm %store-monad - ensure-store-item files)) + (cut ensure-store-item <> + system) + files)) (profile (store-profile items))) (if map-file (begin