summaryrefslogtreecommitdiff
path: root/guix/scripts/build.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-12-09 11:04:57 +0100
committerLudovic Courtès <ludo@gnu.org>2015-12-09 14:29:41 +0100
commita8d65643fb21fdf6c46b3d248bda411d970e53ab (patch)
tree70509da63d318020aa2990720c58496e2515e839 /guix/scripts/build.scm
parent58c08df0544bc39b3b5a8f6638f776159b6b8d8e (diff)
downloadgnu-guix-a8d65643fb21fdf6c46b3d248bda411d970e53ab.tar
gnu-guix-a8d65643fb21fdf6c46b3d248bda411d970e53ab.tar.gz
guix build: Add '--check'.
* guix/derivations.scm (build-derivations): Add optional 'mode' parameter. * guix/scripts/build.scm (%default-options): Add 'build-mode'. (show-help, %options): Add '--check'. (guix-build): Honor 'build-mode' key of OPTS. Pass it to 'show-what-to-build' and 'build-derivations'. * doc/guix.texi (Invoking guix build): Document it. (Substitutes): Mention it.
Diffstat (limited to 'guix/scripts/build.scm')
-rw-r--r--guix/scripts/build.scm15
1 files changed, 13 insertions, 2 deletions
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index 072840b953..8ecd9560ed 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -285,6 +285,7 @@ options handled by 'set-build-options-from-command-line', and listed in
(define %default-options
;; Alist of default option values.
`((system . ,(%current-system))
+ (build-mode . ,(build-mode normal))
(graft? . #t)
(substitutes? . #t)
(build-hook? . #t)
@@ -317,6 +318,8 @@ Build the given PACKAGE-OR-DERIVATION and return their output paths.\n"))
(display (_ "
-d, --derivations return the derivation paths of the given packages"))
(display (_ "
+ --check rebuild items to check for non-determinism issues"))
+ (display (_ "
-r, --root=FILE make FILE a symlink to the result, and register it
as a garbage collector root"))
(display (_ "
@@ -356,6 +359,12 @@ Build the given PACKAGE-OR-DERIVATION and return their output paths.\n"))
(leave (_ "invalid argument: '~a' option argument: ~a, ~
must be one of 'package', 'all', or 'transitive'~%")
name arg)))))
+ (option '("check") #f #f
+ (lambda (opt name arg result . rest)
+ (apply values
+ (alist-cons 'build-mode (build-mode check)
+ result)
+ rest)))
(option '(#\s "system") #t #f
(lambda (opt name arg result)
(alist-cons 'system arg
@@ -540,6 +549,7 @@ needed."
(let* ((opts (parse-command-line args %options
(list %default-options)))
(store (open-connection))
+ (mode (assoc-ref opts 'build-mode))
(drv (options->derivations store opts))
(urls (map (cut string-append <> "/log")
(if (assoc-ref opts 'substitutes?)
@@ -562,7 +572,8 @@ needed."
(unless (assoc-ref opts 'log-file?)
(show-what-to-build store drv
#:use-substitutes? (assoc-ref opts 'substitutes?)
- #:dry-run? (assoc-ref opts 'dry-run?)))
+ #:dry-run? (assoc-ref opts 'dry-run?)
+ #:mode mode))
(cond ((assoc-ref opts 'log-file?)
(for-each (cut show-build-log store <> urls)
@@ -575,7 +586,7 @@ needed."
(map (compose list derivation-file-name) drv)
roots))
((not (assoc-ref opts 'dry-run?))
- (and (build-derivations store drv)
+ (and (build-derivations store drv mode)
(for-each show-derivation-outputs drv)
(for-each (cut register-root store <> <>)
(map (lambda (drv)