From patchwork Sat Aug 7 04:48:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sarah Morgensen X-Patchwork-Id: 31868 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 5794927BC78; Sat, 7 Aug 2021 05:49:20 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 6D01627BC6B for ; Sat, 7 Aug 2021 05:49:19 +0100 (BST) Received: from localhost ([::1]:60532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mCEGs-0003E4-H1 for patchwork@mira.cbaines.net; Sat, 07 Aug 2021 00:49:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32990) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mCEGc-0003Dl-0i for guix-patches@gnu.org; Sat, 07 Aug 2021 00:49:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:40182) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mCEGb-0005B9-Pe for guix-patches@gnu.org; Sat, 07 Aug 2021 00:49:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mCEGb-0003pB-Lw for guix-patches@gnu.org; Sat, 07 Aug 2021 00:49:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49919] [PATCH core-updates 1/2] build-system/go: Honor #:parallel-build?. Resent-From: Sarah Morgensen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 07 Aug 2021 04:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49919 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49919@debbugs.gnu.org Received: via spool by 49919-submit@debbugs.gnu.org id=B49919.162831172514669 (code B ref 49919); Sat, 07 Aug 2021 04:49:01 +0000 Received: (at 49919) by debbugs.gnu.org; 7 Aug 2021 04:48:45 +0000 Received: from localhost ([127.0.0.1]:51726 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mCEGG-0003oQ-UO for submit@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 ) id 1mCEGE-0003oB-Jv for 49919@debbugs.gnu.org; Sat, 07 Aug 2021 00:48:39 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com 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 Date: Fri, 6 Aug 2021 21:48:33 -0700 Message-Id: <1ea32faddea717239b3d56cfa7e647fc1d48faa7.1628309588.git.iskarian@mgsn.dev> In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: iskarian@mgsn.dev X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 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 ;;; Copyright © 2020 Jakub Kądziołka ;;; Copyright © 2021 Ludovic Courtès +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; 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 ;;; Copyright © 2020 Jakub Kądziołka ;;; Copyright © 2020 Efraim Flashner +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; 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 _ From patchwork Sat Aug 7 04:48:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sarah Morgensen X-Patchwork-Id: 31869 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 A6A7327BC78; Sat, 7 Aug 2021 05:49:20 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 782E527BC6B for ; Sat, 7 Aug 2021 05:49:20 +0100 (BST) Received: from localhost ([::1]:60560 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mCEGt-0003Fa-Hm for patchwork@mira.cbaines.net; Sat, 07 Aug 2021 00:49:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32994) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mCEGc-0003Ds-9j for guix-patches@gnu.org; Sat, 07 Aug 2021 00:49:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:40183) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mCEGc-0005Bs-3V for guix-patches@gnu.org; Sat, 07 Aug 2021 00:49:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mCEGc-0003pI-23 for guix-patches@gnu.org; Sat, 07 Aug 2021 00:49:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49919] [PATCH core-updates 2/2] build-system/go: Honor #:parallel-tests?. Resent-From: Sarah Morgensen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 07 Aug 2021 04:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49919 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49919@debbugs.gnu.org Received: via spool by 49919-submit@debbugs.gnu.org id=B49919.162831172714676 (code B ref 49919); Sat, 07 Aug 2021 04:49:02 +0000 Received: (at 49919) by debbugs.gnu.org; 7 Aug 2021 04:48:47 +0000 Received: from localhost ([127.0.0.1]:51728 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mCEGM-0003oY-N9 for submit@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 ) id 1mCEGF-0003oE-IL for 49919@debbugs.gnu.org; Sat, 07 Aug 2021 00:48:39 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com 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 Date: Fri, 6 Aug 2021 21:48:34 -0700 Message-Id: <0ec3e2c95c5be19dd9c07dd21f7f55283ebdc9da.1628309588.git.iskarian@mgsn.dev> In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: iskarian@mgsn.dev X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 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)