packages: Enable threaded compression of source tarballs.

This provides a ~2x speedup when using 4 threads.

* guix/packages.scm (patch-and-repack)[build]: Invoke xz with
'--threads=0' when re-packing tarballs.
This commit is contained in:
Leo Famulari 2017-03-30 03:10:48 -04:00
parent dc4ebebd61
commit c8a3dea847
No known key found for this signature in database
GPG Key ID: 2646FA30BACA7F08
1 changed files with 6 additions and 1 deletions

View File

@ -576,7 +576,12 @@ specifies modules in scope when evaluating SNIPPET."
#:fail-on-error? #t))))) #:fail-on-error? #t)))))
(zero? (apply system* (zero? (apply system*
(string-append #+tar "/bin/tar") (string-append #+tar "/bin/tar")
"cvfa" #$output "cvf" #$output
;; The bootstrap xz does not support
;; threaded compression (introduced in
;; 5.2.0), but it ignores the extra flag.
(string-append "--use-compress-program="
#+xz "/bin/xz --threads=0")
;; avoid non-determinism in the archive ;; avoid non-determinism in the archive
"--mtime=@0" "--mtime=@0"
"--owner=root:0" "--owner=root:0"