diff options
-rw-r--r-- | guix/build-system/go.scm | 2 | ||||
-rw-r--r-- | guix/build/go-build-system.scm | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/guix/build-system/go.scm b/guix/build-system/go.scm index 9a182d2505..1e8ecba80c 100644 --- a/guix/build-system/go.scm +++ b/guix/build-system/go.scm @@ -192,6 +192,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)) (goarch #f) @@ -222,6 +223,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 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 _ |