Browse Source

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

Fixes <https://bugs.gnu.org/28956>.
Reported by Leo Famulari <leo@famulari.name>.

* 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'.
gn-latest-20200428
Ludovic Courtès 4 years ago
parent
commit
ce33c3af76
No known key found for this signature in database GPG Key ID: 90B11993D9AEBB5
2 changed files with 35 additions and 25 deletions
  1. +1
    -0
      build-aux/build-self.scm
  2. +34
    -25
      guix/build/pull.scm

+ 1
- 0
build-aux/build-self.scm View File

@ -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)


+ 34
- 25
guix/build/pull.scm View File

@ -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)


Loading…
Cancel
Save