diff --git a/client.mk b/client.mk index 216b3df2c958c..27db6b93f2d99 100644 --- a/client.mk +++ b/client.mk @@ -141,15 +141,6 @@ configure-preqs = \ $(OBJDIR)/.mozconfig.json \ $(NULL) -CREATE_MOZCONFIG_JSON = $(shell $(TOPSRCDIR)/mach environment --format=json -o $(OBJDIR)/.mozconfig.json) -# Force CREATE_MOZCONFIG_JSON above to be resolved, without side effects in -# case the result is non empty, and allowing an override on the make command -# line not running the command (using := $(shell) still runs the shell command). -ifneq (,$(CREATE_MOZCONFIG_JSON)) -endif - -$(OBJDIR)/.mozconfig.json: ; - configure:: $(configure-preqs) $(call BUILDSTATUS,TIERS configure) $(call BUILDSTATUS,TIER_START configure) @@ -168,7 +159,7 @@ $(OBJDIR)/config.status: $(CONFIG_STATUS_DEPS) else $(OBJDIR)/Makefile: $(CONFIG_STATUS_DEPS) endif - @$(MAKE) -f $(TOPSRCDIR)/client.mk configure CREATE_MOZCONFIG_JSON= + @$(MAKE) -f $(TOPSRCDIR)/client.mk configure #################################### # Build it diff --git a/python/mozbuild/mozbuild/controller/building.py b/python/mozbuild/mozbuild/controller/building.py index bd0d9247d3085..92eb6e69c1218 100644 --- a/python/mozbuild/mozbuild/controller/building.py +++ b/python/mozbuild/mozbuild/controller/building.py @@ -1372,6 +1372,14 @@ def _run_client_mk(self, target=None, line_handler=None, jobs=0, 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']: