summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorSarah Morgensen <iskarian@mgsn.dev>2021-07-17 21:05:59 -0700
committerEfraim Flashner <efraim@flashner.co.il>2021-08-05 16:54:13 +0300
commitead6cc03c66ed31f0ab7300fab11cef3a1e459f0 (patch)
tree8defeaf4e3f825ff4b4212762d84152b8e5faf19 /gnu
parent8cc36f76bbd96d6b6da96fee62515634d9da0803 (diff)
downloadguix-ead6cc03c66ed31f0ab7300fab11cef3a1e459f0.tar.gz
gnu: go-1.16: Honor #:parallel-build?
* gnu/packages/golang.scm (go-1.16)[arguments]<#:phases>{build}: Honor
parallel-build?

Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/golang.scm7
1 files changed, 5 insertions, 2 deletions
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index ed8f504aa1..89020648f0 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -1514,10 +1514,12 @@ in the style of communicating sequential processes (@dfn{CSP}).")
                  (substitute* "time/zoneinfo_unix.go"
                    (("/usr/share/zoneinfo/") tzdata-path)))))
            (replace 'build
-             (lambda* (#:key inputs outputs #:allow-other-keys)
+             (lambda* (#:key inputs outputs (parallel-build? #t)
+                       #:allow-other-keys)
                ;; FIXME: Some of the .a files are not bit-reproducible.
                ;; (Is this still true?)
-               (let* ((output (assoc-ref outputs "out"))
+               (let* ((njobs (if parallel-build? (parallel-job-count) 1))
+                      (output (assoc-ref outputs "out"))
                       (loader (string-append (assoc-ref inputs "libc")
                                              ,(glibc-dynamic-linker))))
                  (setenv "CC" (which "gcc"))
@@ -1526,6 +1528,7 @@ in the style of communicating sequential processes (@dfn{CSP}).")
                  (setenv "GOROOT" (dirname (getcwd)))
                  (setenv "GOROOT_FINAL" output)
                  (setenv "GOCACHE" "/tmp/go-cache")
+                 (setenv "GOMAXPROCS" (number->string njobs))
                  (invoke "sh" "make.bash" "--no-banner"))))
            (replace 'check
              (lambda* (#:key target (tests? (not target)) (parallel-tests? #t)