Skip to content

Commit e5a8bd2

Browse files
authored
pick the clang version in question from the envirnoment (#621)
* pick the clang version in question from the envirnoment * add alternative locations to search * add alternative locations to search
1 parent d926d79 commit e5a8bd2

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Diff for: jenkins/helper/aggregate_coverage.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@
2222

2323
from site_config import SiteConfig
2424

25+
LLVM_COV = Path(f"/usr/lib/llvm-{os.environ['CLANG_VERSION']}/bin/llvm-cov")
26+
if not LLVM_COV.exists():
27+
LLVM_COV = Path("/usr/lib/llvm/bin/llvm-cov")
28+
LLVM_PROFDATA = Path(f"/usr/lib/llvm-{os.environ['CLANG_VERSION']}/bin/llvm-profdata")
29+
if not LLVM_PROFDATA.exists():
30+
LLVM_PROFDATA = Path("/usr/lib/llvm/bin/llvm-profdata")
31+
2532
SUCCESS = True
2633

2734
# pylint disable=global-variable-not-assigned disable=global-statement
@@ -38,7 +45,7 @@ def launch(self, coverage_file, lcov_file):
3845
# pylint: disable=R0913 disable=R0902 disable=broad-except
3946
""" gcov merger """
4047
verbose = True
41-
binary = "/usr/lib/llvm-16/bin/llvm-cov"
48+
binary = str(LLVM_COV)
4249
self.job_parameters = [
4350
'export',
4451
'-format=lcov',
@@ -144,9 +151,9 @@ def post_process_launch(self, process):
144151
def launch(self):
145152
# pylint: disable=R0913 disable=R0902 disable=broad-except
146153
""" gcov merger """
147-
binary = "/usr/lib/llvm-16/bin/llvm-profdata"
148154
verbose = False
149155
self.params = make_default_params(verbose, 111)
156+
binary = str(LLVM_PROFDATA)
150157
print([binary] + self.job_parameters)
151158
start = datetime.now()
152159
ret = {"rc_exit": 3333}

0 commit comments

Comments
 (0)