[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/06: pull: Build package modules without optimizations on Guile 2.2.
From: |
Ludovic Courtès |
Subject: |
05/06: pull: Build package modules without optimizations on Guile 2.2. |
Date: |
Tue, 9 May 2017 12:08:50 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 07a0f68fa528a88825cf7d908f0def921a5779a1
Author: Ludovic Courtès <address@hidden>
Date: Tue May 9 17:34:54 2017 +0200
pull: Build package modules without optimizations on Guile 2.2.
* guix/build/pull.scm (%default-optimizations)
(%lightweight-optimizations): New variables.
(optimization-options): New procedure. Taken from
build-aux/compile-all.scm.
(build-guix): Pass it to 'compile-file'.
---
guix/build/pull.scm | 31 ++++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/guix/build/pull.scm b/guix/build/pull.scm
index 6825e74..d2e0404 100644
--- a/guix/build/pull.scm
+++ b/guix/build/pull.scm
@@ -57,6 +57,35 @@ indirectly, on Guile-SSH."
(string-prefix? gnu b))
(string<? a b))))))
+(cond-expand
+ (guile-2.2 (use-modules (language tree-il optimize)
+ (language cps optimize)))
+ (else #f))
+
+(define %default-optimizations
+ ;; Default optimization options (equivalent to -O2 on Guile 2.2).
+ (cond-expand
+ (guile-2.2 (append (tree-il-default-optimization-options)
+ (cps-default-optimization-options)))
+ (else '())))
+
+(define %lightweight-optimizations
+ ;; Lightweight optimizations (like -O0, but with partial evaluation).
+ (let loop ((opts %default-optimizations)
+ (result '()))
+ (match opts
+ (() (reverse result))
+ ((#:partial-eval? _ rest ...)
+ (loop rest `(#t #:partial-eval? ,@result)))
+ ((kw _ rest ...)
+ (loop rest `(#f ,kw ,@result))))))
+
+(define (optimization-options file)
+ (if (string-contains file "gnu/packages/")
+ %lightweight-optimizations ;build faster
+ '()))
+
+
(define* (build-guix out source
#:key
system
@@ -158,7 +187,7 @@ containing the source code. Write any debugging output to
DEBUG-PORT."
(parameterize ((current-warning-port (%make-void-port "w")))
(compile-file file
#:output-file go
- #:opts %auto-compilation-options)))
+ #:opts (optimization-options file))))
(with-mutex mutex
(set! completed (+ 1 completed))))
files))))
- branch master updated (f0b7dc7 -> 7561881), Ludovic Courtès, 2017/05/09
- 02/06: pull: Use 'with-store'., Ludovic Courtès, 2017/05/09
- 06/06: gnu: guix: Build with Guile 2.2., Ludovic Courtès, 2017/05/09
- 03/06: gnu: guile-ssh: Update to 0.11.0., Ludovic Courtès, 2017/05/09
- 05/06: pull: Build package modules without optimizations on Guile 2.2.,
Ludovic Courtès <=
- 01/06: pull: Honor the standard build options., Ludovic Courtès, 2017/05/09
- 04/06: pull: Build with the matching Guile major version., Ludovic Courtès, 2017/05/09