[commit: ghc] master: Build: run autoreconf jobs in parallel (4a0b7a1)
git at git.haskell.org
git at git.haskell.org
Tue Jun 9 11:26:47 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/4a0b7a10442eec3747d5f95ef186a79bb0648754/ghc
>---------------------------------------------------------------
commit 4a0b7a10442eec3747d5f95ef186a79bb0648754
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date: Thu Jun 4 23:23:19 2015 +0200
Build: run autoreconf jobs in parallel
Running ./boot takes ~20 seconds on my laptop with 2 cores. With this change,
that goes down to a little over 10 seconds. There are 8 configure.ac files in
total, so max 8 parallel jobs.
Differential Revision: https://phabricator.haskell.org/D962
>---------------------------------------------------------------
4a0b7a10442eec3747d5f95ef186a79bb0648754
boot | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/boot b/boot
index 8977eaf..af5ccc2 100755
--- a/boot
+++ b/boot
@@ -155,16 +155,25 @@ sub boot_pkgs {
# autoreconf everything that needs it.
sub autoreconf {
my $dir;
+ my $fail;
foreach $dir (".", glob("libraries/*/")) {
if (-f "$dir/configure.ac") {
+ next if (my $pid = fork);
+ die "fork failed: $!" if (! defined $pid);
print "Booting $dir\n";
chdir $dir or die "can't change to $dir: $!";
- system("autoreconf") == 0
- or die "Running autoreconf failed with exitcode $?";
- chdir $curdir or die "can't change to $curdir: $!";
+ exec("autoreconf");
+ exit 1;
}
}
+
+ # Wait for all child processes to finish.
+ while (wait() != -1) {
+ $fail = 1 if $?;
+ }
+
+ die "Running autoreconf failed" if $fail;
}
sub checkBuildMk {
More information about the ghc-commits
mailing list