spec.py: remove exceptions of old concretizer (#50018)

This commit is contained in:
Harmen Stoppels 2025-04-11 15:52:11 +02:00 committed by GitHub
parent e70d7d4eb7
commit fd31f7e014
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -111,22 +111,14 @@
__all__ = [ __all__ = [
"CompilerSpec", "CompilerSpec",
"Spec", "Spec",
"SpecParseError",
"UnsupportedPropagationError", "UnsupportedPropagationError",
"DuplicateDependencyError", "DuplicateDependencyError",
"DuplicateCompilerSpecError",
"UnsupportedCompilerError", "UnsupportedCompilerError",
"DuplicateArchitectureError", "DuplicateArchitectureError",
"InconsistentSpecError",
"InvalidDependencyError", "InvalidDependencyError",
"NoProviderError",
"MultipleProviderError",
"UnsatisfiableSpecNameError", "UnsatisfiableSpecNameError",
"UnsatisfiableVersionSpecError", "UnsatisfiableVersionSpecError",
"UnsatisfiableCompilerSpecError",
"UnsatisfiableCompilerFlagSpecError",
"UnsatisfiableArchitectureSpecError", "UnsatisfiableArchitectureSpecError",
"UnsatisfiableProviderSpecError",
"UnsatisfiableDependencySpecError", "UnsatisfiableDependencySpecError",
"AmbiguousHashError", "AmbiguousHashError",
"InvalidHashError", "InvalidHashError",
@ -5162,25 +5154,6 @@ def eval_conditional(string):
return eval(string, valid_variables) return eval(string, valid_variables)
class SpecParseError(spack.error.SpecError):
"""Wrapper for ParseError for when we're parsing specs."""
def __init__(self, parse_error):
super().__init__(parse_error.message)
self.string = parse_error.string
self.pos = parse_error.pos
@property
def long_message(self):
return "\n".join(
[
" Encountered when parsing spec:",
" %s" % self.string,
" %s^" % (" " * self.pos),
]
)
class InvalidVariantForSpecError(spack.error.SpecError): class InvalidVariantForSpecError(spack.error.SpecError):
"""Raised when an invalid conditional variant is specified.""" """Raised when an invalid conditional variant is specified."""
@ -5198,14 +5171,6 @@ class DuplicateDependencyError(spack.error.SpecError):
"""Raised when the same dependency occurs in a spec twice.""" """Raised when the same dependency occurs in a spec twice."""
class MultipleVersionError(spack.error.SpecError):
"""Raised when version constraints occur in a spec twice."""
class DuplicateCompilerSpecError(spack.error.SpecError):
"""Raised when the same compiler occurs in a spec twice."""
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."""
@ -5214,11 +5179,6 @@ 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."""
class InconsistentSpecError(spack.error.SpecError):
"""Raised when two nodes in the same spec DAG have inconsistent
constraints."""
class InvalidDependencyError(spack.error.SpecError): class InvalidDependencyError(spack.error.SpecError):
"""Raised when a dependency in a spec is not actually a dependency """Raised when a dependency in a spec is not actually a dependency
of the package.""" of the package."""
@ -5230,30 +5190,6 @@ def __init__(self, pkg, deps):
) )
class NoProviderError(spack.error.SpecError):
"""Raised when there is no package that provides a particular
virtual dependency.
"""
def __init__(self, vpkg):
super().__init__("No providers found for virtual package: '%s'" % vpkg)
self.vpkg = vpkg
class MultipleProviderError(spack.error.SpecError):
"""Raised when there is no package that provides a particular
virtual dependency.
"""
def __init__(self, vpkg, providers):
"""Takes the name of the vpkg"""
super().__init__(
"Multiple providers found for '%s': %s" % (vpkg, [str(s) for s in providers])
)
self.vpkg = vpkg
self.providers = providers
class UnsatisfiableSpecNameError(spack.error.UnsatisfiableSpecError): class UnsatisfiableSpecNameError(spack.error.UnsatisfiableSpecError):
"""Raised when two specs aren't even for the same package.""" """Raised when two specs aren't even for the same package."""
@ -5268,20 +5204,6 @@ def __init__(self, provided, required):
super().__init__(provided, required, "version") super().__init__(provided, required, "version")
class UnsatisfiableCompilerSpecError(spack.error.UnsatisfiableSpecError):
"""Raised when a spec compiler conflicts with package constraints."""
def __init__(self, provided, required):
super().__init__(provided, required, "compiler")
class UnsatisfiableCompilerFlagSpecError(spack.error.UnsatisfiableSpecError):
"""Raised when a spec variant conflicts with package constraints."""
def __init__(self, provided, required):
super().__init__(provided, required, "compiler_flags")
class UnsatisfiableArchitectureSpecError(spack.error.UnsatisfiableSpecError): class UnsatisfiableArchitectureSpecError(spack.error.UnsatisfiableSpecError):
"""Raised when a spec architecture conflicts with package constraints.""" """Raised when a spec architecture conflicts with package constraints."""
@ -5289,14 +5211,6 @@ def __init__(self, provided, required):
super().__init__(provided, required, "architecture") super().__init__(provided, required, "architecture")
class UnsatisfiableProviderSpecError(spack.error.UnsatisfiableSpecError):
"""Raised when a provider is supplied but constraints don't match
a vpkg requirement"""
def __init__(self, provided, required):
super().__init__(provided, required, "provider")
# TODO: get rid of this and be more specific about particular incompatible # TODO: get rid of this and be more specific about particular incompatible
# dep constraints # dep constraints
class UnsatisfiableDependencySpecError(spack.error.UnsatisfiableSpecError): class UnsatisfiableDependencySpecError(spack.error.UnsatisfiableSpecError):