From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:60207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hCYc0-0007DP-2M for guix-patches@gnu.org; Fri, 05 Apr 2019 19:51:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hCYby-0008TO-5f for guix-patches@gnu.org; Fri, 05 Apr 2019 19:51:08 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:32826) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hCYbw-0008Hl-LU for guix-patches@gnu.org; Fri, 05 Apr 2019 19:51:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hCYbt-0007e9-Vu for guix-patches@gnu.org; Fri, 05 Apr 2019 19:51:03 -0400 Subject: [bug#34982] [PATCH] guile-build-system: Support building in parallel. Resent-Message-ID: References: <20190324212345.4697-1-mail@cbaines.net> <87lg0w4om6.fsf@gnu.org> From: Christopher Baines In-reply-to: <87lg0w4om6.fsf@gnu.org> Date: Sat, 06 Apr 2019 00:50:48 +0100 Message-ID: <87o95km2p3.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 34982@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > Hi, > > Christopher Baines 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=E2=80=99t matter that much, but it feels wrong to create > threads that do nothing but call =E2=80=98waitpid=E2=80=99, essentially. > > Commit f07041f7d25badb7d74b8fad6ee446a12af04f63 removed a =E2=80=98p-for-= each=E2=80=99 > 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 =E2=80=98n-par-for-each=E2=80=99? 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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlyn6dhfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9XdQ6hAAmj+05jYoaZtaN3SW7NVnDb5aehXj1wC5FvFf0qOH6+9+halMhYKx03wA vrLM4bE5/j4yn7bxflej3pFqV7DTbIWqMC1Pm0KM0ziWNxdU9QIzaaUg9VfSYnFt r9nbwbgAV5/lZRuU9PoIATcGAo6UrZRvfjERTh9miCJQ9oAQJw8g/34vCQANw+i7 MAWLvyv7o44+Kk+cwU1qln+Yi4gWVv4xfWrALlo4LsAeFX0X2Tgc72s6WKxRRV5X mpMJ/dybRDvmig5kys7oN1Z32fg2a8ih/losWqlLg+iacVsbtaeglSCLEM5jyj/n xJiSdrA03hvv+mQ94BOhhZx92nhbovRz5FQ30ykaAbXxp5ITwjxT6i1TWPS9mmmx KKrZE7JhfsfS/nc66bKSWnWDkXFO0yVTYn4nn4oIl+6Q75nus3JsBE2FWLHU5KSQ i2vLZpE7iJd0mypr3mCRbzMiyJtaCLQuYIO2gpL0o97z1Ao/ykjAkt4zLV9vs/MX DgdQ0IzSZdpvjdbJgnxE9Ki7MpO2ZnB848QbXXf9U+RXx8TC/w3KEJ5XsKR94xAa eg15D/YCcMwnBOx/V9QFSC1Rv2jSxxphAdxT/CcovQ4BS9Ieon4zFXQItGnfN48D hr7S/IAVIAcU1RPYWX6shEBeq5kWRQcLe2pZvoS1Du8tzObVa08= =wJ6f -----END PGP SIGNATURE----- --=-=-=--