From b50c5b741891eabb16b83091d911c6ebd9b890d3 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 5 Sep 2014 23:11:04 +0200 Subject: pull: Add a compilation progress report. * guix/build/pull.scm (report-build-progress): New procedure. (p-for-each): Add #:progress parameter. [loop]: Keep track of the number of completed processes. Tail-call PROGRESS at each loop iteration. (build-guix): Add #:debug-port parameter. Use it for verbose messages. Change 'tar' flags to 'xf'. Around 'compile-file' call, bind CURRENT-WARNING-PORT to DEBUG-PORT. * guix/scripts/pull.scm (unpack): Add #:verbose? parameter. [builder]: Pass #:debug-port to 'build-guix'. (guix-pull): Leave CURRENT-BUILD-OUTPUT-PORT unchanged. Pass #:verbose? to 'unpack'. --- guix/scripts/pull.scm | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'guix/scripts/pull.scm') diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm index c2bf536e86..5dafb84f91 100644 --- a/guix/scripts/pull.scm +++ b/guix/scripts/pull.scm @@ -38,15 +38,21 @@ "http://git.savannah.gnu.org/cgit/guix.git/snapshot/guix-master.tar.gz" ) -(define (unpack store tarball) +(define* (unpack store tarball #:key verbose?) "Return a derivation that unpacks TARBALL into STORE and compiles Scheme files." (define builder - '(begin + `(begin (use-modules (guix build pull)) (build-guix (assoc-ref %outputs "out") (assoc-ref %build-inputs "tarball") + + ;; XXX: This is not perfect, enabling VERBOSE? means + ;; building a different derivation. + #:debug-port (if ',verbose? + (current-error-port) + (%make-void-port "w")) #:tar (assoc-ref %build-inputs "tar") #:gzip (assoc-ref %build-inputs "gzip") #:gcrypt (assoc-ref %build-inputs "gcrypt")))) @@ -129,13 +135,10 @@ Download and deploy the latest version of Guix.\n")) (package-derivation store (if (assoc-ref opts 'bootstrap?) %bootstrap-guile - (canonical-package guile-2.0)))) - (current-build-output-port - (if (assoc-ref opts 'verbose?) - (current-error-port) - (%make-void-port "w")))) + (canonical-package guile-2.0))))) (let* ((config-dir (config-directory)) - (source (unpack store tarball)) + (source (unpack store tarball + #:verbose? (assoc-ref opts 'verbose?))) (source-dir (derivation->output-path source))) (if (show-what-to-build store (list source)) (if (build-derivations store (list source)) -- cgit v1.2.3