[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#34982] [PATCH] guile-build-system: Support building in parallel.
From: |
Christopher Baines |
Subject: |
[bug#34982] [PATCH] guile-build-system: Support building in parallel. |
Date: |
Sat, 06 Apr 2019 00:50:48 +0100 |
User-agent: |
mu4e 1.0; emacs 26.1 |
Ludovic Courtès <address@hidden> writes:
> Hi,
>
> Christopher Baines <address@hidden> skribis:
>
>> * guix/build/guile-build-system.scm (build): Use n-par-for-each, instead of
>> for-each, to use multiple cores if available.
>
> [...]
>
>> + (n-par-for-each
>> + (parallel-job-count)
>> + (lambda (file)
>> + (catch #t
>> + (lambda ()
>> + (let* ((go (string-append go-dir
>> + (file-sans-extension file)
>> + ".go")))
>> + ;; Install source module.
>> + (install-file (string-append source-directory "/" file)
>> + (string-append module-dir
>> + "/" (dirname file)))
>>
>> - ;; Install and compile module.
>> - (apply invoke guild "compile" "-L" source-directory
>
> It probably doesn’t matter that much, but it feels wrong to create
> threads that do nothing but call ‘waitpid’, essentially.
>
> Commit f07041f7d25badb7d74b8fad6ee446a12af04f63 removed a ‘p-for-each’
> procedure that could be useful here since it directly creates N
> processes and then does (waitpid WAITPID_ANY). Would it make sense to
> paste it here and use it in lieu of ‘n-par-for-each’?
I've sent a new patch with an updated approach now, I started with the
n-par-for-each procedure, and adapted it. It seems to work, let me know
what you think :)
Chris
signature.asc
Description: PGP signature
- [bug#34982] [PATCH] guile-build-system: Support building in parallel.,
Christopher Baines <=