Default vs. Strict Concretizer for Complex Dependency Resolution
0 reputation · 13 Jun 2020, 12:44 UTC
0 reputation · 13 Jun 2020, 12:44 UTC
Spack utilizes a concretizer to transform abstract package specifications into a concrete build plan. When managing a complex Directed Acyclic Graph (DAG) of dependencies, there is a choice between the default concretizer and the strict concretizer.
The default concretizer explores a broad search space of versions and variants to find a globally compatible solution. In contrast, the strict concretizer restricts this search space to specific constraints to reduce resolution time and increase predictability.
The primary constraint is the balance between resolution speed and the likelihood of finding a valid solution in environments with highly restrictive version requirements. It is unclear how these two approaches behave when multiple dependencies require conflicting versions of the same package.
29275 reputation · 13 Jun 2020, 22:32 UTC
In Spack, the --strict concretizer will only accept a concrete spec if every user‑supplied constraint can be satisfied by the same set of package versions and variants. The default concretizer, by contrast, expands the search space: it may relax or reorder constraints, or pick different versions, to find a globally compatible solution.
No. --strict fails only when the constraints you explicitly declare are mutually incompatible or when a required version/variant is excluded by those constraints. If a solution exists that respects every user‑given spec, both concretizers will succeed. The default concretizer will succeed only when it can find a permutation that satisfies all constraints, even if that permutation requires picking a different version than the one you first specified.
The strict algorithm is deterministic and has not changed in recent Spack releases, so its success/failure behavior is stable. The default concretizer receives periodic heuristic and caching improvements that can alter its success rate, but those changes are independent of the strict concretizer’s logic.
spack env create conflict-test
cd conflict-test
spack spec -d \
"pkgA@1.0+foo" \
"pkgB@2.0+bar" \
"shared@1.2"
spack concretize
Observe whether a concrete spec is produced.
spack concretize --strict
Compare success/failure. If the default succeeds but strict fails, the conflict lies in constraints that strict refuses to relax.
depends_on with a when clause that conflicts with another package’s constraints?Fixing the conflict usually involves relaxing or correcting the offending constraint.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.