guix-commits
[Top][All Lists]
Advanced

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

01/01: build-system/gnu: If a phase returns #f, the build fails.


From: Mark H. Weaver
Subject: 01/01: build-system/gnu: If a phase returns #f, the build fails.
Date: Fri, 3 Aug 2018 23:20:38 -0400 (EDT)

mhw pushed a commit to branch core-updates
in repository guix.

commit 82230603ce06de7aa3e4aef2fa093a6dbf0ef8df
Author: Mark H Weaver <address@hidden>
Date:   Fri Aug 3 23:12:33 2018 -0400

    build-system/gnu: If a phase returns #f, the build fails.
    
    Fixes <https://bugs.gnu.org/31974>.
    Introduced by commit d8a3b1b9e847d4a44d2695f95af77170d4d2788f.
    
    * guix/build/gnu-build-system.scm (gnu-build): Use 'every' instead
    of 'for-each'.
---
 guix/build/gnu-build-system.scm | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm
index be5ad78..e5f3197 100644
--- a/guix/build/gnu-build-system.scm
+++ b/guix/build/gnu-build-system.scm
@@ -792,26 +792,26 @@ in order.  Return #t if all the PHASES succeeded, #f 
otherwise."
 
   ;; The trick is to #:allow-other-keys everywhere, so that each procedure in
   ;; PHASES can pick the keyword arguments it's interested in.
-  (for-each (match-lambda
-              ((name . proc)
-               (let ((start (current-time time-monotonic)))
-                 (format #t "starting phase `~a'~%" name)
-                 (let ((result (apply proc args))
-                       (end    (current-time time-monotonic)))
-                   (format #t "phase `~a' ~:[failed~;succeeded~] after ~,1f 
seconds~%"
-                           name result
-                           (elapsed-time end start))
-
-                   ;; Issue a warning unless the result is #t.
-                   (unless (eqv? result #t)
-                     (format (current-error-port) "\
+  (every (match-lambda
+           ((name . proc)
+            (let ((start (current-time time-monotonic)))
+              (format #t "starting phase `~a'~%" name)
+              (let ((result (apply proc args))
+                    (end    (current-time time-monotonic)))
+                (format #t "phase `~a' ~:[failed~;succeeded~] after ~,1f 
seconds~%"
+                        name result
+                        (elapsed-time end start))
+
+                ;; Issue a warning unless the result is #t.
+                (unless (eqv? result #t)
+                  (format (current-error-port) "\
 ## WARNING: phase `~a' returned `~s'.  Return values other than #t
 ## are deprecated.  Please migrate this package so that its phase
 ## procedures report errors by raising an exception, and otherwise
 ## always return #t.~%"
-                             name result))
+                          name result))
 
-                   ;; Dump the environment variables as a shell script, for 
handy debugging.
-                   (system "export > $NIX_BUILD_TOP/environment-variables")
-                   result))))
-            phases))
+                ;; Dump the environment variables as a shell script, for handy 
debugging.
+                (system "export > $NIX_BUILD_TOP/environment-variables")
+                result))))
+         phases))



reply via email to

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