Skip to content
Snippets Groups Projects
Commit 581f9eb8 authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

guix package: Add `--no-substitutes'.

* guix/scripts/package.scm (%default-options): Add `substitutes?'.
  (show-help, %options): Add and document `--no-substitutes'.
  (guix-package): Call `set-build-options' to honor `substitutes?'.
parent cdf20220
No related branches found
No related tags found
No related merge requests found
...@@ -570,6 +570,9 @@ Use @var{profile} instead of the user's default profile. ...@@ -570,6 +570,9 @@ Use @var{profile} instead of the user's default profile.
@itemx -n @itemx -n
Show what would be done without actually doing it. Show what would be done without actually doing it.
@item --no-substitutes
Build instead of resorting to pre-built substitutes.
@item --verbose @item --verbose
Produce verbose output. In particular, emit the environment's build log Produce verbose output. In particular, emit the environment's build log
on the standard error port. on the standard error port.
......
...@@ -313,7 +313,8 @@ (define (check-package-freshness package) ...@@ -313,7 +313,8 @@ (define (check-package-freshness package)
(define %default-options (define %default-options
;; Alist of default option values. ;; Alist of default option values.
`((profile . ,%current-profile))) `((profile . ,%current-profile)
(substitutes? . #t)))
(define (show-help) (define (show-help)
(display (_ "Usage: guix package [OPTION]... PACKAGES... (display (_ "Usage: guix package [OPTION]... PACKAGES...
...@@ -334,6 +335,8 @@ (define (show-help) ...@@ -334,6 +335,8 @@ (define (show-help)
-p, --profile=PROFILE use PROFILE instead of the user's default profile")) -p, --profile=PROFILE use PROFILE instead of the user's default profile"))
(display (_ " (display (_ "
-n, --dry-run show what would be done without actually doing it")) -n, --dry-run show what would be done without actually doing it"))
(display (_ "
--no-substitutes build instead of resorting to pre-built substitutes"))
(display (_ " (display (_ "
--bootstrap use the bootstrap Guile to build the profile")) --bootstrap use the bootstrap Guile to build the profile"))
(display (_ " (display (_ "
...@@ -388,6 +391,10 @@ (define %options ...@@ -388,6 +391,10 @@ (define %options
(option '(#\n "dry-run") #f #f (option '(#\n "dry-run") #f #f
(lambda (opt name arg result) (lambda (opt name arg result)
(alist-cons 'dry-run? #t result))) (alist-cons 'dry-run? #t result)))
(option '("no-substitutes") #f #f
(lambda (opt name arg result)
(alist-cons 'substitutes? #f
(alist-delete 'substitutes? result))))
(option '("bootstrap") #f #f (option '("bootstrap") #f #f
(lambda (opt name arg result) (lambda (opt name arg result)
(alist-cons 'bootstrap? #t result))) (alist-cons 'bootstrap? #t result)))
...@@ -750,6 +757,10 @@ (define (process-query opts) ...@@ -750,6 +757,10 @@ (define (process-query opts)
(or (process-query opts) (or (process-query opts)
(with-error-handling (with-error-handling
(parameterize ((%store (open-connection))) (parameterize ((%store (open-connection)))
(set-build-options (%store)
#:use-substitutes?
(assoc-ref opts 'substitutes?))
(parameterize ((%guile-for-build (parameterize ((%guile-for-build
(package-derivation (%store) (package-derivation (%store)
(if (assoc-ref opts 'bootstrap?) (if (assoc-ref opts 'bootstrap?)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment