Bug 1520340 - Don't execute subconfigure as a separate process. r=froydnj
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 16 Jan 2019 15:21:27 +0000
changeset 514165 f2096b37917d3809cad0338380dd4c07cac008ea
parent 514164 5e51e7031e8f239efd765328071a21b877e1d814
child 514166 9873a5e507a872d3519b4e7d6c1d2b8eceded25e
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1520340
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1520340 - Don't execute subconfigure as a separate process. r=froydnj Instead, include the module and inline its main function. Depends on D16622 Differential Revision: https://phabricator.services.mozilla.com/D16623
build/subconfigure.py
js/sub.configure
--- a/build/subconfigure.py
+++ b/build/subconfigure.py
@@ -216,21 +216,8 @@ def run(data):
         print(prefix_lines('running %s' % ' '.join(command[:-1]), relobjdir))
         sys.stdout.flush()
         returncode = execute_and_prefix(command, cwd=objdir, env=data['env'],
                                         prefix=relobjdir)
         if returncode:
             return returncode
 
     return 0
-
-
-def main(args):
-    topsrcdir = os.path.abspath(args[0])
-    srcdir = os.path.join(topsrcdir, 'js/src')
-    objdir = os.path.abspath('js/src')
-
-    data = prepare(srcdir, objdir, args[1:])
-    return run(data)
-
-
-if __name__ == '__main__':
-    sys.exit(main(sys.argv[1:]))
--- a/js/sub.configure
+++ b/js/sub.configure
@@ -1,17 +1,17 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 @depends(check_build_environment, prepare_configure_options, prepare_mozconfig,
          old_configure, old_configure_assignments, '--cache-file')
 @imports('itertools')
 @imports('os')
-@imports('subprocess')
+@imports('subconfigure')
 @imports('sys')
 @imports(_from='mozbuild.util', _import='encode')
 def js_subconfigure(build_env, prepare_configure_options, mozconfig,
                     old_configure, old_configure_assignments, cache_file):
     substs = dict(old_configure['substs'])
     assignments = dict(old_configure_assignments)
     environ = dict(os.environ)
     if prepare_configure_options.extra_env:
@@ -73,20 +73,21 @@ def js_subconfigure(build_env, prepare_c
                 not mozconfig[var][1].startswith('removed'):
             value = mozconfig[var][0]
         else:
             continue
         if isinstance(value, list):
             value = ' '.join(value)
         environ[var] = value
 
-    ret = subprocess.call([
-        sys.executable,
-        os.path.join(build_env.topsrcdir, 'build', 'subconfigure.py'),
-        build_env.topsrcdir
-    ] + options + [
+    options += [
         'JS_STANDALONE=',
         '--cache-file=%s' % (cache_file or './config.cache'),
-    ], env=encode(environ))
+    ]
+    srcdir = os.path.join(build_env.topsrcdir, 'js', 'src')
+    objdir = os.path.join(build_env.topobjdir, 'js', 'src')
+    data = subconfigure.prepare(srcdir, objdir, options)
+    data['env'] = encode(environ)
+    ret = subconfigure.run(data)
 
     if ret:
         log.error('subconfigure failed')
         sys.exit(ret)