Bug 1471425 - Print output of cargo if it fails when run as a part of the Tup backend. draft
authorChris Manchester <cmanchester@mozilla.com>
Tue, 26 Jun 2018 18:17:45 -0700
changeset 811162 53398269672a901ce66ea920c91dd2bd46c4e495
parent 810823 348090c6b5c421c67b9dccc48742b54a854d6d0e
child 811163 b7accec9d206a6150ff7400f9c229e000856d043
push id114215
push userbmo:cmanchester@mozilla.com
push dateWed, 27 Jun 2018 03:32:43 +0000
bugs1471425
milestone63.0a1
Bug 1471425 - Print output of cargo if it fails when run as a part of the Tup backend. MozReview-Commit-ID: BRVSLE83WMH
python/mozbuild/mozbuild/backend/tup.py
--- 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: