summaryrefslogtreecommitdiff
path: root/guix/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'guix/scripts')
-rw-r--r--guix/scripts/build.scm9
-rw-r--r--guix/scripts/package.scm12
2 files changed, 20 insertions, 1 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?)
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 7fda71e7e9..e68d0dd902 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -413,6 +413,7 @@ PACKAGES, in the context of PROFILE."
(define %default-options
;; Alist of default option values.
`((profile . ,%current-profile)
+ (max-silent-time . 3600)
(substitutes? . #t)))
(define (show-help)
@@ -439,6 +440,9 @@ Install, remove, or upgrade PACKAGES in a single transaction.\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 (_ "
--bootstrap use the bootstrap Guile to build the profile"))
(display (_ "
--verbose produce verbose output"))
@@ -499,6 +503,10 @@ Install, remove, or upgrade PACKAGES in a single transaction.\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 '("bootstrap") #f #f
(lambda (opt name arg result)
(alist-cons 'bootstrap? #t result)))
@@ -902,7 +910,9 @@ more information.~%"))
(parameterize ((%store (open-connection)))
(set-build-options (%store)
#:use-substitutes?
- (assoc-ref opts 'substitutes?))
+ (assoc-ref opts 'substitutes?)
+ #:max-silent-time
+ (assoc-ref opts 'max-silent-time))
(parameterize ((%guile-for-build
(package-derivation (%store)