mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 15:36:20 -05:00
substitute-binary: Work around Guile 2.0.5's broken 'n-par-map'.
* guix/scripts/substitute-binary.scm (n-par-map*): New procedure. (guix-substitute-binary): Use it instead of 'n-par-map'. Reported by Nikita Karetnikov and Eric Bavier.
This commit is contained in:
parent
0edfdb8924
commit
de6792699e
1 changed files with 16 additions and 6 deletions
|
@ -487,6 +487,16 @@ (define (show-help)
|
|||
;;; Entry point.
|
||||
;;;
|
||||
|
||||
(define n-par-map*
|
||||
;; We want the ability to run many threads in parallel, regardless of the
|
||||
;; number of cores. However, Guile 2.0.5 has a bug whereby 'n-par-map' ends
|
||||
;; up consuming a lot of memory, possibly leading to death. Thus, resort to
|
||||
;; 'par-map' on 2.0.5.
|
||||
(if (guile-version>? "2.0.5")
|
||||
n-par-map
|
||||
(lambda (n proc lst)
|
||||
(par-map proc lst))))
|
||||
|
||||
(define (guix-substitute-binary . args)
|
||||
"Implement the build daemon's substituter protocol."
|
||||
(mkdir-p %narinfo-cache-directory)
|
||||
|
@ -503,7 +513,7 @@ (define (guix-substitute-binary . args)
|
|||
;; Return the subset of PATHS available in CACHE.
|
||||
(let ((substitutable
|
||||
(if cache
|
||||
(n-par-map %lookup-threads
|
||||
(n-par-map* %lookup-threads
|
||||
(cut lookup-narinfo cache <>)
|
||||
paths)
|
||||
'())))
|
||||
|
@ -516,7 +526,7 @@ (define (guix-substitute-binary . args)
|
|||
;; Reply info about PATHS if it's in CACHE.
|
||||
(let ((substitutable
|
||||
(if cache
|
||||
(n-par-map %lookup-threads
|
||||
(n-par-map* %lookup-threads
|
||||
(cut lookup-narinfo cache <>)
|
||||
paths)
|
||||
'())))
|
||||
|
|
Loading…
Reference in a new issue