Improve reporting when bootstrapping from source
Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
This commit is contained in:
parent
d3a7a73a00
commit
55196252dd
@ -996,11 +996,8 @@ def _receive_forwarded(self, context: str, exc: Exception, tb: List[str]):
|
|||||||
def grouped_message(self, with_tracebacks: bool = True) -> str:
|
def grouped_message(self, with_tracebacks: bool = True) -> str:
|
||||||
"""Print out an error message coalescing all the forwarded errors."""
|
"""Print out an error message coalescing all the forwarded errors."""
|
||||||
each_exception_message = [
|
each_exception_message = [
|
||||||
"{0} raised {1}: {2}{3}".format(
|
"\n\t{0} raised {1}: {2}\n{3}".format(
|
||||||
context,
|
context, exc.__class__.__name__, exc, f"\n{''.join(tb)}" if with_tracebacks else ""
|
||||||
exc.__class__.__name__,
|
|
||||||
exc,
|
|
||||||
"\n{0}".format("".join(tb)) if with_tracebacks else "",
|
|
||||||
)
|
)
|
||||||
for context, exc, tb in self.exceptions
|
for context, exc, tb in self.exceptions
|
||||||
]
|
]
|
||||||
|
@ -62,9 +62,15 @@ def _valid_compiler_or_raise(self):
|
|||||||
)
|
)
|
||||||
candidates.sort(key=lambda x: x.version, reverse=True)
|
candidates.sort(key=lambda x: x.version, reverse=True)
|
||||||
best = candidates[0]
|
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"
|
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]
|
return candidates[0]
|
||||||
|
|
||||||
def _externals_from_yaml(
|
def _externals_from_yaml(
|
||||||
|
@ -5221,9 +5221,6 @@ class DuplicateCompilerSpecError(spack.error.SpecError):
|
|||||||
class UnsupportedCompilerError(spack.error.SpecError):
|
class UnsupportedCompilerError(spack.error.SpecError):
|
||||||
"""Raised when the user asks for a compiler spack doesn't know about."""
|
"""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):
|
class DuplicateArchitectureError(spack.error.SpecError):
|
||||||
"""Raised when the same architecture occurs in a spec twice."""
|
"""Raised when the same architecture occurs in a spec twice."""
|
||||||
|
Loading…
Reference in New Issue
Block a user