summaryrefslogtreecommitdiff
path: root/guix/build
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2020-04-08 13:00:50 +0200
committerMarius Bakke <mbakke@fastmail.com>2020-04-08 13:00:50 +0200
commit27783023993f9272ce422868d14529159c4a5218 (patch)
tree9013b08aa39e497b1fd8e01a05254278d83f0ff7 /guix/build
parentbe1e842ad78ac6c52fc7790f4a3ffd716673c111 (diff)
parentba6f2bda18ed19fa486a9c3e2c3baea6c66c6867 (diff)
downloadpatches-27783023993f9272ce422868d14529159c4a5218.tar
patches-27783023993f9272ce422868d14529159c4a5218.tar.gz
Merge branch 'master' into core-updates
Conflicts: etc/news.scm gnu/local.mk gnu/packages/check.scm gnu/packages/cross-base.scm gnu/packages/gimp.scm gnu/packages/java.scm gnu/packages/mail.scm gnu/packages/sdl.scm gnu/packages/texinfo.scm gnu/packages/tls.scm gnu/packages/version-control.scm
Diffstat (limited to 'guix/build')
-rw-r--r--guix/build/bournish.scm24
-rw-r--r--guix/build/compile.scm51
2 files changed, 44 insertions, 31 deletions
diff --git a/guix/build/bournish.scm b/guix/build/bournish.scm
index 247a687d80..31fc493b09 100644
--- a/guix/build/bournish.scm
+++ b/guix/build/bournish.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2016, 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016, 2017, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
;;;
@@ -83,7 +83,21 @@ TERMINAL-WIDTH. Use COLUMN-GAP spaces between two subsequent columns."
(newline)
(loop (map 1+ indexes)))))
-(define ls-command-implementation
+(define-syntax define-command-runtime
+ (syntax-rules ()
+ "Define run-time support of a Bournish command. This macro ensures that
+the implementation is not subject to inlining, which would prevent compiled
+code from referring to it via '@@'."
+ ((_ (command . args) body ...)
+ (define-command-runtime command (lambda args body ...)))
+ ((_ command exp)
+ (begin
+ (define command exp)
+
+ ;; Prevent inlining of COMMAND.
+ (set! command command)))))
+
+(define-command-runtime ls-command-implementation
;; Run-time support procedure.
(case-lambda
(()
@@ -173,13 +187,13 @@ TERMINAL-WIDTH. Use COLUMN-GAP spaces between two subsequent columns."
(call-with-input-file file lines+chars)))
(format #t "~a ~a~%" chars file)))
-(define (wc-command-implementation . files)
+(define-command-runtime (wc-command-implementation . files)
(for-each wc-print (filter file-exists?* files)))
-(define (wc-l-command-implementation . files)
+(define-command-runtime (wc-l-command-implementation . files)
(for-each wc-l-print (filter file-exists?* files)))
-(define (wc-c-command-implementation . files)
+(define-command-runtime (wc-c-command-implementation . files)
(for-each wc-c-print (filter file-exists?* files)))
(define (wc-command . args)
diff --git a/guix/build/compile.scm b/guix/build/compile.scm
index 4b6472784c..3ce0ecede5 100644
--- a/guix/build/compile.scm
+++ b/guix/build/compile.scm
@@ -184,36 +184,35 @@ files are for HOST, a GNU triplet such as \"x86_64-linux-gnu\"."
;; Exit as soon as something goes wrong.
(exit-on-exception
file
- (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))))))))
+ (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-augmented-search-path %load-path source-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
- ;; 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-target host
+ (lambda ()
+ ;; 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))