summaryrefslogtreecommitdiff
path: root/guix/build/go-build-system.scm
diff options
context:
space:
mode:
authorSarah Morgensen <iskarian@mgsn.dev>2021-08-06 21:48:33 -0700
committerLudovic Courtès <ludo@gnu.org>2024-08-31 10:44:36 +0200
commit92046a65fa7820a60c2773650072a488ac23dc83 (patch)
treef50daba6e95b30b7629e6f5c07f64d8ce21f482c /guix/build/go-build-system.scm
parentd86b0d9689a0b6e6715360cd0916f8cb61dafe56 (diff)
build-system/go: Honor #:parallel-build?.
guix/build/go-build-system.scm (build): Honor #:parallel-build?. guix/build-system/go.scm (go-build): Add PARALLEL-BUILD? parameter. [builder]: Use it. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Diffstat (limited to 'guix/build/go-build-system.scm')
-rw-r--r--guix/build/go-build-system.scm6
1 files changed, 5 insertions, 1 deletions
diff --git a/guix/build/go-build-system.scm b/guix/build/go-build-system.scm
index d95262bd6c..160323b65e 100644
--- a/guix/build/go-build-system.scm
+++ b/guix/build/go-build-system.scm
@@ -256,8 +256,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 _