Bug 1419556 - Expand list of supported compilation dirs in the tup backend; r?Build draft
authorMike Shal <mshal@mozilla.com>
Tue, 21 Nov 2017 09:30:15 -0500
changeset 701582 d334b0cb1a4fe086440a770bd7fac19f11afe620
parent 701581 e41fde6efc00987e1bd0fe6d20fcf828047e742b
child 741207 89719f9299aa307f5172ce89b374e8f3423872a5
push id90205
push userbmo:mshal@mozilla.com
push dateTue, 21 Nov 2017 21:29:55 +0000
reviewersBuild
bugs1419556
milestone59.0a1
Bug 1419556 - Expand list of supported compilation dirs in the tup backend; r?Build This combines and expands the list of directories where compilation currently works in tup, going backwards through the alphabet. Not all of these directories actually contain compileable code, but this makes it obvious which top-level directories are not yet enabled. It is likely that other directories will compile successfully as well - this is simply a staging point. MozReview-Commit-ID: Arsk9Oq5XTV
python/mozbuild/mozbuild/backend/tup.py
--- a/python/mozbuild/mozbuild/backend/tup.py
+++ b/python/mozbuild/mozbuild/backend/tup.py
@@ -158,16 +158,32 @@ class BackendTupfile(object):
 
 class TupOnly(CommonBackend, PartialBackend):
     """Backend that generates Tupfiles for the tup build system.
     """
 
     def _init(self):
         CommonBackend._init(self)
 
+        self._supported_dirs = (
+            'services',
+            'servo',
+            'startupcache',
+            'storage',
+            'taskcluster',
+            'testing',
+            'third_party',
+            'toolkit',
+            'tools',
+            'uriloader',
+            'view',
+            'widget',
+            'xpcom',
+            'xpfe',
+        )
         self._backend_files = {}
         self._cmd = MozbuildObject.from_environment()
         self._manifest_entries = OrderedDefaultDict(set)
         self._compile_env_gen_files = (
             '*.c',
             '*.cpp',
             '*.h',
             '*.inc',
@@ -252,17 +268,17 @@ class TupOnly(CommonBackend, PartialBack
             self._process_final_target_pp_files(obj, backend_file)
         elif isinstance(obj, JARManifest):
             self._consume_jar_manifest(obj)
         elif isinstance(obj, PerSourceFlag):
             backend_file.per_source_flags[obj.file_name].extend(obj.flags)
         elif isinstance(obj, ComputedFlags):
             self._process_computed_flags(obj, backend_file)
         elif isinstance(obj, (Sources, GeneratedSources)):
-            if obj.relobjdir.startswith('xpcom'):
+            if obj.relobjdir.startswith(self._supported_dirs):
                 backend_file.sources[obj.canonical_suffix].extend(obj.files)
 
         return True
 
     def consume_finished(self):
         CommonBackend.consume_finished(self)
 
         # The approach here is similar to fastermake.py, but we
@@ -428,17 +444,17 @@ class TupOnly(CommonBackend, PartialBack
                                  destdir=mozpath.join(self.environment.topobjdir, obj.install_target, path))
 
     def _process_computed_flags(self, obj, backend_file):
         for var, flags in obj.get_flags():
             backend_file.local_flags[var] = flags
 
     def _process_unified_sources(self, obj):
         backend_file = self._get_backend_file_for(obj)
-        if obj.relobjdir.startswith('xpcom'):
+        if obj.relobjdir.startswith(self._supported_dirs):
             files = [f[0] for f in obj.unified_source_mapping]
             backend_file.sources[obj.canonical_suffix].extend(files)
 
     def _handle_idl_manager(self, manager):
         if self.environment.is_artifact_build:
             return
 
         dist_idl_backend_file = self._get_backend_file('dist/idl')