summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--guix/scripts/build.scm14
1 files changed, 14 insertions, 0 deletions
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index 3ee0b737fe..ee1a9a81c1 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?)