Steps to reproduce
TL;DR The approach we adopted since we added stacks to soft-enforce constraints in matrices result in the highly inconsistent behavior below. I think we should get rid of it to:
- Have a more consistent behavior in environments
- Avoid having lockfiles where user specs that don't intersect map to the same concrete spec
The good
If we try to concretize the following spack.yaml:
spack:
specs:
- zlib +shrd
- zlib ~shrd
unify: false
view: false
we get the following error:
$ spack concretize
==> Starting concretization pool with 2 processes
==> Error: trying to set variant "shrd" in package "zlib", but the package has no such variant [happened during concretization of zlib+shrd]
which seems sensible: zlib has in fact no variant shrd.
The bad
If we apply this transformation, which should be equivalent:
spack:
specs:
- matrix:
- [zlib]
- [+shrd, ~shrd]
unify: false
view: false
we get instead:
$ spack concretize -f
==> Starting concretization pool with 2 processes
==> Environment concretized in 3.04 seconds
==> Concretized zlib+shrd
- ctm7p7o [email protected]%[email protected]+optimize+pic+shared build_system=makefile arch=linux-ubuntu20.04-icelake
- 3wudxnw ^[email protected]%[email protected]~guile build_system=generic arch=linux-ubuntu20.04-icelake
==> Concretized zlib~shrd
- ctm7p7o [email protected]%[email protected]+optimize+pic+shared build_system=makefile arch=linux-ubuntu20.04-icelake
- 3wudxnw ^[email protected]%[email protected]~guile build_system=generic arch=linux-ubuntu20.04-icelake
This is utterly confusing: the two specs result in the same concrete spec. The lockfile starts with:
"roots": [
{
"hash": "ctm7p7opscnjqbtptefifmthqm74x2gf",
"spec": "zlib+shrd"
},
{
"hash": "ctm7p7opscnjqbtptefifmthqm74x2gf",
"spec": "zlib~shrd"
}
],
so we effectively map two incompatible user specs to the same concrete spec that does not contain a required variant.
The ugly
Since the concrete spec is the same, one would expect the same behavior for:
spack:
specs:
- matrix:
- [zlib]
- [+shrd, ~shrd]
unify: true
view: false
but this one instead fails with:
$ spack concretize -f
==> Error: trying to set variant "shrd" in package "zlib", but the package has no such variant [happened during concretization of zlib~shrd]
Error message
See cases above. I think that:
- All three cases should error consistently
- We should enforce the requirement in a strict way, and avoid special casing
unify:false + matrices
Information on your system
- Spack: 0.21.0.dev0 (3e51778)
- Python: 3.11.5
- Platform: linux-ubuntu20.04-icelake
- Concretizer: clingo
General information
Steps to reproduce
TL;DR The approach we adopted since we added stacks to soft-enforce constraints in matrices result in the highly inconsistent behavior below. I think we should get rid of it to:
The good
If we try to concretize the following
spack.yaml:we get the following error:
which seems sensible:
zlibhas in fact no variantshrd.The bad
If we apply this transformation, which should be equivalent:
we get instead:
This is utterly confusing: the two specs result in the same concrete spec. The lockfile starts with:
so we effectively map two incompatible user specs to the same concrete spec that does not contain a required variant.
The ugly
Since the concrete spec is the same, one would expect the same behavior for:
but this one instead fails with:
Error message
See cases above. I think that:
unify:false+ matricesInformation on your system
General information
spack debug reportand reported the version of Spack/Python/Platform