Bug 1503453 - re-enable static-analysis autotest on win64 platform after migrating to clang-tidy 8. r=sylvestre
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Tue, 14 May 2019 13:00:13 +0000
changeset 532592 2351c4f1d47d75218a1bbf2bcf19b34835428972
parent 532591 baae6f2fe9a7c1b55225ba3cd1291b0c671df185
child 532593 10403a18457999c30bd17f2726805ef5b2df6d95
push id11270
push userrgurzau@mozilla.com
push dateWed, 15 May 2019 15:07:19 +0000
treeherdermozilla-beta@571bc76da583 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssylvestre
bugs1503453
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 1503453 - re-enable static-analysis autotest on win64 platform after migrating to clang-tidy 8. r=sylvestre Also for checker `modernize-avoid-bind` export the respective reliability index from config.yaml Differential Revision: https://phabricator.services.mozilla.com/D30904
python/mozbuild/mozbuild/mach_commands.py
taskcluster/ci/static-analysis-autotest/kind.yml
tools/clang-tidy/test/modernize-avoid-bind.json
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -3048,25 +3048,33 @@ class StaticAnalysis(MachCommandBase):
         Parse clang-tidy output into structured issues
         '''
 
         # Limit clang output parsing to 'Enabled checks:'
         end = re.search(r'^Enabled checks:\n', clang_output, re.MULTILINE)
         if end is not None:
             clang_output = clang_output[:end.start()-1]
 
+        platform, _ = self.platform
+        # Starting with clang 8, for the diagnostic messages we have multiple `LF CR`
+        # in order to be compatiable with msvc compiler format, and for this
+        # we are not interested to match the end of line.
+        regex_string = r'(.+):(\d+):(\d+): (warning|error): ([^\[\]\n]+)(?: \[([\.\w-]+)\])'
+
+        # For non 'win' based platforms we also need the 'end of the line' regex
+        if platform not in ('win64', 'win32'):
+            regex_string += '?$'
+
+        regex_header = re.compile(regex_string, re.MULTILINE)
+
         # Sort headers by positions
-        regex_header = re.compile(
-            r'(.+):(\d+):(\d+): (warning|error): ([^\[\]\n]+)(?: \[([\.\w-]+)\])?$', re.MULTILINE)
-
         headers = sorted(
             regex_header.finditer(clang_output),
             key=lambda h: h.start()
         )
-
         issues = []
         for _, header in enumerate(headers):
             header_group = header.groups()
             element = [header_group[3], header_group[4], header_group[5]]
             issues.append(element)
         return issues
 
     def _get_checks(self):
--- a/taskcluster/ci/static-analysis-autotest/kind.yml
+++ b/taskcluster/ci/static-analysis-autotest/kind.yml
@@ -61,17 +61,16 @@ jobs:
             - linux64-rust
             - linux64-sccache
             - linux64-cbindgen
             - linux64-nasm
             - linux64-node
 
     win64-st-autotest/debug:
         description: "Win64 Debug Static Analysis Autotest"
-        run-on-projects: []  # Don't run by default until bug 1503453 has been fixed.
         index:
             job-name: win64-st-autotest-debug
         treeherder:
             platform: windows2012-64/debug
             tier: 2
         worker-type: b-win2012
         worker:
             env:
--- a/tools/clang-tidy/test/modernize-avoid-bind.json
+++ b/tools/clang-tidy/test/modernize-avoid-bind.json
@@ -1,1 +1,1 @@
-[["warning", "prefer a lambda to std::bind", "modernize-avoid-bind"]]
\ No newline at end of file
+[["warning", "prefer a lambda to std::bind", "modernize-avoid-bind"], {"reliability": "medium"}]
\ No newline at end of file