compile: Let compiler warnings through during the load phase.

Previous warnings and errors such as those raised by (guix records)
would not be displayed during the load phase.

* guix/build/compile.scm (load-files): Remove 'parameterize' around
'resolve-interface' call.
(compile-files)[build]: Move 'with-fluids' for *CURRENT-WARNING-PREFIX*
to...
<top level>: ... here.
This commit is contained in:
Ludovic Courtès 2019-01-22 12:01:49 +01:00
parent 2d04076332
commit c498aaaf11
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 25 additions and 25 deletions

View File

@ -97,8 +97,7 @@
(report-load file total completed) (report-load file total completed)
(format debug-port "~%loading '~a'...~%" file) (format debug-port "~%loading '~a'...~%" file)
(parameterize ((current-warning-port debug-port)) (resolve-interface (file-name->module-name file))
(resolve-interface (file-name->module-name file)))
(loop files (+ 1 completed))))))) (loop files (+ 1 completed)))))))
@ -158,7 +157,6 @@ files are for HOST, a GNU triplet such as \"x86_64-linux-gnu\"."
;; Exit as soon as something goes wrong. ;; Exit as soon as something goes wrong.
(exit-on-exception (exit-on-exception
(with-fluids ((*current-warning-prefix* ""))
(with-target host (with-target host
(lambda () (lambda ()
(let ((relative (relative-file source-directory file))) (let ((relative (relative-file source-directory file)))
@ -166,12 +164,14 @@ files are for HOST, a GNU triplet such as \"x86_64-linux-gnu\"."
#:output-file (string-append build-directory "/" #:output-file (string-append build-directory "/"
(scm->go relative)) (scm->go relative))
#:opts (append warning-options #:opts (append warning-options
(optimization-options relative)))))))) (optimization-options relative)))))))
(with-mutex progress-lock (with-mutex progress-lock
(set! completed (+ 1 completed)))) (set! completed (+ 1 completed))))
(with-augmented-search-path %load-path source-directory (with-augmented-search-path %load-path source-directory
(with-augmented-search-path %load-compiled-path build-directory (with-augmented-search-path %load-compiled-path build-directory
(with-fluids ((*current-warning-prefix* ""))
;; FIXME: To work around <https://bugs.gnu.org/15602>, we first load all ;; FIXME: To work around <https://bugs.gnu.org/15602>, we first load all
;; of FILES. ;; of FILES.
(load-files source-directory files (load-files source-directory files
@ -188,7 +188,7 @@ files are for HOST, a GNU triplet such as \"x86_64-linux-gnu\"."
(n-par-for-each (min workers 8) build files) (n-par-for-each (min workers 8) build files)
(unless (zero? total) (unless (zero? total)
(report-compilation #f total total))))) (report-compilation #f total total))))))
(eval-when (eval load) (eval-when (eval load)
(when (and (string=? "2" (major-version)) (when (and (string=? "2" (major-version))