Bug 1369658 - Remove support for running subconfigures in parallel. r?gps draft
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 02 Jun 2017 16:51:47 +0900
changeset 588154 e467b0af7ce5ccb821c3df15c1562650fcac0459
parent 588146 2255d01b9d6b681eec312fa5db4fb0c8d6f01600
child 588155 654ecf12fd8ed79c7643e90c00dd5342dda187cd
push id61930
push userbmo:mh+mozilla@glandium.org
push dateFri, 02 Jun 2017 08:15:23 +0000
reviewersgps
bugs1369658, 1358023, 1363992
milestone55.0a1
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.
build/subconfigure.py
--- 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])