From patchwork Thu Dec 6 07:56:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 397 X-Patchwork-Delegate: mail@cbaines.net Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1EE4816863; Thu, 6 Dec 2018 07:57:13 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) by mira.cbaines.net (Postfix) with ESMTPS id C689A16847 for ; Thu, 6 Dec 2018 07:57:12 +0000 (GMT) Received: from localhost ([::1]:39471 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUoX2-0006Rw-13 for patchwork@mira.cbaines.net; Thu, 06 Dec 2018 02:57:12 -0500 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 X-Loop: help-debbugs@gnu.org Subject: [bug#33643] [PATCH] gnu-build-system: Enable xz to decompress in parallel. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 06 Dec 2018 07:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 33643 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 33643@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.154408300632423 (code B ref -1); Thu, 06 Dec 2018 07:57:02 +0000 Received: (at submit) by debbugs.gnu.org; 6 Dec 2018 07:56:46 +0000 Received: from localhost ([127.0.0.1]:34917 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gUoWc-0008Qs-1W for submit@debbugs.gnu.org; Thu, 06 Dec 2018 02:56:46 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60856) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gUoWa-0008Qf-5H for submit@debbugs.gnu.org; Thu, 06 Dec 2018 02:56:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gUoWN-0001bn-8M for submit@debbugs.gnu.org; Thu, 06 Dec 2018 02:56:36 -0500 Received: from lists.gnu.org ([2001:4830:134:3::11]:58498) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gUoWG-0001Vh-IM for submit@debbugs.gnu.org; Thu, 06 Dec 2018 02:56:27 -0500 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: by mira.cbaines.net (Postfix, from userid 113) id D41D216851; Thu, 6 Dec 2018 07:56:16 +0000 (GMT) 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> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches It can take a little while to decompress some packages with large xz compressed source tar files. xz includes support for parallelism, so enable this using the parallel job count for the overall derivation. * guix/build/gnu-build-system.scm (unpack): Set XZ_OPT to pass the -T option 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-system.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))) -(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 the source. When SOURCE is a directory, copy it in a sub-directory of the current 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))