From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:1008:1e59::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id R0uOIhA8omVOeAEAkFu2QA (envelope-from ) for ; Sat, 13 Jan 2024 08:30:24 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id kn2hGxA8omWvTgEA62LTzQ (envelope-from ) for ; Sat, 13 Jan 2024 08:30:24 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ultrarare.space header.s=dkim header.b="3qBnTr/w"; 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=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1705131024; h=from:from:sender:sender:reply-to: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:dkim-signature; bh=ZH0vL1/d5hAuxBGC+i7JzgNpWOPhMozPvvwiyJlQjTg=; b=ovj5TLe0uAUnUM/YuhO1CCGbGfjNrxvk4ofRicW0aW7oHAygsmIzNU/V7jo/FCqmZEowEN y2HSGr9IHrTL1l0y2fEgwcnyfINBe5PmQskXItOK+7s5YtsDANU46aHQAmeufcowgUI0cg 3VwDpivKmvWoo0ywwBOr08zm0QUv08aCBvde85aeX7bW25lLSBXP5LDxsexjR5ZosLJ4x/ g6dBQy8wk+oJAhZI4MmL3xm1XCF+PNuP/OxeJEbsC3T3EXy/c1OFZt8gLdifkL7aosjO0e hUziX0ZxBwyYOpT57duand47V/acd9vGTQI1kuOBO/KdsQ4X0hk1D6Mxbbhwaw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ultrarare.space header.s=dkim header.b="3qBnTr/w"; 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=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1705131024; a=rsa-sha256; cv=none; b=UImTi2QUTFZlN9+Lml/6sJ1/WyEt4u6b6NeS6mtjRiGpHNbLoas8Mj6seRxcBxJrEsw+1l a6qLqzQ5agiRCgynMrtAMb+vZPPMpRVY6o072tIgSZ+opKp+gFWJuUMo8LXZCWB8u6SEr7 NpPEJomm5leD36s3GOIuJxX7z3iFQ37EDHOylISBKi7wbs2xNB/swPm0cZ4Adb4jp3hKJ0 RawXVQmyxgoP6glvRiuH0bb11bh7NSaiNPOC1GYMX/UbAXeqXdGAM2hM/EyPeuEmltmXKB T1E0b1oaOuMBi1Oh0bu+ld6ZSMC2Xvjw0tKq0LWuOy/el7etfipHvKryzaRt7w== 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 5786C10A9A for ; Sat, 13 Jan 2024 08:30:24 +0100 (CET) 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?Q?=E2=80=98system=E2=80=99?= argument to =?UTF-8?Q?=E2=80=98ensure-store-item=E2=80=99.?= 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== Date: Sat, 13 Jan 2024 15:29:33 +0800 Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 From: Hilton Chain via Guix-patches via 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-Queue-Id: 5786C10A9A X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -3.81 X-Spam-Score: -3.81 X-TUID: fXsZZHX5gdhG 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(-) 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 -- 2.41.0