Bug 1416052 - Move export of FOUND_MOZCONFIG to Python; r=nalexander
This should have the same net result.
TBH, I'm not 100% convinced we need this export. It is only needed
to send variables to sub-makes. And the only make file reading
FOUND_MOZCONFIG is client.mk. Since the code that evals the
auto-generated make file is always executed in client.mk, we
shouldn't need this export.
All this code is going away soon anyway. So I'm inclined to cargo
cult this just in case.
MozReview-Commit-ID: DqF1BU702A
--- a/client.mk
+++ b/client.mk
@@ -47,18 +47,16 @@ endef
# As $(shell) doesn't preserve newlines, use sed to replace them with an
# unlikely sequence (||), which is then replaced back to newlines by make
# before evaluation. $(shell) replacing newlines with spaces, || is always
# followed by a space (since sed doesn't remove newlines), except on the
# last line, so replace both '|| ' and '||'.
MOZCONFIG_CONTENT := $(subst ||,$(CR),$(subst || ,$(CR),$(shell cat $(OBJDIR)/.mozconfig-client-mk | sed 's/$$/||/')))
include $(OBJDIR)/.mozconfig-client-mk
-export FOUND_MOZCONFIG
-
# As '||' was used as a newline separator, it means it's not occurring in
# lines themselves. It can thus safely be used to replaces normal spaces,
# to then replace newlines with normal spaces. This allows to get a list
# of mozconfig output lines.
MOZCONFIG_OUT_LINES := $(subst $(CR), ,$(subst $(NULL) $(NULL),||,$(MOZCONFIG_CONTENT)))
# Filter-out comments from those lines.
START_COMMENT = \#
MOZCONFIG_OUT_FILTERED := $(filter-out $(START_COMMENT)%,$(MOZCONFIG_OUT_LINES))
--- a/python/mozbuild/mozbuild/controller/building.py
+++ b/python/mozbuild/mozbuild/controller/building.py
@@ -1334,16 +1334,17 @@ class BuildDriver(MozbuildObject):
if mozconfig['make_flags']:
fh.write(b'MOZ_MAKE_FLAGS=%s\n' % b' '.join(mozconfig['make_flags']))
objdir = mozpath.normsep(self.topobjdir)
fh.write(b'MOZ_OBJDIR=%s\n' % objdir)
fh.write(b'OBJDIR=%s\n' % objdir)
if mozconfig['path']:
fh.write(b'FOUND_MOZCONFIG=%s\n' %
mozpath.normsep(mozconfig['path']))
+ fh.write(b'export FOUND_MOZCONFIG\n')
append_env['OBJDIR'] = mozpath.normsep(self.topobjdir)
return self._run_make(srcdir=True,
filename='client.mk',
allow_parallel=False,
ensure_exit_code=False,
print_directory=False,