self: Limit the number of threads used when translating manuals.

* guix/self.scm (translate-texi-manuals)[build](parallel-jobs): New
variable.
Use it as first argument to 'n-par-for-each'.
This commit is contained in:
Ludovic Courtès 2020-11-16 11:40:53 +01:00
parent 977eb5d023
commit 98750a9d99
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -400,6 +400,12 @@ (define (available-translations directory domain)
(find-files directory
"\\.[a-z]{2}(_[A-Z]{2})?\\.po$")))
(define parallel-jobs
;; Limit thread creation by 'n-par-for-each'. Going beyond can
;; lead libgc 8.0.4 to abort with:
;; mmap(PROT_NONE) failed
(min (parallel-job-count) 4))
(mkdir #$output)
(copy-recursively #$documentation "."
#:log (%make-void-port "w"))
@ -415,14 +421,14 @@ (define (available-translations directory domain)
(setenv "LC_ALL" "en_US.UTF-8")
(setlocale LC_ALL "en_US.UTF-8")
(n-par-for-each (parallel-job-count)
(n-par-for-each parallel-jobs
(match-lambda
((language . po)
(translate-texi "guix" po language
#:extras '("contributing"))))
(available-translations "." "guix-manual"))
(n-par-for-each (parallel-job-count)
(n-par-for-each parallel-jobs
(match-lambda
((language . po)
(translate-texi "guix-cookbook" po language)))