Skip to content

Commit 77ae68e

Browse files
committed
[fix] Apply heuristics when diagtool comes with version number
In some environments "diagtool" doesn't exist with this name, but it exists with a name containing version number: "diagtool-14". In this patch we apply some heuristics to try finding diagtool with this extended name, too. Fixes Ericsson#4515
1 parent eb80013 commit 77ae68e

File tree

1 file changed

+6
-0
lines changed
  • analyzer/codechecker_analyzer/analyzers/clangtidy

1 file changed

+6
-0
lines changed

analyzer/codechecker_analyzer/analyzers/clangtidy/analyzer.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,12 @@ def get_diagtool_bin():
154154
if diagtool_bin.exists():
155155
return diagtool_bin
156156

157+
# Sometimes diagtool binary has a version number in its name: diagtool-14.
158+
diagtool_bin = diagtool_bin.with_name('diagtool-' + \
159+
str(ClangSA.version_info().major_version))
160+
if diagtool_bin.exists():
161+
return diagtool_bin
162+
157163
LOG.warning(
158164
"'diagtool' can not be found next to the clang binary (%s)!",
159165
clang_bin)

0 commit comments

Comments
 (0)