guix-patches
[Top][All Lists]
Advanced

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

[bug#29745] [PATCH 1/3] build: gnu-build-system: Disallow phase returnin


From: Arun Isaac
Subject: [bug#29745] [PATCH 1/3] build: gnu-build-system: Disallow phase returning <unspecified>.
Date: Sun, 17 Dec 2017 04:46:15 +0530

* guix/build/gnu-build-system.scm (gnu-build): Treat a phase returning
<unspecified> as a failure.
---
 guix/build/gnu-build-system.scm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm
index e37b75140..e1653a395 100644
--- a/guix/build/gnu-build-system.scm
+++ b/guix/build/gnu-build-system.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès 
<address@hidden>
+;;; Copyright © 2017 Arun Isaac <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -669,6 +670,9 @@ in order.  Return #t if all the PHASES succeeded, #f 
otherwise."
       (+ (time-second diff)
          (/ (time-nanosecond diff) 1e9))))
 
+  (define (true? object)
+    (if (unspecified? object) #f object))
+
   (setvbuf (current-output-port) _IOLBF)
   (setvbuf (current-error-port) _IOLBF)
 
@@ -681,7 +685,7 @@ in order.  Return #t if all the PHASES succeeded, #f 
otherwise."
           ((name . proc)
            (let ((start (current-time time-monotonic)))
              (format #t "starting phase `~a'~%" name)
-             (let ((result (apply proc args))
+             (let ((result (true? (apply proc args)))
                    (end    (current-time time-monotonic)))
                (format #t "phase `~a' ~:[failed~;succeeded~] after ~,1f 
seconds~%"
                        name result
-- 
2.15.1






reply via email to

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