From 0027b5871cb72f04b7fff34b29a2058089f9e725 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Mon, 24 Feb 2025 14:22:18 +0000 Subject: [PATCH] lisa._kmod: Do not raise if a tested compiler binary does not exist FIX If "clang" binary does not exist, we currently raise a FileNotFoundError exception. Handle that case by eliminating toolchains that trigger this exception when tested. --- lisa/_kmod.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lisa/_kmod.py b/lisa/_kmod.py index a4d0156a0..4915f8ce1 100644 --- a/lisa/_kmod.py +++ b/lisa/_kmod.py @@ -1958,8 +1958,19 @@ class _KernelBuildEnv(Loggable, SerializeViaConstructor): (cc, cross_compile) = item return cc_priority(build_conf['build-env'], cc, cross_compile) + def filter_key(item): + try: + return key(item) + except FileNotFoundError: + return None + ccs = deduplicate(ccs, keep_last=False) - ccs = sorted(ccs, key=key) + sort_key = { + item: _key + for item in ccs + if (_key := filter_key(item)) is not None + } + ccs = sorted(sort_key.keys(), key=sort_key.__getitem__) cc = None cross_compile = None -- GitLab