Bug 1417264 - Write .mozconfig.json from Python; r=nalexander

In order to determine if we need to re-run configure, we write
a JSON file representing the evaluated mozconfig. If this JSON
file changes, configure (and config.status for that matter) is
out of data and it is re-executed.

This commit moves the generation of that JSON file to Python.

MozReview-Commit-ID: 636rpSY7gOm
This commit is contained in:
Gregory Szorc committed 2017-11-13 17:45:03 -08:00
1 parent ba00f4381e
commit efd963ff41
2 files changed
+9 -10

No files matched your search

@@ -1372,6 +1372,14 @@ class BuildDriver(MozbuildObject):
with FileAvoidWrite(mozconfig_mk) as fh:
fh.write(b'\n'.join(mozconfig_filtered_lines))
mozconfig_json = os.path.join(self.topobjdir, '.mozconfig.json')
with FileAvoidWrite(mozconfig_json) as fh:
json.dump({
'topsrcdir': self.topsrcdir,
'topobjdir': self.topobjdir,
'mozconfig': mozconfig,
}, fh, sort_keys=True, indent=2)
# Copy the original mozconfig to the objdir.
mozconfig_objdir = os.path.join(self.topobjdir, '.mozconfig')
if mozconfig['path']: