guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

04/11: compile: Let compiler warnings through during the load phase.


From: guix-commits
Subject: 04/11: compile: Let compiler warnings through during the load phase.
Date: Tue, 22 Jan 2019 17:05:10 -0500 (EST)

civodul pushed a commit to branch master
in repository guix.

commit c498aaaf110cd7f6950ea47e637725e0513655d4
Author: Ludovic Court├Ęs <address@hidden>
Date:   Tue Jan 22 12:01:49 2019 +0100

    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.
---
 guix/build/compile.scm | 56 +++++++++++++++++++++++++-------------------------
 1 file changed, 28 insertions(+), 28 deletions(-)

diff --git a/guix/build/compile.scm b/guix/build/compile.scm
index 215489f..9e31be9 100644
--- a/guix/build/compile.scm
+++ b/guix/build/compile.scm
@@ -97,8 +97,7 @@
          (report-load file total completed)
          (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)))))))
 
@@ -158,37 +157,38 @@ files are for HOST, a GNU triplet such as 
\"x86_64-linux-gnu\"."
 
     ;; Exit as soon as something goes wrong.
     (exit-on-exception
-     (with-fluids ((*current-warning-prefix* ""))
-       (with-target host
-         (lambda ()
-           (let ((relative (relative-file source-directory file)))
-             (compile-file file
-                           #:output-file (string-append build-directory "/"
-                                                        (scm->go relative))
-                           #:opts (append warning-options
-                                          (optimization-options 
relative))))))))
+     (with-target host
+       (lambda ()
+         (let ((relative (relative-file source-directory file)))
+           (compile-file file
+                         #:output-file (string-append build-directory "/"
+                                                      (scm->go relative))
+                         #:opts (append warning-options
+                                        (optimization-options relative)))))))
     (with-mutex progress-lock
       (set! completed (+ 1 completed))))
 
   (with-augmented-search-path %load-path source-directory
     (with-augmented-search-path %load-compiled-path build-directory
-      ;; FIXME: To work around <https://bugs.gnu.org/15602>, we first load all
-      ;; of FILES.
-      (load-files source-directory files
-                  #:report-load report-load
-                  #:debug-port debug-port)
-
-      ;; Make sure compilation related modules are loaded before starting to
-      ;; compile files in parallel.
-      (compile #f)
-
-      ;; XXX: Don't use too many workers to work around the insane memory
-      ;; requirements of the compiler in Guile 2.2.2:
-      ;; 
<https://lists.gnu.org/archive/html/guile-devel/2017-05/msg00033.html>.
-      (n-par-for-each (min workers 8) build files)
-
-      (unless (zero? total)
-        (report-compilation #f total total)))))
+      (with-fluids ((*current-warning-prefix* ""))
+
+        ;; FIXME: To work around <https://bugs.gnu.org/15602>, we first load 
all
+        ;; of FILES.
+        (load-files source-directory files
+                    #:report-load report-load
+                    #:debug-port debug-port)
+
+        ;; Make sure compilation related modules are loaded before starting to
+        ;; compile files in parallel.
+        (compile #f)
+
+        ;; XXX: Don't use too many workers to work around the insane memory
+        ;; requirements of the compiler in Guile 2.2.2:
+        ;; 
<https://lists.gnu.org/archive/html/guile-devel/2017-05/msg00033.html>.
+        (n-par-for-each (min workers 8) build files)
+
+        (unless (zero? total)
+          (report-compilation #f total total))))))
 
 (eval-when (eval load)
   (when (and (string=? "2" (major-version))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]