GNU bug report logs - #49919
[PATCH core-updates 0/2] build-system/go: Enable parallelism.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Sarah Morgensen <iskarian@HIDDEN>; Keywords: patch; dated Sat, 7 Aug 2021 04:47:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 49919 <at> debbugs.gnu.org:


Received: (at 49919) by debbugs.gnu.org; 19 Aug 2021 15:14:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 19 11:14:02 2021
Received: from localhost ([127.0.0.1]:60645 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mGjk1-0005Ux-QN
	for submit <at> debbugs.gnu.org; Thu, 19 Aug 2021 11:14:02 -0400
Received: from eggs.gnu.org ([209.51.188.92]:50848)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <othacehe@HIDDEN>) id 1mGjk0-0005UX-3N
 for 49919 <at> debbugs.gnu.org; Thu, 19 Aug 2021 11:14:00 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:49806)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <othacehe@HIDDEN>)
 id 1mGjju-0001sO-7v; Thu, 19 Aug 2021 11:13:54 -0400
Received: from [2a01:cb18:832e:5f00:3563:417e:2a38:86d8] (port=48132
 helo=meije)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <othacehe@HIDDEN>)
 id 1mGjjt-0001oE-Ul; Thu, 19 Aug 2021 11:13:54 -0400
From: Mathieu Othacehe <othacehe@HIDDEN>
To: Sarah Morgensen <iskarian@HIDDEN>
Subject: Re: bug#49919: [PATCH core-updates 0/2] build-system/go: Enable
 parallelism.
References: <cover.1628309588.git.iskarian@HIDDEN>
Date: Thu, 19 Aug 2021 17:13:52 +0200
In-Reply-To: <cover.1628309588.git.iskarian@HIDDEN> (Sarah Morgensen's
 message of "Fri, 6 Aug 2021 21:45:57 -0700")
Message-ID: <87wnohcvrj.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 49919
Cc: 49919 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)


Hello Sarah,

> These patches give the Go build system the standard parallelism levers. I would
> have thought that Go was already detecting the correct number for GOMAXPROCS,
> but after I made this same change for the bootstrapping Go compiler, Efraim
> found that it cut the build time nearly in half [0].

This looks good, but I'd rather have Cuirass fixed before pushing this
series so that we can evaluate the impact on all Go packages and
potentially find some regressions.

Thanks,

Mathieu




Information forwarded to guix-patches@HIDDEN:
bug#49919; Package guix-patches. Full text available.

Message received at 49919 <at> debbugs.gnu.org:


Received: (at 49919) by debbugs.gnu.org; 7 Aug 2021 04:48:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 07 00:48:46 2021
Received: from localhost ([127.0.0.1]:51728 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mCEGM-0003oY-N9
	for submit <at> debbugs.gnu.org; Sat, 07 Aug 2021 00:48:46 -0400
Received: from out1.migadu.com ([91.121.223.63]:22481)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <iskarian@HIDDEN>) id 1mCEGF-0003oE-IL
 for 49919 <at> debbugs.gnu.org; Sat, 07 Aug 2021 00:48:39 -0400
X-Report-Abuse: Please report any abuse attempt to abuse@HIDDEN and
 include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1;
 t=1628311719;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=jqqJTupahqpcZ9mq9+Q/+b1DXjcF3CEX0RrnivWcaUk=;
 b=WtUev9DoV4vMLRxjdR6oD9EFZKdrlX2cgQr4sw2MQWH31BT1z6L9SYw1P3yYMhWCkhHA4D
 jrf6btEUCP69APuxrJafZwQ7yRUxLtSs5+XORjEtsXZiLQNtZ57MWtWlf1xKnanH7YQFra
 7Yse8IMYH69BIPwP63ySzGJt16k3/50=
From: Sarah Morgensen <iskarian@HIDDEN>
To: 49919 <at> debbugs.gnu.org
Subject: [PATCH core-updates 2/2] build-system/go: Honor #:parallel-tests?.
Date: Fri,  6 Aug 2021 21:48:34 -0700
Message-Id: <0ec3e2c95c5be19dd9c07dd21f7f55283ebdc9da.1628309588.git.iskarian@HIDDEN>
In-Reply-To: <cover.1628309588.git.iskarian@HIDDEN>
References: <cover.1628309588.git.iskarian@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Migadu-Flow: FLOW_OUT
X-Migadu-Auth-User: iskarian@HIDDEN
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 49919
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

guix/build/go-build-system.scm (build): Honor #:parallel-tests?.
guix/build-system/go.scm (go-build): Add PARALLEL-TESTS? parameter.
[builder]: Use it.
---
 guix/build-system/go.scm       | 2 ++
 guix/build/go-build-system.scm | 5 ++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/guix/build-system/go.scm b/guix/build-system/go.scm
index a5aa21b99e..7b66163779 100644
--- a/guix/build-system/go.scm
+++ b/guix/build-system/go.scm
@@ -131,6 +131,7 @@ commit hash and its date rather than a proper release tag."
                    (build-flags ''())
                    (tests? #t)
                    (parallel-build? #t)
+                   (parallel-tests? #t)
                    (allow-go-reference? #f)
                    (system (%current-system))
                    (guile #f)
@@ -156,6 +157,7 @@ commit hash and its date rather than a proper release tag."
                     #:build-flags #$build-flags
                     #:tests? #$tests?
                     #:parallel-build? #$parallel-build?
+                    #:parallel-tests? #$parallel-tests?
                     #:allow-go-reference? #$allow-go-reference?
                     #:inputs #$(input-tuples->gexp inputs)))))
 
diff --git a/guix/build/go-build-system.scm b/guix/build/go-build-system.scm
index 521bad9667..0ad580a484 100644
--- a/guix/build/go-build-system.scm
+++ b/guix/build/go-build-system.scm
@@ -239,9 +239,12 @@ unpacking."
       (invoke "go" "env"))))
 
 ;; Can this also install commands???
-(define* (check #:key tests? import-path #:allow-other-keys)
+(define* (check #:key tests? import-path (parallel-tests? #t)
+                #:allow-other-keys)
   "Run the tests for the package named by IMPORT-PATH."
   (when tests?
+    (let* ((njobs (if parallel-tests? (parallel-job-count) 1)))
+      (setenv "GOMAXPROCS" (number->string njobs)))
     (invoke "go" "test" import-path))
   #t)
 
-- 
2.31.1





Information forwarded to guix-patches@HIDDEN:
bug#49919; Package guix-patches. Full text available.

Message received at 49919 <at> debbugs.gnu.org:


Received: (at 49919) by debbugs.gnu.org; 7 Aug 2021 04:48:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 07 00:48:45 2021
Received: from localhost ([127.0.0.1]:51726 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mCEGG-0003oQ-UO
	for submit <at> debbugs.gnu.org; Sat, 07 Aug 2021 00:48:45 -0400
Received: from out1.migadu.com ([91.121.223.63]:22470)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <iskarian@HIDDEN>) id 1mCEGE-0003oB-Jv
 for 49919 <at> debbugs.gnu.org; Sat, 07 Aug 2021 00:48:39 -0400
X-Report-Abuse: Please report any abuse attempt to abuse@HIDDEN and
 include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1;
 t=1628311716;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=ZFXTMOVwI9WfCW8BL/IfOOcxRplp/nyZwLe1WUkVOWc=;
 b=Cgd1aWZ1vvBD/RoL/JzMB1hUd4HSYwZfX3EyZtXOPW/QTslsL1Kpy+OUH95OW1r9oQ7MDc
 zsyk4TrNt1wU6RGoydGZMrgO2NI7Zsk5fIGRNWkKu0QsbhUPZgSf3nM0Ej+JxyEnRSYK+8
 WGydeaZ8JJtZew2PM0CUjce4s1Ym1wQ=
From: Sarah Morgensen <iskarian@HIDDEN>
To: 49919 <at> debbugs.gnu.org
Subject: [PATCH core-updates 1/2] build-system/go: Honor #:parallel-build?.
Date: Fri,  6 Aug 2021 21:48:33 -0700
Message-Id: <1ea32faddea717239b3d56cfa7e647fc1d48faa7.1628309588.git.iskarian@HIDDEN>
In-Reply-To: <cover.1628309588.git.iskarian@HIDDEN>
References: <cover.1628309588.git.iskarian@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Migadu-Flow: FLOW_OUT
X-Migadu-Auth-User: iskarian@HIDDEN
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 49919
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

guix/build/go-build-system.scm (build): Honor #:parallel-build?.
guix/build-system/go.scm (go-build): Add PARALLEL-BUILD? parameter.
[builder]: Use it.
---
 guix/build-system/go.scm       | 3 +++
 guix/build/go-build-system.scm | 7 ++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/guix/build-system/go.scm b/guix/build-system/go.scm
index 100d1db4b6..a5aa21b99e 100644
--- a/guix/build-system/go.scm
+++ b/guix/build-system/go.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2017 Leo Famulari <leo@HIDDEN>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba@HIDDEN>
 ;;; Copyright © 2021 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2021 Sarah Morgensen <iskarian@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -129,6 +130,7 @@ commit hash and its date rather than a proper release tag."
                    (unpack-path "")
                    (build-flags ''())
                    (tests? #t)
+                   (parallel-build? #t)
                    (allow-go-reference? #f)
                    (system (%current-system))
                    (guile #f)
@@ -153,6 +155,7 @@ commit hash and its date rather than a proper release tag."
                     #:unpack-path #$unpack-path
                     #:build-flags #$build-flags
                     #:tests? #$tests?
+                    #:parallel-build? #$parallel-build?
                     #:allow-go-reference? #$allow-go-reference?
                     #:inputs #$(input-tuples->gexp inputs)))))
 
diff --git a/guix/build/go-build-system.scm b/guix/build/go-build-system.scm
index 227df820db..521bad9667 100644
--- a/guix/build/go-build-system.scm
+++ b/guix/build/go-build-system.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2020 Jack Hill <jackhill@HIDDEN>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba@HIDDEN>
 ;;; Copyright © 2020 Efraim Flashner <efraim@HIDDEN>
+;;; Copyright © 2021 Sarah Morgensen <iskarian@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -216,8 +217,12 @@ unpacking."
                 (_ #f))
               inputs))))
 
-(define* (build #:key import-path build-flags #:allow-other-keys)
+(define* (build #:key import-path build-flags (parallel-build? #t)
+                #:allow-other-keys)
   "Build the package named by IMPORT-PATH."
+  (let* ((njobs (if parallel-build? (parallel-job-count) 1)))
+    (setenv "GOMAXPROCS" (number->string njobs)))
+
   (with-throw-handler
     #t
     (lambda _
-- 
2.31.1





Information forwarded to guix-patches@HIDDEN:
bug#49919; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 7 Aug 2021 04:46:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 07 00:46:14 2021
Received: from localhost ([127.0.0.1]:51715 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mCEDu-0003jV-2d
	for submit <at> debbugs.gnu.org; Sat, 07 Aug 2021 00:46:14 -0400
Received: from lists.gnu.org ([209.51.188.17]:47290)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <iskarian@HIDDEN>) id 1mCEDr-0003jM-Gl
 for submit <at> debbugs.gnu.org; Sat, 07 Aug 2021 00:46:13 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:32814)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <iskarian@HIDDEN>) id 1mCEDr-0002dF-3N
 for guix-patches@HIDDEN; Sat, 07 Aug 2021 00:46:11 -0400
Received: from out2.migadu.com ([188.165.223.204]:48009)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <iskarian@HIDDEN>) id 1mCEDn-0002aA-Jy
 for guix-patches@HIDDEN; Sat, 07 Aug 2021 00:46:10 -0400
X-Report-Abuse: Please report any abuse attempt to abuse@HIDDEN and
 include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1;
 t=1628311559;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding;
 bh=ncq1rgTxWepT4X2v4FVZYP2awS2un/g0tB6sJz5sjRI=;
 b=hQWOjlsnOH2KcPem3jQjSlyarpT1l02WDW+ivIhZhh7IM5LvZ6mLqeVWdLPNW8EmBSP2Ug
 /mAvE+RZ0i2FhiY+9CUvRNRwOstSY9P22wqdwIYQLAI9QzUz1haLKTnb/R+FuZJoXB9Wa2
 g0PAamoOGgimyv2o/vlCpTSRnKGS4cE=
From: Sarah Morgensen <iskarian@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH core-updates 0/2] build-system/go: Enable parallelism.
Date: Fri,  6 Aug 2021 21:45:57 -0700
Message-Id: <cover.1628309588.git.iskarian@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Migadu-Flow: FLOW_OUT
X-Migadu-Auth-User: iskarian@HIDDEN
Received-SPF: pass client-ip=188.165.223.204; envelope-from=iskarian@HIDDEN;
 helo=out2.migadu.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

Hello Guix,

These patches give the Go build system the standard parallelism levers. I would
have thought that Go was already detecting the correct number for GOMAXPROCS,
but after I made this same change for the bootstrapping Go compiler, Efraim
found that it cut the build time nearly in half [0].

[0] https://issues.guix.gnu.org/49616

--
Sarah Morgensen (2):
  build-system/go: Honor #:parallel-build?.
  build-system/go: Honor #:parallel-tests?.

 guix/build-system/go.scm       |  5 +++++
 guix/build/go-build-system.scm | 12 ++++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)


base-commit: 693d75e859150601145b7f7303f61d4f48e76927
-- 
2.31.1





Acknowledgement sent to Sarah Morgensen <iskarian@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#49919; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 19 Aug 2021 15:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.