guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/04: guix build: Warn when '--keep-failed' is passed to a remote daemo


From: guix-commits
Subject: 01/04: guix build: Warn when '--keep-failed' is passed to a remote daemon.
Date: Fri, 25 Oct 2019 06:34:58 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit b3673e9917217fc27c743092e58e4eb33d0fdd16
Author: Ludovic Courtès <address@hidden>
Date:   Thu Oct 24 18:15:15 2019 +0200

    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.
---
 guix/scripts/build.scm | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index 3ee0b73..ee1a9a8 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -523,6 +523,20 @@ options handled by 'set-build-options-from-command-line', 
and listed in
   "Given OPTS, an alist as returned by 'args-fold' given
 '%standard-build-options', set the corresponding build options on STORE."
   ;; 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
                      #:keep-failed? (assoc-ref opts 'keep-failed?)
                      #:keep-going? (assoc-ref opts 'keep-going?)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]