diff options
author | Thomas Miedema <thomasmiedema@gmail.com> | 2015-06-04 23:23:19 +0200 |
---|---|---|
committer | Thomas Miedema <thomasmiedema@gmail.com> | 2015-06-09 13:25:45 +0200 |
commit | 4a0b7a10442eec3747d5f95ef186a79bb0648754 (patch) | |
tree | 5a0184fa7e7275cddce75e4a03247a55e79faaf6 | |
parent | 3445947ae380967b4032233273fdb54d41bce157 (diff) | |
download | haskell-4a0b7a10442eec3747d5f95ef186a79bb0648754.tar.gz |
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
-rwxr-xr-x | boot | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -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 { |