Bug 1254884 - Make JSON serialization to config.status more readable as python. r=chmanchester
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 16 Mar 2016 07:27:22 +0900
changeset 288870 c916fde5ebb3819a051a96c2f25366764c5900e7
parent 288869 1e381e3428d1b46233bb649d572ceddcc7cc0f91
child 288871 3c8ea88e6916b841fc760b7b748ef7e93bb38b38
push id30091
push usercbook@mozilla.com
push dateWed, 16 Mar 2016 09:56:40 +0000
treeherdermozilla-central@341344bdec8f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschmanchester
bugs1254884
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 1254884 - Make JSON serialization to config.status more readable as python. r=chmanchester
configure.py
--- a/configure.py
+++ b/configure.py
@@ -42,16 +42,20 @@ def config_status(config):
     # Create config.status. Eventually, we'll want to just do the work it does
     # here, when we're able to skip configure tests/use cached results/not rely
     # on autoconf.
     print("Creating config.status", file=sys.stderr)
     encoding = 'mbcs' if sys.platform == 'win32' else 'utf-8'
     with codecs.open('config.status', 'w', encoding) as fh:
         fh.write('#!%s\n' % config['PYTHON'])
         fh.write('# coding=%s\n' % encoding)
+        # Because we're serializing as JSON but reading as python, the values
+        # for True, False and None are true, false and null, which don't exist.
+        # Define them.
+        fh.write('true, false, null = True, False, None\n')
         for k, v in sanitized_config.iteritems():
             fh.write('%s = ' % k)
             json.dump(v, fh, sort_keys=True, indent=4, ensure_ascii=False)
             fh.write('\n')
         fh.write("__all__ = ['topobjdir', 'topsrcdir', 'defines', "
                  "'non_global_defines', 'substs']")
 
         if not config.get('BUILDING_JS') or config.get('JS_STANDALONE'):