Bug 1369658 - Remove support for running subconfigures in parallel. r?gps
Bug 1358023 and
bug 1363992 removed the last uses of subconfigure other
than js/src. We don't need all the machinery to run subconfigures in
parallel anymore.
--- a/build/subconfigure.py
+++ b/build/subconfigure.py
@@ -12,35 +12,16 @@ import os
import re
import subprocess
import sys
import pickle
import mozpack.path as mozpath
-class Pool(object):
- def __new__(cls, size):
- try:
- import multiprocessing
- size = min(size, multiprocessing.cpu_count())
- return multiprocessing.Pool(size)
- except:
- return super(Pool, cls).__new__(cls)
-
- def imap_unordered(self, fn, iterable):
- return itertools.imap(fn, iterable)
-
- def close(self):
- pass
-
- def join(self):
- pass
-
-
class File(object):
def __init__(self, path):
self._path = path
self._content = open(path, 'rb').read()
stat = os.stat(path)
self._times = (stat.st_atime, stat.st_mtime)
@property
@@ -406,29 +387,23 @@ def subconfigure(args):
if args.skip:
skips = set(open(args.skip, 'rb').read().splitlines())
subconfigures = [s for s in subconfigures if s not in skips]
if not subconfigures:
return 0
ret = 0
- # One would think using a ThreadPool would be faster, considering
- # everything happens in subprocesses anyways, but no, it's actually
- # slower on Windows. (20s difference overall!)
- pool = Pool(len(subconfigures))
- for relobjdir, returncode, output in \
- pool.imap_unordered(run, subconfigures):
+ for subconfigure in subconfigures:
+ relobjdir, returncode, output = run(subconfigure)
print prefix_lines(output, relobjdir)
sys.stdout.flush()
ret = max(returncode, ret)
if ret:
break
- pool.close()
- pool.join()
return ret
def main(args):
if args[0] != '--prepare':
return subconfigure(args)
topsrcdir = os.path.abspath(args[1])