From 10479101fa1868b2224d9a8fb2ee7c644a0529b2 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Thu, 7 Nov 2024 10:01:52 +0100 Subject: [PATCH] asp: fix intel-oneapi-compilers-classic --- lib/spack/spack/solver/asp.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py index fec214a3fad..3fb88a274dd 100644 --- a/lib/spack/spack/solver/asp.py +++ b/lib/spack/spack/solver/asp.py @@ -2977,11 +2977,15 @@ def possible_compilers(*, configuration) -> List["spack.spec.Spec"]: # FIXME (compiler as nodes): Discard early specs that are not marked for this target? if using_libc_compatibility() and not c_compiler_runs(c): - compiler = c.extra_attributes["compilers"]["c"] - tty.debug( - f"the C compiler {compiler} does not exist, or does not run correctly." - f" The compiler {c} will not be used during concretization." - ) + try: + compiler = c.extra_attributes["compilers"]["c"] + tty.debug( + f"the C compiler {compiler} does not exist, or does not run correctly." + f" The compiler {c} will not be used during concretization." + ) + except KeyError: + tty.debug(f"the spec {c} does not provide a C compiler.") + continue if using_libc_compatibility() and not CompilerPropertyDetector(c).default_libc():