group by package

This commit is contained in:
Harmen Stoppels 2025-02-10 10:05:50 +01:00
parent f32a756800
commit 908095e865

View File

@ -1223,6 +1223,7 @@ def _when_conditions_are_satisfiable_by_some_version(pkgs, error_cls):
range = spack.version.VersionRange(
min(pkg_cls.versions), spack.version.StandardVersion.typemax()
)
details = []
for attr in attrs:
if attr == "patches":
# Patches should strictly apply to some known version
@ -1239,12 +1240,14 @@ def _when_conditions_are_satisfiable_by_some_version(pkgs, error_cls):
unsatisfiable = [
when for when in getattr(pkg_cls, attr) if not range.intersects(when.versions)
]
if unsatisfiable:
details.extend(f'when="{x}"' for x in unsatisfiable)
if details:
errors.append(
error_cls(
summary=f"{filename}: `{attr}` when conditions are not satisfiable by "
f"any known version of {pkg_cls.name}",
details=[f'when="{x}"' for x in unsatisfiable],
details=details,
)
)