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
--- 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')