Bug 902825 - Add some hacks to avoid rebuilding world
Since MOZ_CONFIGURE_OPTIONS changes every time you enable or disable a
configure option, we have to remove that from autoconf.mk in order to
avoid rebuilding the world whenever it changes. This works around the
fact that everything depends on autoconf.mk in the RecursiveMake
backend. We also remove any mozconfig_defines from ALLSUBSTS to avoid
modifying that file for the same reason. It is assumed that anything
moved into the mozconfig_defines world won't need to get anything from
autoconf.mk
MozReview-Commit-ID: 5r8q4yfTeK3
--- a/python/mozbuild/mozbuild/backend/configenvironment.py
+++ b/python/mozbuild/mozbuild/backend/configenvironment.py
@@ -149,18 +149,27 @@ class ConfigEnvironment(object):
shell_quote(self.defines[name]).replace('$', '$$'))
for name in sorted(global_defines)])
def serialize(obj):
if isinstance(obj, StringTypes):
return obj
if isinstance(obj, Iterable):
return ' '.join(obj)
raise Exception('Unhandled type %s', type(obj))
+ # We avoid mozconfig_defines in ALLSUBSTS so that autoconf.mk isn't
+ # modified when a configure option is changed, since everything has a
+ # dependency on autoconf.mk in the RecursiveMake backend. For the same
+ # reasons, we don't include MOZ_CONFIGURE_OPTIONS in ALLSUBSTS, since
+ # that naturally always changes when configure options change. Things
+ # that use MOZ_CONFIGURE_OPTIONS don't get it from ALLSUBSTS, so it
+ # isn't actually needed here.
self.substs['ALLSUBSTS'] = '\n'.join(sorted(['%s = %s' % (name,
- serialize(self.substs[name])) for name in self.substs if self.substs[name]]))
+ serialize(self.substs[name])) for name in self.substs if self.substs[name] and
+ name not in self.mozconfig_defines and
+ name != 'MOZ_CONFIGURE_OPTIONS']))
self.substs['ALLEMPTYSUBSTS'] = '\n'.join(sorted(['%s =' % name
for name in self.substs if not self.substs[name]]))
self.substs = ReadOnlyDict(self.substs)
self.external_source_dir = None
external = self.substs.get('EXTERNAL_SOURCE_DIR', '')
if external: