Bug 1417264 - Move printing of mozconfig lines to Python; r=nalexander draft
authorGregory Szorc <gps@mozilla.com>
Mon, 13 Nov 2017 15:35:16 -0800
changeset 699265 308826e948fa20684bbc40c806322f802689627e
parent 699264 5e3c408fdf7f953e9cbac1c4a57fd5fa87f8fbbc
child 699266 87ed98fa62513007c6fdd2df00eb871a5a29a146
push id89518
push userbmo:gps@mozilla.com
push dateThu, 16 Nov 2017 23:00:58 +0000
reviewersnalexander
bugs1417264
milestone59.0a1
Bug 1417264 - Move printing of mozconfig lines to Python; r=nalexander We write the file that client.mk is printing from Python. We can also log it from there pretty easily. So do that. MozReview-Commit-ID: 7eeugdOJR5b
client.mk
python/mozbuild/mozbuild/controller/building.py
--- a/client.mk
+++ b/client.mk
@@ -97,23 +97,16 @@ MOZCONFIG_MK_LINES := $(filter export||%
 $(OBJDIR)/.mozconfig.mk: $(TOPSRCDIR)/client.mk $(FOUND_MOZCONFIG)
 	$(if $(MOZCONFIG_MK_LINES),( $(foreach line,$(MOZCONFIG_MK_LINES), echo '$(subst ||, ,$(line))';) )) > $@
 
 # Include that makefile so that it is created. This should not actually change
 # the environment since MOZCONFIG_CONTENT, which MOZCONFIG_OUT_LINES derives
 # from, has already been eval'ed.
 include $(OBJDIR)/.mozconfig.mk
 
-# Print out any options loaded from mozconfig.
-all build clean distclean export libs install realclean::
-ifneq (,$(strip $(MOZCONFIG_OUT_LINES)))
-	$(info Adding client.mk options from $(FOUND_MOZCONFIG):)
-	$(foreach line,$(MOZCONFIG_OUT_LINES),$(info $(NULL) $(NULL) $(NULL) $(NULL) $(subst ||, ,$(line))))
-endif
-
 # In automation, manage an sccache daemon. The starting of the server
 # needs to be in a make file so sccache inherits the jobserver.
 ifdef MOZBUILD_MANAGE_SCCACHE_DAEMON
 build::
 	# Terminate any sccache server that might still be around.
 	-$(MOZBUILD_MANAGE_SCCACHE_DAEMON) --stop-server > /dev/null 2>&1
 	# Start a new server, ensuring it gets the jobserver file descriptors
 	# from make (but don't use the + prefix when make -n is used, so that
--- a/python/mozbuild/mozbuild/controller/building.py
+++ b/python/mozbuild/mozbuild/controller/building.py
@@ -1353,16 +1353,22 @@ class BuildDriver(MozbuildObject):
                                         mozpath.normsep(mozconfig['path']))
             mozconfig_make_lines.append(b'export FOUND_MOZCONFIG')
 
         mozconfig_client_mk = os.path.join(self.topobjdir,
                                            '.mozconfig-client-mk')
         with FileAvoidWrite(mozconfig_client_mk) as fh:
             fh.write(b'\n'.join(mozconfig_make_lines))
 
+        if mozconfig_make_lines:
+            self.log(logging.WARNING, 'mozconfig_content', {
+                'path': mozconfig['path'],
+                'content': '\n    '.join(mozconfig_make_lines),
+            }, 'Adding make options from {path}\n    {content}')
+
         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,
                               target=target,