mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
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 --HG-- extra : rebase_source : ee1defd74decfd64ffb66a45b053dada58de04fb
This commit is contained in:
parent
f269a93370
commit
214be74c6c
11
client.mk
11
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
|
||||
|
@ -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']:
|
||||
|
Loading…
Reference in New Issue
Block a user