Bug 1257049 - Stop spawning a separate process for config.status from configure.py. r=gps
☠☠ backed out by b226ad5571c4 ☠ ☠
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 15 Mar 2016 18:34:30 +0900
changeset 288874 37f3e53ede1f3b3788b5060d49aa122337680d46
parent 288873 93df41fba9ac836323de8643237c9c0943f28b95
child 288875 f72453a034c39e94ed561851334c122bc26a3ffa
push id73604
push usermh@glandium.org
push dateWed, 16 Mar 2016 01:58:12 +0000
treeherdermozilla-inbound@37f3e53ede1f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1257049
milestone48.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 1257049 - Stop spawning a separate process for config.status from configure.py. r=gps
configure.py
python/mozbuild/mozbuild/config_status.py
--- a/configure.py
+++ b/configure.py
@@ -67,16 +67,15 @@ if __name__ == '__main__':
 ''')
 
     # Other things than us are going to run this file, so we need to give it
     # executable permissions.
     os.chmod('config.status', 0755)
     if not config.get('BUILDING_JS') or config.get('JS_STANDALONE'):
         if not config.get('JS_STANDALONE'):
             os.environ['WRITE_MOZINFO'] = '1'
-        # Until we have access to the virtualenv from this script, execute
-        # config.status externally, with the virtualenv python.
-        return subprocess.call([config['PYTHON'], 'config.status'])
+        from mozbuild.config_status import config_status
+        return config_status(args=[], **sanitized_config)
     return 0
 
 
 if __name__ == '__main__':
     sys.exit(main(sys.argv))
--- a/python/mozbuild/mozbuild/config_status.py
+++ b/python/mozbuild/mozbuild/config_status.py
@@ -58,17 +58,18 @@ following:
 
    mach build-backend --backend=VisualStudio
 
 ===============================
 '''.strip()
 
 
 def config_status(topobjdir='.', topsrcdir='.', defines=None,
-                  non_global_defines=None, substs=None, source=None):
+                  non_global_defines=None, substs=None, source=None,
+                  args=sys.argv[1:]):
     '''Main function, providing config.status functionality.
 
     Contrary to config.status, it doesn't use CONFIG_FILES or CONFIG_HEADERS
     variables.
 
     Without the -n option, this program acts as config.status and considers
     the current directory as the top object directory, even when config.status
     is in a different directory. It will, however, treat the directory
@@ -107,17 +108,17 @@ def config_status(topobjdir='.', topsrcd
     parser.add_argument('-d', '--diff', action='store_true',
                         help='print diffs of changed files.')
     parser.add_argument('-b', '--backend', nargs='+', choices=sorted(backends),
                         default=default_backends,
                         help='what backend to build (default: %s).' %
                         ' '.join(default_backends))
     parser.add_argument('--dry-run', action='store_true',
                         help='do everything except writing files out.')
-    options = parser.parse_args()
+    options = parser.parse_args(args)
 
     # Without -n, the current directory is meant to be the top object directory
     if not options.not_topobjdir:
         topobjdir = os.path.abspath('.')
 
     env = ConfigEnvironment(topsrcdir, topobjdir, defines=defines,
             non_global_defines=non_global_defines, substs=substs, source=source)