GNU bug report logs - #48243
[PATCH] weather: '--display-missing' shows the system type of missing items.

Previous Next

Package: guix-patches;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Wed, 5 May 2021 19:59:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 48243 in the body.
You can then email your comments to 48243 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#48243; Package guix-patches. (Wed, 05 May 2021 19:59:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ludovic Courtès <ludo <at> gnu.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Wed, 05 May 2021 19:59:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: guix-patches <at> gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH] weather: '--display-missing' shows the system type of missing
 items.
Date: Wed,  5 May 2021 21:58:19 +0200
* guix/scripts/weather.scm (store-item-system): New procedure.
(report-server-coverage): Use it to print the system type of each
missing item.
---
 guix/scripts/weather.scm | 29 +++++++++++++++++++++++++++--
 1 file changed, 27 insertions(+), 2 deletions(-)

Hi!

The result of this change is an extra column, when using
‘--display-missing’, that shows the system type of missing items:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env  guix weather --display-missing guix libreoffice inkscape linux-libre -s armhf-linux -s powerpc64le-linux -s x86_64-linux -s aarch64-linux

[...]

Substitutes are missing for the following items:
  /gnu/store/n317afb5f14h7hkxz7ycscd6mhda9plm-libreoffice-6.4.7.2                aarch64-linux
  /gnu/store/xwx5qsalgp3v7vyn6hpvsdy2j59b1973-inkscape-1.0.2                     aarch64-linux
  /gnu/store/8zvik3qkh24jrp1dxqmqg17cw002xs90-linux-libre-5.11.18                aarch64-linux
  /gnu/store/463m6ikbvi071jq5m8cj4gpgcgd0lw6a-guix-1.2.0-21.4dff6ec              powerpc64le-linux
  /gnu/store/lblmg73hbrf051zmzicdp8pfzc47knnx-libreoffice-6.4.7.2                powerpc64le-linux
  /gnu/store/rbf85wfw1v59035l8jz1rcxf72ajbhsp-inkscape-1.0.2                     powerpc64le-linux
  /gnu/store/mxjlc83k40xgjq5qilvp65v82794p1jd-guix-1.2.0-21.4dff6ec              armhf-linux
  /gnu/store/d2ap2kdv1rm39awc4lz5psrsq7l3mklc-libreoffice-6.4.7.2                armhf-linux
  /gnu/store/mvdwc2zyg5brkxfp7cazba8bxn9fp4wk-inkscape-1.0.2                     armhf-linux
  /gnu/store/d5ximwvsizr4my1ib4i4mnwk0hdzmn00-linux-libre-5.11.18                armhf-linux
--8<---------------cut here---------------end--------------->8---

I find the extra info to be very useful, in particular when looking
at the weather of ‘etc/release-manifest.scm’, which targets all the
supported architectures.

Thoughts?

Ludo’.

diff --git a/guix/scripts/weather.scm b/guix/scripts/weather.scm
index 5164fe0494..6d925d416c 100644
--- a/guix/scripts/weather.scm
+++ b/guix/scripts/weather.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017, 2018, 2019, 2020 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2017 Ricardo Wurmus <rekado <at> elephly.net>
 ;;; Copyright © 2018 Kyle Meyer <kyle <at> kyleam.com>
 ;;; Copyright © 2020 Simon Tournier <zimon.toutoune <at> gmail.com>
@@ -171,6 +171,16 @@ about the derivations queued, as is the case with Hydra."
       #f                                          ;no derivation information
       (lset-intersection string=? queued items)))
 
+(define (store-item-system store item)
+  "Return the system (a string such as \"aarch64-linux\")) ITEM targets,
+or #f if it could not be determined."
+  (match (valid-derivers store item)
+    ((drv . _)
+     (and=> (false-if-exception (read-derivation-from-file drv))
+            derivation-system))
+    (()
+     #f)))
+
 (define* (report-server-coverage server items
                                  #:key display-missing?)
   "Report the subset of ITEMS available as substitutes on SERVER.
@@ -270,7 +280,22 @@ are queued~%")
       (when (and display-missing? (not (null? missing)))
         (newline)
         (format #t (G_ "Substitutes are missing for the following items:~%"))
-        (format #t "~{  ~a~%~}" missing))
+
+        ;; Display two columns: store items, and their system type.
+        (format #t "~:{  ~a ~a~%~}"
+                (zip (map (let ((width (max (- (current-terminal-columns)
+                                               20)
+                                            0)))
+                            (lambda (item)
+                              (if (> (string-length item) width)
+                                  item
+                                  (string-pad-right item width))))
+                          missing)
+                     (with-store store
+                       (map (lambda (item)
+                              (or (store-item-system store item)
+                                  (G_ "unknown system")))
+                            missing)))))
 
       ;; Return the coverage ratio.
       (let ((total (length items)))
-- 
2.31.1





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Sat, 08 May 2021 13:10:02 GMT) Full text and rfc822 format available.

Notification sent to Ludovic Courtès <ludo <at> gnu.org>:
bug acknowledged by developer. (Sat, 08 May 2021 13:10:02 GMT) Full text and rfc822 format available.

Message #10 received at 48243-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 48243-done <at> debbugs.gnu.org
Subject: Re: bug#48243: [PATCH] weather: '--display-missing' shows the
 system type of missing items.
Date: Sat, 08 May 2021 15:09:30 +0200
Ludovic Courtès <ludo <at> gnu.org> skribis:

> * guix/scripts/weather.scm (store-item-system): New procedure.
> (report-server-coverage): Use it to print the system type of each
> missing item.

Pushed as 5b0afe2420fcc9542328da4347f9e79490625d99.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 06 Jun 2021 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 296 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.