guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

04/05: weather: Add '--display-missing'.


From: guix-commits
Subject: 04/05: weather: Add '--display-missing'.
Date: Thu, 12 Mar 2020 13:33:20 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 71bb485541328cdce214ada44be998570571bf36
Author: Ludovic Courtès <address@hidden>
AuthorDate: Thu Mar 12 18:10:26 2020 +0100

    weather: Add '--display-missing'.
    
    * guix/scripts/weather.scm (report-server-coverage): Add
     #:display-missing? and honor it.
    (show-help, %options): Add "--display-missing".
    (guix-weather): Pass #:display-missing? to 'report-server-coverage'.
    * doc/guix.texi (Invoking guix weather): Document it.
---
 doc/guix.texi            |  3 +++
 guix/scripts/weather.scm | 22 ++++++++++++++++++----
 2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 4f8f7cf..ca21857 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -10860,6 +10860,9 @@ likewise for @code{qgpgme} and the 46 packages that 
depend on it.
 If you are a Guix developer, or if you are taking care of this build farm,
 you'll probably want to have a closer look at these packages: they may simply
 fail to build.
+
+@item --display-missing
+Display the list of store items for which substitutes are missing.
 @end table
 
 @node Invoking guix processes
diff --git a/guix/scripts/weather.scm b/guix/scripts/weather.scm
index 6298447..60915d3 100644
--- a/guix/scripts/weather.scm
+++ b/guix/scripts/weather.scm
@@ -175,8 +175,10 @@ about the derivations queued, as is the case with Hydra."
       #f                                          ;no derivation information
       (lset-intersection string=? queued items)))
 
-(define (report-server-coverage server items)
-  "Report the subset of ITEMS available as substitutes on SERVER."
+(define* (report-server-coverage server items
+                                 #:key display-missing?)
+  "Report the subset of ITEMS available as substitutes on SERVER.
+When DISPLAY-MISSING? is true, display the list of missing substitutes."
   (define MiB (* (expt 2 20) 1.))
 
   (format #t (G_ "looking for ~h store items on ~a...~%")
@@ -260,7 +262,12 @@ are queued~%")
                                system
                                (* (throughput builds build-timestamp)
                                   3600.))))
-                    (histogram build-system cons '() latest)))))))
+                    (histogram build-system cons '() latest))))
+
+      (when (and display-missing? (not (null? missing)))
+        (newline)
+        (format #t (G_ "Substitutes are missing for the following items:~%"))
+        (format #t "~{  ~a~%~}" missing)))))
 
 
 ;;;
@@ -281,6 +288,8 @@ Report the availability of substitutes.\n"))
                          show substitute coverage for packages with at least
                          COUNT dependents"))
   (display (G_ "
+      --display-missing  display the list of missing substitutes"))
+  (display (G_ "
   -s, --system=SYSTEM    consider substitutes for SYSTEM--e.g., 
\"i686-linux\""))
   (newline)
   (display (G_ "
@@ -318,6 +327,9 @@ Report the availability of substitutes.\n"))
                    (alist-cons 'coverage
                                (if arg (string->number* arg) 0)
                                result)))
+         (option '("display-missing") #f #f
+                 (lambda (opt name arg result)
+                   (alist-cons 'display-missing? #t result)))
          (option '(#\s "system") #t #f
                  (lambda (opt name arg result)
                    (alist-cons 'system arg result)))))
@@ -525,7 +537,9 @@ SERVER.  Display information for packages with at least 
THRESHOLD dependents."
                                     (package-outputs packages system))
                                   systems))))))
         (for-each (lambda (server)
-                    (report-server-coverage server items)
+                    (report-server-coverage server items
+                                            #:display-missing?
+                                            (assoc-ref opts 'display-missing?))
                     (match (assoc-ref opts 'coverage)
                       (#f #f)
                       (threshold



reply via email to

[Prev in Thread] Current Thread [Next in Thread]