From a1a6388b55438093827900e66a762ca330599b0d Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Wed, 5 Jul 2023 15:27:06 +0100 Subject: [PATCH] lisa._kmod: Fix Alpine clang package name FIX When the user asks for e.g. clang-14, we need to map that to the "clang14" package in Alpine linux. Otherwise, we will simply end up with the "clang" package, which might be e.g. clang-16 --- lisa/_kmod.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lisa/_kmod.py b/lisa/_kmod.py index 90f01172e..384ceab6b 100644 --- a/lisa/_kmod.py +++ b/lisa/_kmod.py @@ -277,11 +277,19 @@ def _make_chroot(cc, make_vars, bind_paths=None, alpine_version='3.18.0', overla is_clang = cc.startswith('clang') if is_clang: + try: + _, version = cc.split('-', 1) + except ValueError: + # apk understands "clang" even if there is no clang package + version = '' + packages.extend([ 'lld', - 'llvm', + f'llvm{version}', + f'clang{version}', ]) - packages.append(cc) + else: + packages.append(cc) target_arch = make_vars.get('ARCH', LISA_HOST_ABI) -- GitLab