diff options
author | Ludovic Courtès <ludo@gnu.org> | 2012-12-20 22:31:08 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2012-12-20 22:31:08 +0100 |
commit | 4c377e861b11ed5c5689fdb3ba2d1d864c77cef4 (patch) | |
tree | 8d0150e34b5d77254d2f599bae0ba3f4b1f63d1d /guix | |
parent | f5b7894942e91ae1cf01138f1ae81c140c9fab35 (diff) |
build-system/gnu: Report the execution time of each phase.
* guix/build/gnu-build-system.scm (gnu-build): Report the success or
failure of each phase and its execution time.
Diffstat (limited to 'guix')
-rw-r--r-- | guix/build/gnu-build-system.scm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index 5e899403e8..8692359bd8 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -20,6 +20,7 @@ #:use-module (guix build utils) #:use-module (ice-9 ftw) #:use-module (ice-9 match) + #:use-module (ice-9 format) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:export (%standard-phases @@ -267,6 +268,11 @@ in order. Return #t if all the PHASES succeeded, #f otherwise." ;; PHASES can pick the keyword arguments it's interested in. (every (match-lambda ((name . proc) - (format #t "starting phase `~a'~%" name) - (apply proc args))) + (let ((start (gettimeofday))) + (format #t "starting phase `~a'~%" name) + (let ((result (apply proc args)) + (end (gettimeofday))) + (format #t "phase `~a' ~:[failed~;succeeded~] after ~a seconds~%" + name result (- (car end) (car start))) + result)))) phases)) |