Bug 902825 - Add some hacks to avoid rebuilding world draft
authorMike Shal <mshal@mozilla.com>
Tue, 18 Apr 2017 09:54:48 -0400
changeset 568938 d4a2b2686a0647fc9b9ca578f2a67030e7a00f86
parent 568937 280955688428c01fd3f24970a34eb11d007688cb
child 568939 8cea32434901d5d5d9878963526c8bb2573b88e7
push id56025
push userbmo:mshal@mozilla.com
push dateWed, 26 Apr 2017 19:06:07 +0000
bugs902825
milestone55.0a1
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
python/mozbuild/mozbuild/backend/configenvironment.py
--- 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: