mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-02-01 23:36:35 +01:00
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>
This commit is contained in:
parent
d86b0d9689
commit
92046a65fa
2 changed files with 7 additions and 1 deletions
|
@ -192,6 +192,7 @@ (define* (go-build name inputs
|
|||
(unpack-path "")
|
||||
(build-flags ''())
|
||||
(tests? #t)
|
||||
(parallel-build? #t)
|
||||
(allow-go-reference? #f)
|
||||
(system (%current-system))
|
||||
(goarch #f)
|
||||
|
@ -222,6 +223,7 @@ (define builder
|
|||
#: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)))))
|
||||
|
||||
|
|
|
@ -256,8 +256,12 @@ (define (go-inputs inputs)
|
|||
(_ #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 _
|
||||
|
|
Loading…
Reference in a new issue