From 4c377e861b11ed5c5689fdb3ba2d1d864c77cef4 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 20 Dec 2012 22:31:08 +0100 Subject: 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. --- guix/build/gnu-build-system.scm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'guix') 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)) -- cgit v1.2.3