aboutsummaryrefslogtreecommitdiff
path: root/guix/packages.scm
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2020-09-19 00:20:47 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2020-10-08 12:27:02 -0400
commit5a0997ef7f3968d216328b8c63a6e36dd29a5ab8 (patch)
treea0921f2dc7435c96cbecac724a254ec654461e72 /guix/packages.scm
parent7102c18678dc02d5ee6c77a9a70ae344482af841 (diff)
downloadguix-5a0997ef7f3968d216328b8c63a6e36dd29a5ab8.tar
guix-5a0997ef7f3968d216328b8c63a6e36dd29a5ab8.tar.gz
packages, scripts, utils: Enable multi-threaded xz compression.
xz compression is slow; using the multi-thread mode of xz can make it more than 6 times faster, for example when compressing the large linux-libre source. * guix/build/utils.scm (%xz-parallel-args): New procedure. * guix/packages.scm (patch-and-repack): Specify the required above xz arguments by setting the XZ_DEFAULTS environment variable. * guix/scripts/pack.scm (%compressors, bootstrap-xz): Modify the commands Gexps so they do not need to be quoted. This allows lazily evaluating the arguments on the builder's side. Specify the required xz arguments. (self-contained-tarball): Do not quote the compressor command value. (docker-image): Likewise. * guix/utils.scm (decompressed-port, compressed-port) (compressed-output-port): Specify the required above xz arguments.
Diffstat (limited to 'guix/packages.scm')
-rw-r--r--guix/packages.scm3
1 files changed, 3 insertions, 0 deletions
diff --git a/guix/packages.scm b/guix/packages.scm
index 6598bd3149..865cb81929 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2016 Alex Kost <alezost@gmail.com>
;;; Copyright © 2017, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2019 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -693,6 +694,8 @@ specifies modules in scope when evaluating SNIPPET."
(setenv "PATH" (string-append #+xz "/bin" ":"
#+decomp "/bin"))
+ (setenv "XZ_DEFAULTS" (string-join (%xz-parallel-args)))
+
;; SOURCE may be either a directory or a tarball.
(if (file-is-directory? #+source)
(let* ((store (%store-directory))