Bug 1260639 - Log more information before starting old-configure. r=ted
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 30 Mar 2016 14:30:07 +0900
changeset 291158 2e966a1f371c9d2e4bd376202e79ea70b13d800c
parent 291157 9f566ae2f1c5fc9c16969429cf9793c8465fd76d
child 291159 0f5f41c619be9ede89c093a7b465ea45e2c6aa21
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs1260639
milestone48.0a1
Bug 1260639 - Log more information before starting old-configure. r=ted
build/moz.configure/old.configure
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -126,35 +126,40 @@ def prepare_configure(old_configure, moz
         # This could be done with a m4 macro, but it's way easier this way
         script = script.replace('>./config.log', '>>./config.log')
 
         with open(old_configure, 'wb') as fh:
             fh.write(script)
 
     cmd = [shell, old_configure]
     with encoded_open('old-configure.vars', 'w') as out:
+        log.debug('Injecting the following to old-configure:')
+        def inject(command):
+            print(command, file=out)
+            log.debug('| %s', command)
+
         if mozconfig['path']:
             for key, value in mozconfig['env']['added'].items():
-                print("export %s=%s" % (key, quote(value)), file=out)
+                inject("export %s=%s" % (key, quote(value)))
             for key, (old, value) in mozconfig['env']['modified'].items():
-                print("export %s=%s" % (key, quote(value)), file=out)
+                inject("export %s=%s" % (key, quote(value)))
             for key, value in mozconfig['vars']['added'].items():
-                print("%s=%s" % (key, quote(value)), file=out)
+                inject("%s=%s" % (key, quote(value)))
             for key, (old, value) in mozconfig['vars']['modified'].items():
-                print("%s=%s" % (key, quote(value)), file=out)
+                inject("%s=%s" % (key, quote(value)))
             for t in ('env', 'vars'):
                 for key in mozconfig[t]['removed'].keys():
-                    print("unset %s" % key, file=out)
+                    inject("unset %s" % key)
 
         # Autoconf is special, because it might be passed from
         # mozconfig['make_extra'], which we don't pass automatically above.
-        print('export AUTOCONF=%s' % quote(autoconf), file=out)
+        inject('export AUTOCONF=%s' % quote(autoconf))
 
         for assignment in old_configure_assignments:
-            print(assignment, file=out)
+            inject(assignment)
 
     return cmd
 
 
 @template
 def old_configure_options(*options):
     for opt in options:
         option(opt, nargs='*', help='Help missing for old configure options')
@@ -389,17 +394,17 @@ def old_configure(prepare_configure, ext
     # We also pass it the options from js/moz.configure so that it can pass
     # them down to js/src/configure. Note this list is empty when running
     # js/src/configure, in which case we don't need to pass those options
     # to old-configure since old-configure doesn't handle them anyways.
     if extra_old_configure_args:
         cmd += extra_old_configure_args
 
     # For debugging purpose, in case it's not what we'd expect.
-    log.info('running %s', ' '.join(quote(a) for a in cmd))
+    log.debug('Running %s', ' '.join(quote(a) for a in cmd))
 
     # Our logging goes to config.log, the same file old.configure uses.
     # We can't share the handle on the file, so close it. We assume nothing
     # beyond this point is going to be interesting to log to config.log from
     # our end, so we don't make the effort to recreate a logging.FileHandler.
     logger = logging.getLogger('moz.configure')
     for handler in logger.handlers:
         if isinstance(handler, logging.FileHandler):