From 15cc7e6adfa503a1cf168d19a952fae02f91ab2d Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 4 Sep 2018 17:32:27 +0200 Subject: ui: Add soft port for styling and filtering build output. * guix/ui.scm (build-output-port): New procedure. * guix/scripts/package.scm (%default-options): Print build trace. (guix-package): Use build-output-port. * guix/scripts/build.scm (guix-build): Use build-output-port. Co-authored-by: Sahithi Yarlagadda --- guix/scripts/build.scm | 2 +- guix/scripts/package.scm | 39 +++++++++++++++++++++++---------------- 2 files changed, 24 insertions(+), 17 deletions(-) (limited to 'guix/scripts') diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index 4dd4fbccdf..3fa3c2c20f 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -735,7 +735,7 @@ needed." (parameterize ((current-build-output-port (if quiet? (%make-void-port "w") - (current-error-port)))) + (build-output-port #:verbose? #t)))) (let* ((mode (assoc-ref opts 'build-mode)) (drv (options->derivations store opts)) (urls (map (cut string-append <> "/log") diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 97bcc699d9..73cbccba3b 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -329,7 +329,8 @@ ENTRIES, a list of manifest entries, in the context of PROFILE." `((verbosity . 0) (graft? . #t) (substitutes? . #t) - (build-hook? . #t))) + (build-hook? . #t) + (print-build-trace? . #t))) (define (show-help) (display (G_ "Usage: guix package [OPTION]... @@ -930,18 +931,24 @@ processed, #f otherwise." (arg-handler arg result) (leave (G_ "~A: extraneous argument~%") arg))) - (let ((opts (parse-command-line args %options (list %default-options #f) - #:argument-handler handle-argument))) - (with-error-handling - (or (process-query opts) - (parameterize ((%store (open-connection)) - (%graft? (assoc-ref opts 'graft?))) - (set-build-options-from-command-line (%store) opts) - - (parameterize ((%guile-for-build - (package-derivation - (%store) - (if (assoc-ref opts 'bootstrap?) - %bootstrap-guile - (canonical-package guile-2.2))))) - (process-actions (%store) opts))))))) + (define opts + (parse-command-line args %options (list %default-options #f) + #:argument-handler handle-argument)) + (define verbose? + (assoc-ref opts 'verbose?)) + + (with-error-handling + (or (process-query opts) + (parameterize ((%store (open-connection)) + (%graft? (assoc-ref opts 'graft?))) + (set-build-options-from-command-line (%store) opts) + + (parameterize ((%guile-for-build + (package-derivation + (%store) + (if (assoc-ref opts 'bootstrap?) + %bootstrap-guile + (canonical-package guile-2.2)))) + (current-build-output-port + (build-output-port #:verbose? verbose?))) + (process-actions (%store) opts)))))) -- cgit v1.2.3