Bug 1411081 - Write old-configure.vars more deterministically; r?glandium draft
authorGregory Szorc <gps@mozilla.com>
Tue, 24 Oct 2017 14:00:44 -0700
changeset 685627 e31ae80a01b120c7106bd3e2dc517010cb553bca
parent 685626 22ecbf738ed189397408f3a192e214ccb5d36e5e
child 685628 5711b5c7abdb48bb14f03fc46fe52d8825ff63be
push id86007
push usergszorc@mozilla.com
push dateTue, 24 Oct 2017 23:50:58 +0000
reviewersglandium
bugs1411081
milestone58.0a1
Bug 1411081 - Write old-configure.vars more deterministically; r?glandium To facilitate easier debugging. MozReview-Commit-ID: 97x9iHxZe3m
build/moz.configure/old.configure
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -61,16 +61,17 @@ def autoconf(mozconfig, autoconf):
 
 set_config('AUTOCONF', autoconf)
 
 
 @depends('OLD_CONFIGURE', mozconfig, autoconf, check_build_environment, shell,
          old_configure_assignments, build_project)
 @imports(_from='__builtin__', _import='open')
 @imports(_from='__builtin__', _import='print')
+@imports(_from='__builtin__', _import='sorted')
 @imports('glob')
 @imports('itertools')
 @imports('subprocess')
 # Import getmtime without overwriting the sandbox os.path.
 @imports(_from='os.path', _import='getmtime')
 @imports(_from='os.path', _import='exists')
 @imports(_from='mozbuild.shellutil', _import='quote')
 def prepare_configure(old_configure, mozconfig, autoconf, build_env, shell,
@@ -121,22 +122,22 @@ def prepare_configure(old_configure, moz
     with encoded_open('old-configure.vars', 'w') as out:
         log.debug('Injecting the following to old-configure:')
 
         def inject(command):
             print(command, file=out) # noqa Python 2vs3
             log.debug('| %s', command)
 
         if mozconfig['path']:
-            for key, value in mozconfig['vars']['added'].items():
+            for key, value in sorted(mozconfig['vars']['added'].items()):
                 inject("%s=%s" % (key, quote(value)))
-            for key, (old, value) in mozconfig['vars']['modified'].items():
+            for key, (old, value) in sorted(mozconfig['vars']['modified'].items()):
                 inject("%s=%s" % (key, quote(value)))
             for t in ('env', 'vars'):
-                for key in mozconfig[t]['removed'].keys():
+                for key in sorted(mozconfig[t]['removed'].keys()):
                     inject("unset %s" % key)
 
         # Autoconf is special, because it might be passed from
         # mozconfig['make_extra'], which we don't pass automatically above.
         inject('export AUTOCONF=%s' % quote(autoconf))
 
         for assignment in old_configure_assignments:
             inject(assignment)