From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:37602) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGTnN-0003EQ-4D for guix-patches@gnu.org; Tue, 16 Apr 2019 15:31:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hGTnK-00013G-LD for guix-patches@gnu.org; Tue, 16 Apr 2019 15:31:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52707) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hGTnK-000137-8B for guix-patches@gnu.org; Tue, 16 Apr 2019 15:31:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hGTnK-0000od-3M for guix-patches@gnu.org; Tue, 16 Apr 2019 15:31:02 -0400 Subject: [bug#34982] [PATCH] guile-build-system: Support building in parallel. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20190324212345.4697-1-mail@cbaines.net> <20190416181326.2416-1-mail@cbaines.net> Date: Tue, 16 Apr 2019 21:30:21 +0200 In-Reply-To: <20190416181326.2416-1-mail@cbaines.net> (Christopher Baines's message of "Tue, 16 Apr 2019 19:13:26 +0100") Message-ID: <87ftqheoj6.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Christopher Baines Cc: 34982@debbugs.gnu.org Christopher Baines skribis: > * guix/build/guile-build-system.scm (build): Use invoke-each, instead of > for-each, to use multiple cores if available. > (invoke-each, report-build-process): New procedures. [...] > + (define (fork-and-run-command command) > + (match (primitive-fork) > + (0 > + (apply execlp command)) > + (pid > + #t))) To be on the safe side, you should probably wrap the =E2=80=98execlp=E2=80= =99 call like this: (dynamic-wind (const #t) (lambda () (apply execlp command)) (lambda () (primitive-exit 127))) This ensures that the child process exits immediately if something goes wrong (e.g., =E2=80=98execlp=E2=80=99 raises an exception because the execu= table could not be found.) Otherwise LGTM, thank you! Ludo=E2=80=99.