From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUoWw-0006Rq-Io for guix-patches@gnu.org; Thu, 06 Dec 2018 02:57:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gUoWt-00023s-4w for guix-patches@gnu.org; Thu, 06 Dec 2018 02:57:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:58892) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gUoWs-00023F-Ta for guix-patches@gnu.org; Thu, 06 Dec 2018 02:57:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gUoWs-0008RO-Mk for guix-patches@gnu.org; Thu, 06 Dec 2018 02:57:02 -0500 Subject: [bug#33643] [PATCH] gnu-build-system: Enable xz to decompress in parallel. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUoWF-0006Ii-6M for guix-patches@gnu.org; Thu, 06 Dec 2018 02:56:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gUoWB-0001QF-2x for guix-patches@gnu.org; Thu, 06 Dec 2018 02:56:22 -0500 Received: from li622-129.members.linode.com ([212.71.249.129]:43826 helo=mira.cbaines.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUoWA-0001OA-KC for guix-patches@gnu.org; Thu, 06 Dec 2018 02:56:18 -0500 Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id A75FC16844 for ; Thu, 6 Dec 2018 07:56:16 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 13c15c60 for ; Thu, 6 Dec 2018 07:56:15 +0000 (UTC) From: Christopher Baines Date: Thu, 6 Dec 2018 07:56:15 +0000 Message-Id: <20181206075615.4637-1-mail@cbaines.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 33643@debbugs.gnu.org It can take a little while to decompress some packages with large xz compressed source tar files. xz includes support for parallelism, so enab= le this using the parallel job count for the overall derivation. * guix/build/gnu-build-system.scm (unpack): Set XZ_OPT to pass the -T opt= ion to xz to enable it to work in parallel if appropriate. --- guix/build/gnu-build-system.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-syste= m.scm index e5f3197b0..9d11e5b1e 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -147,7 +147,7 @@ chance to be set." locale (strerror (system-error-errno args))) #t))) =20 -(define* (unpack #:key source #:allow-other-keys) +(define* (unpack #:key source parallel-build? #:allow-other-keys) "Unpack SOURCE in the working directory, and change directory within t= he source. When SOURCE is a directory, copy it in a sub-directory of the c= urrent working directory." @@ -161,6 +161,10 @@ working directory." (copy-recursively source "." #:keep-mtime? #t)) (begin + (when parallel-build? + (setenv "XZ_OPT" + (format #f "-T~d" (parallel-job-count)))) + (if (string-suffix? ".zip" source) (invoke "unzip" source) (invoke "tar" "xvf" source)) --=20 2.19.2