summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-12-15 15:21:38 +0100
committerLudovic Courtès <ludo@gnu.org>2012-12-15 15:21:38 +0100
commit07ab4bf1fc590642307f18b4d1b8687dde3d664b (patch)
tree254727109072f2c56446eb99cccc5cd623800581
parentda30f55582c53966130ebe814ba084ff7b60fb6a (diff)
downloadguix-07ab4bf1fc590642307f18b4d1b8687dde3d664b.tar.gz
guix-build: Add `--verbosity'.
* guix-build.in (%default-options): Add `verbosity'.
  (%options): Add `--verbosity'.
  (guix-build): Pass it to `set-build-options'.
  (show-help): Update accordingly.
* doc/guix.texi (Invoking guix-build): Document `--verbosity'.
-rw-r--r--doc/guix.texi6
-rw-r--r--guix-build.in15
2 files changed, 18 insertions, 3 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index b8ab94f5ad..21f6d87b3a 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -532,6 +532,12 @@ value @code{0} means to use as many CPU cores as available.
 @itemx -r @var{file}
 Make @var{file} a symlink to the result, and register it as a garbage
 collector root.
+
+@item --verbosity=@var{level}
+Use the given verbosity level.  @var{level} must be an integer between 0
+and 5; higher means more verbose output.  Setting a level of 4 or more
+may be helpful when debugging setup issues with the build daemon.
+
 @end table
 
 Behind the scenes, @command{guix-build} is essentially an interface to
diff --git a/guix-build.in b/guix-build.in
index a3f6f5766b..5136a2a5e4 100644
--- a/guix-build.in
+++ b/guix-build.in
@@ -71,7 +71,8 @@ When SOURCE? is true, return the derivations of the package sources."
 (define %default-options
   ;; Alist of default option values.
   `((system . ,(%current-system))
-    (substitutes? . #t)))
+    (substitutes? . #t)
+    (verbosity . 0)))
 
 (define (show-help)
   (display (_ "Usage: guix-build [OPTION]... PACKAGE-OR-DERIVATION...
@@ -95,6 +96,8 @@ Build the given PACKAGE-OR-DERIVATION and return their output paths.\n"))
   (display (_ "
   -r, --root=FILE        make FILE a symlink to the result, and register it
                          as a garbage collector root"))
+  (display (_ "
+      --verbosity=LEVEL  use the given verbosity LEVEL"))
   (newline)
   (display (_ "
   -h, --help             display this help and exit"))
@@ -147,7 +150,12 @@ Report bugs to: ~a.~%") "@PACKAGE_BUGREPORT@"))
                               (alist-delete 'substitutes? result))))
         (option '(#\r "root") #t #f
                 (lambda (opt name arg result)
-                  (alist-cons 'gc-root arg result)))))
+                  (alist-cons 'gc-root arg result)))
+        (option '("verbosity") #t #f
+                (lambda (opt name arg result)
+                  (let ((level (string->number arg)))
+                    (alist-cons 'verbosity level
+                                (alist-delete 'verbosity result)))))))
 
 
 ;;;
@@ -244,7 +252,8 @@ Report bugs to: ~a.~%") "@PACKAGE_BUGREPORT@"))
           (set-build-options (%store)
                              #:keep-failed? (assoc-ref opts 'keep-failed?)
                              #:build-cores (or (assoc-ref opts 'cores) 0)
-                             #:use-substitutes? (assoc-ref opts 'substitutes?))
+                             #:use-substitutes? (assoc-ref opts 'substitutes?)
+                             #:verbosity (assoc-ref opts 'verbosity))
 
           (if (assoc-ref opts 'derivations-only?)
               (format #t "~{~a~%~}" drv)