diff options
author | Ludovic Courtès <ludo@gnu.org> | 2013-05-20 18:14:55 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2013-05-20 18:29:26 +0200 |
commit | 969e678ed9f907764e6412386432dfbddf493f71 (patch) | |
tree | 1e03fb0df41eb9d278dd4d75cc57fdf34c79327e /guix/scripts/build.scm | |
parent | d8482ad0d613758b85fdff90c5d6d6d2785564bf (diff) | |
download | gnu-guix-969e678ed9f907764e6412386432dfbddf493f71.tar gnu-guix-969e678ed9f907764e6412386432dfbddf493f71.tar.gz |
Add `--max-silent-time' to `guix build' and `guix package'.
* guix/scripts/build.scm (%default-options): Add default
`max-silent-time' value.
(show-help, %options): Add `--max-silent-time'.
(guix-build): Pass `max-silent-time' to `set-build-options'.
* guix/scripts/package.scm (%default-options): Add default
`max-silent-time' value.
(show-help, %options): Add `--max-silent-time'.
(guix-package): Pass `max-silent-time' to `set-build-options'.
* guix/ui.scm (string->number*): New procedure.
* tests/derivations.scm ("build-expression->derivation and
max-silent-time"): New test.
* doc/guix.texi (Invoking guix package, Invoking guix build): Document
`--max-silent-time'.
Diffstat (limited to 'guix/scripts/build.scm')
-rw-r--r-- | guix/scripts/build.scm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index 4464d84dfc..ca2fe46e98 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -59,6 +59,7 @@ When SOURCE? is true, return the derivations of the package sources." ;; Alist of default option values. `((system . ,(%current-system)) (substitutes? . #t) + (max-silent-time . 3600) (verbosity . 0))) (define (show-help) @@ -79,6 +80,9 @@ Build the given PACKAGE-OR-DERIVATION and return their output paths.\n")) (display (_ " --no-substitutes build instead of resorting to pre-built substitutes")) (display (_ " + --max-silent-time=SECONDS + mark the build as failed after SECONDS of silence")) + (display (_ " -c, --cores=N allow the use of up to N CPU cores for the build")) (display (_ " -r, --root=FILE make FILE a symlink to the result, and register it @@ -132,6 +136,10 @@ Build the given PACKAGE-OR-DERIVATION and return their output paths.\n")) (lambda (opt name arg result) (alist-cons 'substitutes? #f (alist-delete 'substitutes? result)))) + (option '("max-silent-time") #t #f + (lambda (opt name arg result) + (alist-cons 'max-silent-time (string->number* arg) + result))) (option '(#\r "root") #t #f (lambda (opt name arg result) (alist-cons 'gc-root arg result))) @@ -246,6 +254,7 @@ Build the given PACKAGE-OR-DERIVATION and return their output paths.\n")) #:keep-failed? (assoc-ref opts 'keep-failed?) #:build-cores (or (assoc-ref opts 'cores) 0) #:use-substitutes? (assoc-ref opts 'substitutes?) + #:max-silent-time (assoc-ref opts 'max-silent-time) #:verbosity (assoc-ref opts 'verbosity)) (if (assoc-ref opts 'derivations-only?) |