From: Hilton Chain via Guix-patches via <guix-patches@gnu.org>
To: 68420@debbugs.gnu.org
Cc: "Hilton Chain" <hako@ultrarare.space>,
"Christopher Baines" <guix@cbaines.net>,
"Josselin Poiret" <dev@jpoiret.xyz>,
"Ludovic Courtès" <ludo@gnu.org>,
"Mathieu Othacehe" <othacehe@gnu.org>,
"Ricardo Wurmus" <rekado@elephly.net>,
"Simon Tournier" <zimon.toutoune@gmail.com>,
"Tobias Geerinckx-Rice" <me@tobias.gr>,
"Zheng Junjie" <zhengjunjie@iscas.ac.cn>
Subject: [bug#68420] [PATCH 1/1] scripts: size: Add ‘system’ argument to ‘ensure-store-item’.
Date: Sat, 13 Jan 2024 15:29:33 +0800 [thread overview]
Message-ID: <bb8fa8defba6b656280a2f59f5291789965fbd0f.1705127855.git.hako@ultrarare.space> (raw)
In-Reply-To: <cover.1705127855.git.hako@ultrarare.space>
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
next prev parent reply other threads:[~2024-01-13 7:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-13 7:25 [bug#68420] [PATCH 0/1] scripts: size: Add ‘system’ argument to ‘ensure-store-item’ Hilton Chain via Guix-patches via
2024-01-13 7:29 ` Hilton Chain via Guix-patches via [this message]
2024-01-13 9:36 ` [bug#68420] [PATCH 1/1] " Mathieu Othacehe
2024-02-01 6:02 ` Hilton Chain via Guix-patches via
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bb8fa8defba6b656280a2f59f5291789965fbd0f.1705127855.git.hako@ultrarare.space \
--to=guix-patches@gnu.org \
--cc=68420@debbugs.gnu.org \
--cc=dev@jpoiret.xyz \
--cc=guix@cbaines.net \
--cc=hako@ultrarare.space \
--cc=ludo@gnu.org \
--cc=me@tobias.gr \
--cc=othacehe@gnu.org \
--cc=rekado@elephly.net \
--cc=zhengjunjie@iscas.ac.cn \
--cc=zimon.toutoune@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.