Bug 1471425 - Print output of cargo if it fails when run as a part of the Tup backend.
MozReview-Commit-ID: BRVSLE83WMH
--- a/python/mozbuild/mozbuild/backend/tup.py
+++ b/python/mozbuild/mozbuild/backend/tup.py
@@ -811,17 +811,21 @@ class TupBackend(CommonBackend):
output_lines = []
def accumulate_output(line):
output_lines.append(line)
cargo_status = self._cmd.run_process(
[self.environment.substs['CARGO'], 'build'] + cargo_flags,
line_handler=accumulate_output,
+ ensure_exit_code=False,
explicit_env=cargo_env)
+ if cargo_status:
+ raise Exception("cargo --build-plan failed with output:\n%s" %
+ '\n'.join(output_lines))
cargo_plan = json.loads(''.join(output_lines))
self._gen_cargo_rules(backend_file, cargo_plan, cargo_env)
self.backend_input_files |= set(cargo_plan['inputs'])
def _process_generated_file(self, backend_file, obj):
if obj.script and obj.method: