--- a/python/mozbuild/mozbuild/backend/tup.py
+++ b/python/mozbuild/mozbuild/backend/tup.py
@@ -77,32 +77,45 @@ class BackendTupfile(object):
self.sources = defaultdict(list)
self.host_sources = defaultdict(list)
self.variables = {}
self.static_lib = None
self.shared_lib = None
self.program = None
self.exports = set()
+ # These files are special, ignore anything that generates them or
+ # depends on them.
+ self._skip_files = [
+ 'signmar',
+ 'libxul.so',
+ 'libtestcrasher.so',
+ ]
+
self.fh = FileAvoidWrite(self.name, capture_diff=True, dry_run=dry_run)
self.fh.write('# THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT.\n')
self.fh.write('\n')
def write(self, buf):
self.fh.write(buf)
def include_rules(self):
if not self.rules_included:
self.write('include_rules\n')
self.rules_included = True
def rule(self, cmd, inputs=None, outputs=None, display=None,
extra_inputs=None, extra_outputs=None, check_unchanged=False):
inputs = inputs or []
outputs = outputs or []
+
+ for f in inputs + outputs:
+ if any(f.endswith(skip_file) for skip_file in self._skip_files):
+ return
+
display = display or ""
self.include_rules()
flags = ""
if check_unchanged:
# This flag causes tup to compare the outputs with the previous run
# of the command, and skip the rest of the DAG for any that are the
# same.
flags += "o"
@@ -278,19 +291,16 @@ class TupBackend(CommonBackend):
return cmd
def _lib_paths(self, objdir, libs):
return [mozpath.relpath(mozpath.join(l.objdir, l.import_name), objdir)
for l in libs]
def _gen_shared_library(self, backend_file):
shlib = backend_file.shared_lib
- if shlib.name == 'libxul.so':
- # This will fail to link currently due to missing rust symbols.
- return
if shlib.cxx_link:
mkshlib = (
[backend_file.environment.substs['CXX']] +
backend_file.local_flags['CXX_LDFLAGS']
)
else:
mkshlib = (
@@ -308,19 +318,16 @@ class TupBackend(CommonBackend):
objs, _, shared_libs, os_libs, static_libs = self._expand_libs(shlib)
static_libs = self._lib_paths(backend_file.objdir, static_libs)
shared_libs = self._lib_paths(backend_file.objdir, shared_libs)
list_file_name = '%s.list' % shlib.name.replace('.', '_')
list_file = self._make_list_file(backend_file.objdir, objs, list_file_name)
inputs = objs + static_libs + shared_libs
- if any(i.endswith('libxul.so') for i in inputs):
- # Don't attempt to link anything that depends on libxul.
- return
symbols_file = []
if shlib.symbols_file:
inputs.append(shlib.symbols_file)
# TODO: Assumes GNU LD
symbols_file = ['-Wl,--version-script,%s' % shlib.symbols_file]
cmd = (
@@ -348,19 +355,16 @@ class TupBackend(CommonBackend):
def _gen_program(self, backend_file):
cc_or_cxx = 'CXX' if backend_file.program.cxx_link else 'CC'
objs, _, shared_libs, os_libs, static_libs = self._expand_libs(backend_file.program)
static_libs = self._lib_paths(backend_file.objdir, static_libs)
shared_libs = self._lib_paths(backend_file.objdir, shared_libs)
inputs = objs + static_libs + shared_libs
- if any(i.endswith('libxul.so') for i in inputs):
- # Don't attempt to link anything that depends on libxul.
- return
list_file_name = '%s.list' % backend_file.program.name.replace('.', '_')
list_file = self._make_list_file(backend_file.objdir, objs, list_file_name)
outputs = [mozpath.relpath(backend_file.program.output_path.full_path,
backend_file.objdir)]
cmd = (
[backend_file.environment.substs[cc_or_cxx], '-o', '%o'] +