mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-26 06:18:07 -05:00
guix build: Warn when '--keep-failed' is passed to a remote daemon.
* guix/scripts/build.scm (set-build-options-from-command-line): When OPTS has 'keep-failed?' set, check whether STORE is connected over AF_UNIX and warn when it's not.
This commit is contained in:
parent
258e63bfb4
commit
b3673e9917
1 changed files with 14 additions and 0 deletions
|
@ -523,6 +523,20 @@ (define (set-build-options-from-command-line store opts)
|
||||||
"Given OPTS, an alist as returned by 'args-fold' given
|
"Given OPTS, an alist as returned by 'args-fold' given
|
||||||
'%standard-build-options', set the corresponding build options on STORE."
|
'%standard-build-options', set the corresponding build options on STORE."
|
||||||
;; TODO: Add more options.
|
;; TODO: Add more options.
|
||||||
|
|
||||||
|
;; '--keep-failed' has no effect when talking to a remote daemon. Catch the
|
||||||
|
;; case where GUIX_DAEMON_SOCKET=guix://….
|
||||||
|
(when (and (assoc-ref opts 'keep-failed?)
|
||||||
|
(let* ((socket (store-connection-socket store))
|
||||||
|
(peer (catch 'system-error
|
||||||
|
(lambda ()
|
||||||
|
(and (file-port? socket)
|
||||||
|
(getpeername socket)))
|
||||||
|
(const #f))))
|
||||||
|
(and peer (not (= AF_UNIX (sockaddr:fam peer))))))
|
||||||
|
(warning (G_ "'--keep-failed' ignored since you are \
|
||||||
|
talking to a remote daemon\n")))
|
||||||
|
|
||||||
(set-build-options store
|
(set-build-options store
|
||||||
#:keep-failed? (assoc-ref opts 'keep-failed?)
|
#:keep-failed? (assoc-ref opts 'keep-failed?)
|
||||||
#:keep-going? (assoc-ref opts 'keep-going?)
|
#:keep-going? (assoc-ref opts 'keep-going?)
|
||||||
|
|
Loading…
Reference in a new issue