Bug 1416052 - Move export of FOUND_MOZCONFIG to Python; r=nalexander
authorGregory Szorc <gps@mozilla.com>
Thu, 09 Nov 2017 22:23:14 -0800
changeset 443568 45d15eccf5504583d23b680c1ebbc4965ea6f314
parent 443567 67c03dc70bfd5d2d3df5986d64240494f4624d55
child 443569 1cd169ff8a0dbb2ea7d50b4275472ca9298765b3
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1416052
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
client.mk
python/mozbuild/mozbuild/controller/building.py
--- 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,