summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-05-29 23:08:06 +0200
committerLudovic Courtès <ludo@gnu.org>2013-05-29 23:22:05 +0200
commit56b1f4b78070e3012b8c46dae1d2008c8d3e1c0a (patch)
tree4222e3be38c3611646dc970c7140321a34ad50f5 /guix
parentc3eb878f0beb792f19d72edef62f267560c39162 (diff)
downloadguix-patches-56b1f4b78070e3012b8c46dae1d2008c8d3e1c0a.tar
guix-patches-56b1f4b78070e3012b8c46dae1d2008c8d3e1c0a.tar.gz
build, package: Add `--fallback' option.
* guix/scripts/build.scm (%options, show-help): Add `--fallback'. (guix-build): Call `set-build-options' with #:fallback?. * guix/scripts/package.scm (%options, show-help): Add `--fallback'. (guix-package): Call `set-build-options' with #:fallback?. * doc/guix.texi (Invoking guix package, Invoking guix build): Document `--fallback'.
Diffstat (limited to 'guix')
-rw-r--r--guix/scripts/build.scm7
-rw-r--r--guix/scripts/package.scm7
2 files changed, 14 insertions, 0 deletions
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index 995d96362b..26cd28215e 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -82,6 +82,8 @@ Build the given PACKAGE-OR-DERIVATION and return their output paths.\n"))
(display (_ "
-n, --dry-run do not build the derivations"))
(display (_ "
+ --fallback fall back to building when the substituter fails"))
+ (display (_ "
--no-substitutes build instead of resorting to pre-built substitutes"))
(display (_ "
--max-silent-time=SECONDS
@@ -140,6 +142,10 @@ Build the given PACKAGE-OR-DERIVATION and return their output paths.\n"))
(option '(#\n "dry-run") #f #f
(lambda (opt name arg result)
(alist-cons 'dry-run? #t result)))
+ (option '("fallback") #f #f
+ (lambda (opt name arg result)
+ (alist-cons 'fallback? #t
+ (alist-delete 'fallback? result))))
(option '("no-substitutes") #f #f
(lambda (opt name arg result)
(alist-cons 'substitutes? #f
@@ -267,6 +273,7 @@ Build the given PACKAGE-OR-DERIVATION and return their output paths.\n"))
(set-build-options (%store)
#:keep-failed? (assoc-ref opts 'keep-failed?)
#:build-cores (or (assoc-ref opts 'cores) 0)
+ #:fallback? (assoc-ref opts 'fallback?)
#:use-substitutes? (assoc-ref opts 'substitutes?)
#:max-silent-time (assoc-ref opts 'max-silent-time)
#:verbosity (assoc-ref opts 'verbosity))
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index cd93cc3758..69b7efd154 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -438,6 +438,8 @@ Install, remove, or upgrade PACKAGES in a single transaction.\n"))
(display (_ "
-n, --dry-run show what would be done without actually doing it"))
(display (_ "
+ --fallback fall back to building when the substituter fails"))
+ (display (_ "
--no-substitutes build instead of resorting to pre-built substitutes"))
(display (_ "
--max-silent-time=SECONDS
@@ -499,6 +501,10 @@ Install, remove, or upgrade PACKAGES in a single transaction.\n"))
(option '(#\n "dry-run") #f #f
(lambda (opt name arg result)
(alist-cons 'dry-run? #t result)))
+ (option '("fallback") #f #f
+ (lambda (opt name arg result)
+ (alist-cons 'fallback? #t
+ (alist-delete 'fallback? result))))
(option '("no-substitutes") #f #f
(lambda (opt name arg result)
(alist-cons 'substitutes? #f
@@ -909,6 +915,7 @@ more information.~%"))
(with-error-handling
(parameterize ((%store (open-connection)))
(set-build-options (%store)
+ #:fallback? (assoc-ref opts 'fallback?)
#:use-substitutes?
(assoc-ref opts 'substitutes?)
#:max-silent-time