Bug 1254884 - Make JSON serialization to config.status more readable as python draft
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 16 Mar 2016 07:27:22 +0900
changeset 340739 a35347ceb933a58b9f240598c20e61f4c0d38664
parent 340737 080d09dbc5a93ed08fcb9234101d59f4a7086cc7
child 516260 4191272b34378c50b7cb4614509ba7fffb164ea8
push id13048
push userbmo:mh+mozilla@glandium.org
push dateTue, 15 Mar 2016 22:28:00 +0000
bugs1254884
milestone48.0a1
Bug 1254884 - Make JSON serialization to config.status more readable as python
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'):