From e9349809a6bc129a875ff968f96fb87c5c3d84e6 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 17 May 2021 15:25:31 -0700 Subject: output the compile and/or load output when debug level at least 3 Signed-off-by: Sean Whitton --- src/data.lisp | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) (limited to 'src/data.lisp') diff --git a/src/data.lisp b/src/data.lisp index 92f62df..53ca514 100644 --- a/src/data.lisp +++ b/src/data.lisp @@ -590,7 +590,7 @@ achieved by sending the return value of this function into a REPL's stdin.") (error "Attempt to send unpreprocessed host to remote Lisp. Preprocessing must occur in the root Lisp.")) - (flet ((wrap (forms) + (flet ((wrap (form) ;; We used to bind a handler here to invoke SKIP-DATA-SOURCES ;; upon MISSING-DATA-SOURCE, which means that remote Lisp images ;; were allowed to try querying data sources. Now we just bind @@ -605,7 +605,7 @@ Preprocessing must occur in the root Lisp.")) ;; root Lisp. `(let ((*no-data-sources* t) (*consfigurator-debug-level* ,*consfigurator-debug-level*)) - ,@forms))) + ,form))) (let* ((intern-forms (loop for (export . name) in '((nil . "*NO-DATA-SOURCES*") @@ -623,22 +623,26 @@ Preprocessing must occur in the root Lisp.")) ;; (define-condition missing-data-source (error) ()) (require "asdf") ;; Hide the compile and/or load output unless there are - ;; failures, as it's verbose and rarely of interest. - (let ((string (make-array '(0) - :element-type 'character - :fill-pointer 0 :adjustable t))) - (handler-case - (with-output-to-string (stream string) - (let ((*error-output* stream) - (*standard-output* stream)) - ,(wrap (asdf-requirements-load-forms asdf-requirements)))) - (serious-condition (c) - (format - *error-output* - "~&Failed to compile and/or load:~%~A~&~%Compile and/or load output:~%~%~A" - c string) - (uiop:quit 2)))) - ,(wrap `((%consfigure ',remaining-connections ,*host*)))))) + ;; failures or the debug level is at least 3, as it's verbose + ;; and not usually of interest. + ,(wrap + `(let ((string + (make-array '(0) :element-type 'character + :fill-pointer 0 :adjustable t))) + (handler-case + (with-output-to-string (stream string) + (let ((*error-output* stream) + (*standard-output* stream)) + ,@(asdf-requirements-load-forms asdf-requirements))) + (serious-condition (c) + (format + *error-output* + "~&Failed to compile and/or load:~%~A~&~%Compile and/or load output:~%~%~A" + c string) + (uiop:quit 2))) + (when (>= *consfigurator-debug-level* 3) + (format t "~&~A" string)))) + ,(wrap `(%consfigure ',remaining-connections ,*host*))))) (handler-case (with-standard-io-syntax (let ((*allow-printing-passphrases* t)) -- cgit v1.2.3