Bug 1260639 - Log more information before starting old-configure. r?ted draft
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 30 Mar 2016 14:30:07 +0900
changeset 345714 ce4f90ebc6b093e9b3bb4b1b3d571ad12d9d4cdd
parent 345713 c71611eb34340bfb6d9ca5337cdadc2525e6176b
child 345754 5c6c2544c5fcc5a54d984cd6472ba01721980260
child 345773 21e33dc15ab2604f650dfce5385bb4d78ed68c5b
child 345774 a21a7ef3d8834e3ba1d87c03ca3ec2ea4920100e
push id14151
push userbmo:mh+mozilla@glandium.org
push dateWed, 30 Mar 2016 05:34:15 +0000
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):