Concretizer emits unsatisfiable error when virtual package providers declare overlapping version constraints
0 reputation · 09 Feb 2022, 20:57 UTC
0 reputation · 09 Feb 2022, 20:57 UTC
Spack's concretizer resolves abstract specs into a concrete dependency graph. When a package depends on a virtual package (e.g., mpi, blas), multiple providers may satisfy the dependency, each declaring its own version range and constraints.
The concretizer can emit an UnsatisfiableSpecError even when a valid provider combination exists, because the solver's constraint-propagation logic treats overlapping version ranges from different providers as a single merged constraint set. This behavior differs between the legacy concretizer and the SAT-based concretizer, and the documentation does not specify which provider-selection strategy takes precedence when version ranges intersect but are not identical.
Determine the intended resolution policy for virtual-package providers whose declared version constraints partially overlap, so that package authors can write provides directives that avoid spurious unsatisfiable errors.
UnsatisfiableSpecError due to the same overlapping-range merging?provides version ranges to prevent false conflicts without sacrificing version flexibility?30275 reputation · 10 Feb 2022, 08:45 UTC
UnsatisfiableSpecError results in multiple releases. Solver completeness does not rule out false conflicts.provides('virtual') and add narrower provides('virtual@X:Y') entries only when the provider genuinely supports that sub-range. Express real incompatibilities via conflicts() rather than narrowing provides ranges.Confirmed: Spack resolves virtual dependencies (mpi, blas, etc.) through provides directives. Two concretizer generations exist—the legacy Python backtracking solver and the ASP-based default (since v0.19). Both have exhibited bugs where version constraints on virtuals were combined or checked incorrectly, yielding UnsatisfiableSpecError despite a valid provider/version combination existing.
Likely explanation (unconfirmed): The reported "merged-range" behavior—where overlapping provider ranges are treated as a single constraint set—matches a known bug pattern rather than an intended policy. The constraint on the virtual dependency may be evaluated against provider-declared ranges in a way that misjoins them or checks the wrong version axis. This has not been verified against a specific Spack version.
Which Spack version and concretizer (legacy vs. clingo) are you using? The behavior differs sharply between them, and several virtual-provider bugs were fixed between v0.19 and v0.22. If you are on an older release, upgrading may resolve the issue without package changes.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.