mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-27 06:42:14 -05:00
self: Build directories in chunks of max 25 files at a time.
This increases the chances of a successful `guix pull' on the Hurd, see <https://issues.guix.gnu.org/65456>. * guix/self.scm (compiled-modules)[process-directory]: Split building of directories into chunks of max 25 files. Also call gc.
This commit is contained in:
parent
1d30ec9351
commit
658de25e99
1 changed files with 20 additions and 7 deletions
|
@ -1,6 +1,7 @@
|
|||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2017-2023 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
|
||||
;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
|
@ -1210,7 +1211,8 @@ (define build
|
|||
'((guix build compile)
|
||||
(guix build utils)))
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-26)
|
||||
(use-modules (srfi srfi-1)
|
||||
(srfi srfi-26)
|
||||
(ice-9 match)
|
||||
(ice-9 format)
|
||||
(ice-9 threads)
|
||||
|
@ -1244,12 +1246,23 @@ (define (report-compilation file total completed)
|
|||
(force-output))
|
||||
|
||||
(define (process-directory directory files output)
|
||||
;; Hide compilation warnings.
|
||||
(parameterize ((current-warning-port (%make-void-port "w")))
|
||||
(compile-files directory #$output files
|
||||
#:workers (parallel-job-count)
|
||||
#:report-load report-load
|
||||
#:report-compilation report-compilation)))
|
||||
(let* ((size 25) ;compile max 25 files a time
|
||||
(chunks (unfold
|
||||
(lambda (seed) (< (length seed) size)) ;p
|
||||
(cute take <> size) ;f
|
||||
(cute drop <> size) ;g
|
||||
files ;seed
|
||||
list))) ;tail
|
||||
(for-each
|
||||
(lambda (chunk)
|
||||
;; Hide compilation warnings.
|
||||
(parameterize ((current-warning-port (%make-void-port "w")))
|
||||
(compile-files directory output chunk
|
||||
#:workers (parallel-job-count)
|
||||
#:report-load report-load
|
||||
#:report-compilation report-compilation)
|
||||
(gc)))
|
||||
chunks)))
|
||||
|
||||
(setvbuf (current-output-port) 'line)
|
||||
(setvbuf (current-error-port) 'line)
|
||||
|
|
Loading…
Reference in a new issue