Bug 1411081 - Write old-configure.vars more deterministically; r?glandium
To facilitate easier debugging.
MozReview-Commit-ID: 97x9iHxZe3m
--- 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)