guix-commits
[Top][All Lists]
Advanced

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

01/02: pull: Add (guix build compile) to the mix.


From: Ludovic Courtès
Subject: 01/02: pull: Add (guix build compile) to the mix.
Date: Mon, 23 Oct 2017 20:09:38 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit ce33c3af76b0e5c68cc42dddf2b9c4b017386fd8
Author: Ludovic Courtès <address@hidden>
Date:   Mon Oct 23 16:33:50 2017 -0700

    pull: Add (guix build compile) to the mix.
    
    Fixes <https://bugs.gnu.org/28956>.
    Reported by Leo Famulari <address@hidden>.
    
    * build-aux/build-self.scm (build): Add (guix build compile) to
     #:modules.
    * guix/build/pull.scm (build-guix): Wrap 'compile-files' call in
    'with-directory-excursion'.  Strip "./" from FILES when passing it to
    'compile-files'.
---
 build-aux/build-self.scm |  1 +
 guix/build/pull.scm      | 59 ++++++++++++++++++++++++++++--------------------
 2 files changed, 35 insertions(+), 25 deletions(-)

diff --git a/build-aux/build-self.scm b/build-aux/build-self.scm
index 4933e02..ed8ff5f 100644
--- a/build-aux/build-self.scm
+++ b/build-aux/build-self.scm
@@ -245,6 +245,7 @@ Please upgrade to an intermediate version first, for 
instance with:
     (gexp->derivation "guix-latest" builder
                       #:modules '((guix build pull)
                                   (guix build utils)
+                                  (guix build compile)
 
                                   ;; Closure of (guix modules).
                                   (guix modules)
diff --git a/guix/build/pull.scm b/guix/build/pull.scm
index 6f7aa27..588b5fe 100644
--- a/guix/build/pull.scm
+++ b/guix/build/pull.scm
@@ -121,31 +121,40 @@ containing the source code.  Write any debugging output 
to DEBUG-PORT."
 
     ;; Compile the .scm files.  Filter out files depending on Guile-SSH when
     ;; Guile-SSH is missing.
-    (let ((files (filter has-all-its-dependencies?
-                         (all-scheme-files out))))
-      (compile-files out out files
-
-                     #:workers (parallel-job-count)
-
-                     ;; Disable warnings.
-                     #:warning-options '()
-
-                     #:report-load
-                     (lambda (file total completed)
-                       (display #\cr log-port)
-                       (format log-port
-                               "loading...\t~5,1f% of ~d files" ;FIXME: i18n
-                               (* 100. (/ completed total)) total)
-                       (force-output log-port)
-                       (format debug-port "~%loading '~a'...~%" file))
-
-                     #:report-compilation
-                     (lambda (file total completed)
-                       (display #\cr log-port)
-                       (format log-port "compiling...\t~5,1f% of ~d files" 
;FIXME: i18n
-                               (* 100. (/ completed total)) total)
-                       (force-output log-port)
-                       (format debug-port "~%compiling '~a'...~%" file)))))
+    (with-directory-excursion out
+      (let ((files (filter has-all-its-dependencies?
+                           (all-scheme-files "."))))
+        (compile-files out out
+
+                       ;; XXX: 'compile-files' except ready-to-use relative
+                       ;; file names.
+                       (map (lambda (file)
+                              (if (string-prefix? "./" file)
+                                  (string-drop file 2)
+                                  file))
+                            files)
+
+                       #:workers (parallel-job-count)
+
+                       ;; Disable warnings.
+                       #:warning-options '()
+
+                       #:report-load
+                       (lambda (file total completed)
+                         (display #\cr log-port)
+                         (format log-port
+                                 "loading...\t~5,1f% of ~d files" ;FIXME: i18n
+                                 (* 100. (/ completed total)) total)
+                         (force-output log-port)
+                         (format debug-port "~%loading '~a'...~%" file))
+
+                       #:report-compilation
+                       (lambda (file total completed)
+                         (display #\cr log-port)
+                         (format log-port "compiling...\t~5,1f% of ~d files" 
;FIXME: i18n
+                                 (* 100. (/ completed total)) total)
+                         (force-output log-port)
+                         (format debug-port "~%compiling '~a'...~%" file))))))
 
   (newline)
   #t)



reply via email to

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