Bug 1542871 - prevent data loss for clang-format when using incompatible/old clang-format binary. r=sylvestre
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Wed, 10 Apr 2019 09:32:07 +0000
changeset 468770 35e35da9ae0ef007456cb049b6a4973684710601
parent 468769 7fb3acf38591979f105306e0c8f3441e75c95bd5
child 468771 ae91888401d2440827c20fa094a4454344148aac
push id112755
push userdvarga@mozilla.com
push dateWed, 10 Apr 2019 22:06:41 +0000
treeherdermozilla-inbound@606f85641d0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssylvestre
bugs1542871
milestone68.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 1542871 - prevent data loss for clang-format when using incompatible/old clang-format binary. r=sylvestre This issue has been detected and reproduced by :klotz and :jorendorff. Differential Revision: https://phabricator.services.mozilla.com/D26872
python/mozbuild/mozbuild/mach_commands.py
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -3189,18 +3189,18 @@ class StaticAnalysis(MachCommandBase):
         # the .clang-format when it is ran outside of the repo, for example
         # by the extension hg-formatsource
         args = [clang_format, "-assume-filename={}".format(assume_filename[0])]
 
         process = subprocess.Popen(args, stdin=subprocess.PIPE)
         with open(paths[0], 'r') as fin:
             process.stdin.write(fin.read())
             process.stdin.close()
-            process.wait();
-            return 0
+            process.wait()
+            return process.returncode
 
     def _run_clang_format_path(self, clang_format, paths, output_file, output_format):
 
         # Run clang-format on files or directories directly
         from subprocess import check_output, CalledProcessError
 
         if output_format == 'json':
             # Get replacements in xml, then process to json