Use 'offload?' instead of 'build-hook?' internally.

* guix/scripts/archive.scm (%default-options): Replace 'build-hook?'
with 'offload?'.
* guix/scripts/build.scm (set-build-options-from-command-line): Pass
 #:offload? instead of #:use-build-hook?.
(%standard-build-options): Use the 'offload? key instead of 'build-hook?.
(%default-options): Replace 'build-hook?' with 'offload?'.
* guix/scripts/copy.scm (%default-options): Likewise.
* guix/scripts/deploy.scm (%default-options): Likewise.
* guix/scripts/environment.scm (%default-options): Likewise.
* guix/scripts/pack.scm (%default-options): Likewise.
* guix/scripts/package.scm (%default-options): Likewise.
* guix/scripts/pull.scm (%default-options): Likewise.
* guix/scripts/system.scm (%default-options): Likewise.
* guix/scripts/time-machine.scm (%default-options): Likewise.
* guix/store.scm (set-build-options): Have #:use-build-hook? default
to *unspecified*.  Add #:offload?.  Add call to 'warn-about-deprecation'
when #:use-build-hook? is specified.
This commit is contained in:
Ludovic Courtès 2019-11-21 15:28:13 +01:00
parent dc209d5a5d
commit 7f44ab48f9
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
11 changed files with 22 additions and 15 deletions

View file

@ -55,7 +55,7 @@ (define %default-options
;; Alist of default option values.
`((system . ,(%current-system))
(substitutes? . #t)
(build-hook? . #t)
(offload? . #t)
(graft? . #t)
(print-build-trace? . #t)
(print-extended-build-trace? . #t)

View file

@ -545,7 +545,7 @@ (define (set-build-options-from-command-line store opts)
#:fallback? (assoc-ref opts 'fallback?)
#:use-substitutes? (assoc-ref opts 'substitutes?)
#:substitute-urls (assoc-ref opts 'substitute-urls)
#:use-build-hook? (assoc-ref opts 'build-hook?)
#:offload? (assoc-ref opts 'offload?)
#:max-silent-time (assoc-ref opts 'max-silent-time)
#:timeout (assoc-ref opts 'timeout)
#:print-build-trace (assoc-ref opts 'print-build-trace?)
@ -617,8 +617,8 @@ (define %standard-build-options
use '--no-offload' instead~%")))
(apply values
(alist-cons 'build-hook? #f
(alist-delete 'build-hook? result))
(alist-cons 'offload? #f
(alist-delete 'offload? result))
rest)))
(option '("max-silent-time") #t #f
(lambda (opt name arg result . rest)
@ -663,7 +663,7 @@ (define %default-options
`((build-mode . ,(build-mode normal))
(graft? . #t)
(substitutes? . #t)
(build-hook? . #t)
(offload? . #t)
(print-build-trace? . #t)
(print-extended-build-trace? . #t)
(multiplexed-build-output? . #t)

View file

@ -158,7 +158,7 @@ (define %options
(define %default-options
`((system . ,(%current-system))
(substitutes? . #t)
(build-hook? . #t)
(offload? . #t)
(graft? . #t)
(print-build-trace? . #t)
(print-extended-build-trace? . #t)

View file

@ -84,7 +84,7 @@ (define %default-options
(debug . 0)
(graft? . #t)
(substitutes? . #t)
(build-hook? . #t)
(offload? . #t)
(print-build-trace? . #t)
(print-extended-build-trace? . #t)
(multiplexed-build-output? . #t)))

View file

@ -191,7 +191,7 @@ (define (show-help)
(define %default-options
`((system . ,(%current-system))
(substitutes? . #t)
(build-hook? . #t)
(offload? . #t)
(graft? . #t)
(print-build-trace? . #t)
(print-extended-build-trace? . #t)

View file

@ -759,7 +759,7 @@ (define %default-options
(profile-name . "guix-profile")
(system . ,(%current-system))
(substitutes? . #t)
(build-hook? . #t)
(offload? . #t)
(graft? . #t)
(print-build-trace? . #t)
(print-extended-build-trace? . #t)

View file

@ -318,7 +318,7 @@ (define %default-options
(debug . 0)
(graft? . #t)
(substitutes? . #t)
(build-hook? . #t)
(offload? . #t)
(print-build-trace? . #t)
(print-extended-build-trace? . #t)
(multiplexed-build-output? . #t)))

View file

@ -71,7 +71,7 @@ (define %default-options
;; Alist of default option values.
`((system . ,(%current-system))
(substitutes? . #t)
(build-hook? . #t)
(offload? . #t)
(print-build-trace? . #t)
(print-extended-build-trace? . #t)
(multiplexed-build-output? . #t)

View file

@ -1013,7 +1013,7 @@ (define %default-options
;; Alist of default option values.
`((system . ,(%current-system))
(substitutes? . #t)
(build-hook? . #t)
(offload? . #t)
(print-build-trace? . #t)
(print-extended-build-trace? . #t)
(multiplexed-build-output? . #t)

View file

@ -94,7 +94,7 @@ (define %default-options
;; Alist of default option values.
`((system . ,(%current-system))
(substitutes? . #t)
(build-hook? . #t)
(offload? . #t)
(print-build-trace? . #t)
(print-extended-build-trace? . #t)
(multiplexed-build-output? . #t)

View file

@ -763,7 +763,8 @@ (define* (set-build-options server
max-build-jobs
timeout
max-silent-time
(use-build-hook? #t)
(offload? #t)
(use-build-hook? *unspecified*) ;deprecated
(build-verbosity 0)
(log-type 0)
(print-build-trace #t)
@ -803,6 +804,10 @@ (define* (set-build-options server
(define socket
(store-connection-socket server))
(unless (unspecified? use-build-hook?)
(warn-about-deprecation #:use-build-hook? #f
#:replacement #:offload?))
(let-syntax ((send (syntax-rules ()
((_ (type option) ...)
(begin
@ -816,7 +821,9 @@ (define socket
(max-silent-time (or max-silent-time 3600)))
(send (integer max-build-jobs) (integer max-silent-time))))
(when (>= (store-connection-minor-version server) 2)
(send (boolean use-build-hook?)))
(send (boolean (if (unspecified? use-build-hook?)
offload?
use-build-hook?))))
(when (>= (store-connection-minor-version server) 4)
(send (integer build-verbosity) (integer log-type)
(boolean print-build-trace)))