gnu-build: Issue a warning unless every phase returns #t.
* guix/build/gnu-build-system.scm (gnu-build): Issue a warning if a phase returns a value other than #t.
This commit is contained in:
parent
daac9c77b9
commit
d8a3b1b9e8
|
@ -746,7 +746,7 @@ in order. Return #t if all the PHASES succeeded, #f otherwise."
|
||||||
|
|
||||||
;; The trick is to #:allow-other-keys everywhere, so that each procedure in
|
;; The trick is to #:allow-other-keys everywhere, so that each procedure in
|
||||||
;; PHASES can pick the keyword arguments it's interested in.
|
;; PHASES can pick the keyword arguments it's interested in.
|
||||||
(every (match-lambda
|
(for-each (match-lambda
|
||||||
((name . proc)
|
((name . proc)
|
||||||
(let ((start (current-time time-monotonic)))
|
(let ((start (current-time time-monotonic)))
|
||||||
(format #t "starting phase `~a'~%" name)
|
(format #t "starting phase `~a'~%" name)
|
||||||
|
@ -756,6 +756,15 @@ in order. Return #t if all the PHASES succeeded, #f otherwise."
|
||||||
name result
|
name result
|
||||||
(elapsed-time end start))
|
(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))
|
||||||
|
|
||||||
;; Dump the environment variables as a shell script, for handy debugging.
|
;; Dump the environment variables as a shell script, for handy debugging.
|
||||||
(system "export > $NIX_BUILD_TOP/environment-variables")
|
(system "export > $NIX_BUILD_TOP/environment-variables")
|
||||||
result))))
|
result))))
|
||||||
|
|
Loading…
Reference in New Issue