Bug 1405602 - add clang-apply-replacements to path used by mach static-analysis. r=sylvestre
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Wed, 04 Oct 2017 17:02:50 +0300
changeset 384912 45f4d7722995e0b24610bbc173a038ec9cb071f9
parent 384911 34e534c39b37775587ab03605f32d1aa7d67df61
child 384913 5b41d7a0fe73b5a545e2cef31a89133a9ff038e5
push id95880
push userarchaeopteryx@coole-files.de
push dateSat, 07 Oct 2017 08:58:44 +0000
treeherdermozilla-inbound@156942799371 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssylvestre
bugs1405602
milestone58.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 1405602 - add clang-apply-replacements to path used by mach static-analysis. r=sylvestre MozReview-Commit-ID: CiJ8sckSXNw
python/mozbuild/mozbuild/mach_commands.py
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -2225,16 +2225,17 @@ class StaticAnalysis(MachCommandBase):
             return rc
 
         python = self.virtualenv_manager.python_path
 
         if checks == '-*':
             checks = self._get_checks()
 
         common_args = ['-clang-tidy-binary', self._clang_tidy_path,
+                       '-clang-apply-replacements-binary', self._clang_apply_replacements,
                        '-checks=%s' % checks,
                        '-extra-arg=-DMOZ_CLANG_PLUGIN']
 
         # Flag header-filter is passed to 'run-clang-tidy' in order to limit
         # the diagnostic messages only to the specified header files.
         # When no value is specified the default value is considered to be the source
         # in order to limit the dianostic message to the source files or folders.
         common_args.append('-header-filter=%s' %
@@ -2393,20 +2394,23 @@ 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_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_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.
                 import shutil
@@ -2463,16 +2467,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_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."""
 
     @Command('vendor', category='misc',