Bug 1461488 - trim tup's display of commands with many outputs; r=chmanchester
Some commands produce a large number of output files, such as
make-system-wrappers.py, which has over 1000 outputs. The GeneratedFile
handler in the tup backend displayed all the outputs, which makes the
build output unreadable, and breaks 'tup graph'. This patch displays
only the first 3 outputs and truncates the rest.
MozReview-Commit-ID: 5AnrmMe0Nyx
--- a/python/mozbuild/mozbuild/backend/tup.py
+++ b/python/mozbuild/mozbuild/backend/tup.py
@@ -648,18 +648,27 @@ class TupBackend(CommonBackend):
if any(f.endswith(('automation.py', 'source-repo.h', 'buildid.h'))
for f in obj.outputs):
extra_outputs = [self._early_generated_files]
else:
extra_outputs = [self._installed_files] if obj.required_for_compile else []
full_inputs += [self._early_generated_files]
+ if len(outputs) > 3:
+ display_outputs = ', '.join(outputs[0:3]) + ', ...'
+ else:
+ display_outputs = ', '.join(outputs)
+ display = 'python {script}:{method} -> [{display_outputs}]'.format(
+ script=obj.script,
+ method=obj.method,
+ display_outputs=display_outputs
+ )
backend_file.rule(
- display='python {script}:{method} -> [%o]'.format(script=obj.script, method=obj.method),
+ display=display,
cmd=cmd,
inputs=full_inputs,
outputs=outputs,
extra_outputs=extra_outputs,
check_unchanged=True,
)
def _process_defines(self, backend_file, obj, host=False):