[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
07/09: channels: Build user channels with '-O1'.
From: |
guix-commits |
Subject: |
07/09: channels: Build user channels with '-O1'. |
Date: |
Mon, 12 Apr 2021 12:44:53 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit a514b4ab19a628cbfa8b6d7c316ed7242018fcbf
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Apr 12 18:33:17 2021 +0200
channels: Build user channels with '-O1'.
This should noticeably speed up compilation for channels with many files.
* guix/channels.scm (standard-module-derivation)[build]: Define
'optimizations-for-level' and '-O1'. Pass #:optimization-options to
'compile-files'.
---
guix/channels.scm | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/guix/channels.scm b/guix/channels.scm
index b812c1b..c40fc0c 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -597,9 +597,24 @@ to '%package-module-path'."
(string-append #$output "/share/guile/site/"
(effective-version)))
+ (define optimizations-for-level
+ ;; Guile 3.0 provides this procedure but Guile 2.2 didn't.
+ ;; Since this code may be executed by either version, we can't
+ ;; rely on its availability.
+ (or (and=> (false-if-exception
+ (resolve-interface '(system base optimize)))
+ (lambda (iface)
+ (module-ref iface 'optimizations-for-level)))
+ (const '())))
+
+ (define -O1
+ ;; Optimize for package module compilation speed.
+ (optimizations-for-level 1))
+
(let* ((subdir #$directory)
(source (string-append #$source subdir)))
- (compile-files source go (find-files source "\\.scm$"))
+ (compile-files source go (find-files source "\\.scm$")
+ #:optimization-options (const -O1))
(mkdir-p (dirname scm))
(symlink (string-append #$source subdir) scm))
- branch master updated (eb8da54 -> d14f213), guix-commits, 2021/04/12
- 01/09: gnu: racket: Don't inject store paths into Racket files., guix-commits, 2021/04/12
- 05/09: gnu: tests: Test basic funtionality of the IPFS service., guix-commits, 2021/04/12
- 03/09: Add (guix ipfs)., guix-commits, 2021/04/12
- 04/09: tests: Support package extensions in the backdoor REPL., guix-commits, 2021/04/12
- 06/09: services: ipfs: Tweak description., guix-commits, 2021/04/12
- 02/09: services: Add ipfs-service-type, guix-commits, 2021/04/12
- 07/09: channels: Build user channels with '-O1'.,
guix-commits <=
- 09/09: doc: Document 'gnu-build-system' keyword parameters., guix-commits, 2021/04/12
- 08/09: doc: Move list of build phases to "Build Phases"., guix-commits, 2021/04/12