Bug 1256574 - Make the part writing and executing config.status importable for c-c. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 15 Mar 2016 16:41:53 +0900
changeset 326710 4b048c4d03d89638616e3b733f6b2ae59023d5e7
parent 326709 2eb222bbb28345c32180041dba9ca24e86db8da6
child 326711 a6fc6ab667a6a44a335210dd6f3402eea67292e9
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1256574
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 1256574 - Make the part writing and executing config.status importable for c-c. r=gps
configure.py
--- a/configure.py
+++ b/configure.py
@@ -19,16 +19,20 @@ from mozbuild.configure import Configure
 def main(argv):
     config = {}
     sandbox = ConfigureSandbox(config, os.environ, argv)
     sandbox.run(os.path.join(os.path.dirname(__file__), 'moz.configure'))
 
     if sandbox._help:
         return 0
 
+    return config_status(config)
+
+
+def config_status(config):
     # Sanitize config data to feed config.status
     sanitized_config = {}
     sanitized_config['substs'] = {
         k: v for k, v in config.iteritems()
         if k not in ('DEFINES', 'non_global_defines', 'TOPSRCDIR', 'TOPOBJDIR')
     }
     sanitized_config['defines'] = config['DEFINES']
     sanitized_config['non_global_defines'] = config['non_global_defines']
@@ -64,10 +68,11 @@ if __name__ == '__main__':
     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'])
     return 0
 
+
 if __name__ == '__main__':
     sys.exit(main(sys.argv))