Bug 1471425 - Print output of cargo if it fails when run as a part of the Tup backend. r=mshal
authorChris Manchester <cmanchester@mozilla.com>
Tue, 26 Jun 2018 18:17:45 -0700
changeset 423989 d6ed3df9e0d64b2fa7bd153281a59f47bd4e7883
parent 423988 22fd5e86fbf66c6cd182b435029ac2be54c26761
child 423990 93ac072b098daedac96ec44652c6fd441aa4b962
push id34197
push usercsabou@mozilla.com
push dateThu, 28 Jun 2018 09:44:02 +0000
treeherdermozilla-central@db455160668d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1471425
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1471425 - Print output of cargo if it fails when run as a part of the Tup backend. r=mshal 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: