Improve reporting when bootstrapping from source

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
This commit is contained in:
Massimiliano Culpo 2024-10-23 17:14:31 +02:00
parent d3a7a73a00
commit 55196252dd
No known key found for this signature in database
GPG Key ID: 3E52BB992233066C
3 changed files with 10 additions and 10 deletions

View File

@ -996,11 +996,8 @@ def _receive_forwarded(self, context: str, exc: Exception, tb: List[str]):
def grouped_message(self, with_tracebacks: bool = True) -> str:
"""Print out an error message coalescing all the forwarded errors."""
each_exception_message = [
"{0} raised {1}: {2}{3}".format(
context,
exc.__class__.__name__,
exc,
"\n{0}".format("".join(tb)) if with_tracebacks else "",
"\n\t{0} raised {1}: {2}\n{3}".format(
context, exc.__class__.__name__, exc, f"\n{''.join(tb)}" if with_tracebacks else ""
)
for context, exc, tb in self.exceptions
]

View File

@ -62,9 +62,15 @@ def _valid_compiler_or_raise(self):
)
candidates.sort(key=lambda x: x.version, reverse=True)
best = candidates[0]
# FIXME (compiler as nodes): we need to find a better place for setting namespaces
# Get compilers for bootstrapping from the 'builtin' repository
best.namespace = "builtin"
# TODO: check it has C and C++, and supports C++14
# If the compiler does not support C++ 14, fail with a legible error message
try:
_ = best.package.standard_flag(language="cxx", standard="14")
except RuntimeError as e:
raise RuntimeError(
"cannot find a compiler supporting C++ 14 [needed to bootstrap clingo]"
) from e
return candidates[0]
def _externals_from_yaml(

View File

@ -5221,9 +5221,6 @@ class DuplicateCompilerSpecError(spack.error.SpecError):
class UnsupportedCompilerError(spack.error.SpecError):
"""Raised when the user asks for a compiler spack doesn't know about."""
def __init__(self, compiler_name):
super().__init__("The '%s' compiler is not yet supported." % compiler_name)
class DuplicateArchitectureError(spack.error.SpecError):
"""Raised when the same architecture occurs in a spec twice."""