Bug 1414781 - Also install clang-format r?glandium draft
authorSylvestre Ledru <sledru@mozilla.com>
Tue, 07 Nov 2017 11:45:58 +0100
changeset 694110 bfd2c015f82c6c89583d7c290fe42ef4a635330d
parent 694109 98e2b4ee9775a2a2b5cc1bb8a390bfe901814f38
child 703222 32fe1b2884c74be40626bb00daaebb066ee3f30f
child 704728 83b073bec0e97b9e889f9b67bcc08b0e60b71f43
push id88036
push userbmo:sledru@mozilla.com
push dateTue, 07 Nov 2017 10:47:02 +0000
reviewersglandium
bugs1414781
milestone58.0a1
Bug 1414781 - Also install clang-format r?glandium MozReview-Commit-ID: A6Jlc5RXVuP
python/mozbuild/mozbuild/mach_commands.py
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -2397,22 +2397,25 @@ class StaticAnalysis(MachCommandBase):
 
         if rc != 0:
             return rc
 
         clang_tidy_path = mozpath.join(self._mach_context.state_dir,
                                        "clang-tidy")
         self._clang_tidy_path = mozpath.join(clang_tidy_path, "clang", "bin",
                                              "clang-tidy" + config.substs.get('BIN_SUFFIX', ''))
+        self._clang_format_path = mozpath.join(clang_tidy_path, "clang", "bin",
+                                             "clang-format" + config.substs.get('BIN_SUFFIX', ''))
         self._clang_apply_replacements = mozpath.join(clang_tidy_path, "clang", "bin",
                                                       "clang-apply-replacements" + config.substs.get('BIN_SUFFIX', ''))
         self._run_clang_tidy_path = mozpath.join(clang_tidy_path, "clang", "share",
                                                  "clang", "run-clang-tidy.py")
 
         if os.path.exists(self._clang_tidy_path) and \
+           os.path.exists(self._clang_format_path) and \
            os.path.exists(self._clang_apply_replacements) and \
            os.path.exists(self._run_clang_tidy_path) and \
            not force:
             return 0
         else:
             if os.path.isdir(clang_tidy_path) and download_if_needed:
                 # The directory exists, perhaps it's corrupted?  Delete it
                 # and start from scratch.
@@ -2470,16 +2473,17 @@ class StaticAnalysis(MachCommandBase):
 
         clang_path = mozpath.join(clang_tidy_path, 'clang')
 
         if not os.path.isdir(clang_path):
             raise Exception('Extracted the archive but didn\'t find '
                             'the expected output')
 
         assert os.path.exists(self._clang_tidy_path)
+        assert os.path.exists(self._clang_format_path)
         assert os.path.exists(self._clang_apply_replacements)
         assert os.path.exists(self._run_clang_tidy_path)
         return 0
 
 @CommandProvider
 class Vendor(MachCommandBase):
     """Vendor third-party dependencies into the source repository."""