all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#53933] [PATCH 0/3] Tweak build output coming from (guix status)
@ 2022-02-10 22:08 Ludovic Courtès
  2022-02-10 22:16 ` [bug#53933] [PATCH 1/3] status: Do not print .drv file names for grafts Ludovic Courtès
  2022-02-16 16:02 ` bug#53933: [PATCH 0/3] Tweak build output coming from (guix status) Ludovic Courtès
  0 siblings, 2 replies; 5+ messages in thread
From: Ludovic Courtès @ 2022-02-10 22:08 UTC (permalink / raw)
  To: 53933; +Cc: Ludovic Courtès

Hi!

Here are cosmetic changes to improve the way things get printed.

Feedback welcome!

Ludo’.

Ludovic Courtès (3):
  status: Do not print .drv file names for grafts.
  status: Use bold more sparsely at -v1.
  status: Do not pass a non-literal format string to 'format'.

 guix/status.scm | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)


base-commit: 0e103ec611acb25966bedc7ac9537b34f0a53306
-- 
2.34.0





^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#53933] [PATCH 1/3] status: Do not print .drv file names for grafts.
  2022-02-10 22:08 [bug#53933] [PATCH 0/3] Tweak build output coming from (guix status) Ludovic Courtès
@ 2022-02-10 22:16 ` Ludovic Courtès
  2022-02-10 22:16   ` [bug#53933] [PATCH 2/3] status: Use bold more sparsely at -v1 Ludovic Courtès
  2022-02-10 22:16   ` [bug#53933] [PATCH 3/3] status: Do not pass a non-literal format string to 'format' Ludovic Courtès
  2022-02-16 16:02 ` bug#53933: [PATCH 0/3] Tweak build output coming from (guix status) Ludovic Courtès
  1 sibling, 2 replies; 5+ messages in thread
From: Ludovic Courtès @ 2022-02-10 22:16 UTC (permalink / raw)
  To: 53933; +Cc: Ludovic Courtès

With this change, "guix build vim-full" prints:

  applying 15 grafts for vim-full-8.2.4306 ...

instead of showing /gnu/store/…-vim-full-8.2.4306.drv.

* guix/status.scm (print-build-event): In the 'graft' case, print just
the "package name" part of DRV.
---
 guix/status.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/guix/status.scm b/guix/status.scm
index fba28765df..868f6d6296 100644
--- a/guix/status.scm
+++ b/guix/status.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017-2022 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -483,7 +483,9 @@ (define erase-current-line*
              (format port (info (N_ "applying ~a graft for ~a ..."
                                     "applying ~a grafts for ~a ..."
                                     count))
-                     count drv)))
+                     count
+                     (string-drop-right (store-path-package-name drv)
+                                        (string-length ".drv")))))
          ('profile
           (let ((count (match (assq-ref properties 'profile)
                          (#f  0)
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [bug#53933] [PATCH 2/3] status: Use bold more sparsely at -v1.
  2022-02-10 22:16 ` [bug#53933] [PATCH 1/3] status: Do not print .drv file names for grafts Ludovic Courtès
@ 2022-02-10 22:16   ` Ludovic Courtès
  2022-02-10 22:16   ` [bug#53933] [PATCH 3/3] status: Do not pass a non-literal format string to 'format' Ludovic Courtès
  1 sibling, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2022-02-10 22:16 UTC (permalink / raw)
  To: 53933; +Cc: Ludovic Courtès

Until now, at -v1, all the "apply N grafts" messages (for instance)
would be displayed in bold.  This would typically result in several
subsequent lines all bold, although none of them is particularly
interesting.  This improves on that by avoiding bold at -v1 for these
messages.

* guix/status.scm (print-build-event)[emph]: New variable.
Use it for the "View build log", "expected hash", and "offloading build"
messages.
[info]: Default to 'identity' when PRINT-URLS? and PRINT-LOG? are both
false.
---
 guix/status.scm | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/guix/status.scm b/guix/status.scm
index 868f6d6296..5b903372f1 100644
--- a/guix/status.scm
+++ b/guix/status.scm
@@ -414,6 +414,11 @@ (define* (print-build-event event old-status status
 addition to build events.  When PRINT-URLS? is true, display the URL of
 substitutes being downloaded."
   (define info
+    (if (and colorize? (or print-urls? print-log?))
+        (cute colorize-string <> (color BOLD))
+        identity))
+
+  (define emph
     (if colorize?
         (cute colorize-string <> (color BOLD))
         identity))
@@ -526,7 +531,7 @@ (define erase-current-line*
         (format port (failure (G_ "Could not find build log for '~a'."))
                 drv))
        (log
-        (format port (info (G_ "View build log at '~a'.")) log)))
+        (format port (emph (G_ "View build log at '~a'.")) log)))
      (newline port))
     (('substituter-started item _ ...)
      (erase-current-line*)
@@ -577,12 +582,12 @@ (define erase-current-line*
      ;; /gnu/store/…-sth:", where "sha256" is the hash algorithm.
      (format port (failure (G_ "~a hash mismatch for ~a:")) algo item)
      (newline port)
-     (format port (info (G_ "\
+     (format port (emph (G_ "\
   expected hash: ~a
   actual hash:   ~a~%"))
              expected actual))
     (('build-remote drv host _ ...)
-     (format port (info (G_ "offloading build of ~a to '~a'")) drv host)
+     (format port (emph (G_ "offloading build of ~a to '~a'")) drv host)
      (newline port))
     (('build-log pid line)
      (if (multiplexed-output-supported?)
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [bug#53933] [PATCH 3/3] status: Do not pass a non-literal format string to 'format'.
  2022-02-10 22:16 ` [bug#53933] [PATCH 1/3] status: Do not print .drv file names for grafts Ludovic Courtès
  2022-02-10 22:16   ` [bug#53933] [PATCH 2/3] status: Use bold more sparsely at -v1 Ludovic Courtès
@ 2022-02-10 22:16   ` Ludovic Courtès
  1 sibling, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2022-02-10 22:16 UTC (permalink / raw)
  To: 53933; +Cc: Ludovic Courtès

* guix/status.scm (print-build-event): Use 'display' instead of 'format'
for hooks.
---
 guix/status.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/guix/status.scm b/guix/status.scm
index 5b903372f1..b8905c9542 100644
--- a/guix/status.scm
+++ b/guix/status.scm
@@ -503,7 +503,7 @@ (define erase-current-line*
           (let ((hook-type (assq-ref properties 'hook)))
             (or (and=> (hook-message hook-type)
                        (lambda (msg)
-                         (format port (info msg))))
+                         (display (info msg) port)))
                 (format port (info (G_ "running profile hook of type '~a'..."))
                         hook-type))))
          (_
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#53933: [PATCH 0/3] Tweak build output coming from (guix status)
  2022-02-10 22:08 [bug#53933] [PATCH 0/3] Tweak build output coming from (guix status) Ludovic Courtès
  2022-02-10 22:16 ` [bug#53933] [PATCH 1/3] status: Do not print .drv file names for grafts Ludovic Courtès
@ 2022-02-16 16:02 ` Ludovic Courtès
  1 sibling, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2022-02-16 16:02 UTC (permalink / raw)
  To: 53933-done

Ludovic Courtès <ludo@gnu.org> skribis:

>   status: Do not print .drv file names for grafts.
>   status: Use bold more sparsely at -v1.
>   status: Do not pass a non-literal format string to 'format'.

Pushed as 5d4d8d83e4aa6db2e0a325e2ffb915c12fe5234d.

Ludo’.




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-02-16 16:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-10 22:08 [bug#53933] [PATCH 0/3] Tweak build output coming from (guix status) Ludovic Courtès
2022-02-10 22:16 ` [bug#53933] [PATCH 1/3] status: Do not print .drv file names for grafts Ludovic Courtès
2022-02-10 22:16   ` [bug#53933] [PATCH 2/3] status: Use bold more sparsely at -v1 Ludovic Courtès
2022-02-10 22:16   ` [bug#53933] [PATCH 3/3] status: Do not pass a non-literal format string to 'format' Ludovic Courtès
2022-02-16 16:02 ` bug#53933: [PATCH 0/3] Tweak build output coming from (guix status) Ludovic Courtès

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.