Bug 1369658 - Remove support for running subconfigures in parallel. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 02 Jun 2017 16:51:47 +0900
changeset 588557 a784646bf7be61e19fc345a5eb30fdc5c326ee62
parent 588556 181f02a8a7e896de9e2de40a06f3e0f9b906c71b
child 588558 372bdca82f66d8dc63f66890248fc6935c19e4ce
push id62084
push userbmo:rchien@mozilla.com
push dateSat, 03 Jun 2017 03:26:37 +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
@@ -399,29 +380,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])