guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: guix-commits
Subject: 02/02: self: Limit the number of threads used when translating manuals.
Date: Mon, 16 Nov 2020 06:55:35 -0500 (EST)

civodul pushed a commit to branch version-1.2.0
in repository guix.

commit 98750a9d9967b84a077735a2e4e6d5526256a5fd
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Nov 16 11:40:53 2020 +0100

    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'.
---
 guix/self.scm | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/guix/self.scm b/guix/self.scm
index bbfd2f1..026dcd9 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -400,6 +400,12 @@ a list of extra files, such as '(\"contributing\")."
                         (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 @@ a list of extra files, such as '(\"contributing\")."
           (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)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]