Running spack spec for a CMake package where a variant is deactivated, Spack prints a spec that is not reusable:
Spack version
Tested on develop and 13.2
Steps to reproduce the issue
$ spack spec h5cpp~mpi
h5cpp@1.10.4-5%clang@10.0.0-apple build_type=RelWithDebInfo ~mpi arch=darwin-mojave-x86_64
...
$ spack spec h5cpp@1.10.4-5%clang@10.0.0-apple build_type=RelWithDebInfo ~mpi arch=darwin-mojave-x86_64
zsh: no such user or named directory: mpi
...
Error Message
This doesn’t generate an error in Spack itself.
Information on your system
Default Spack configuration on MacOS, with zsh.
Comments
The problem is mainly that Spack generates a spec using ~variant after a whitespace. This seems to happen only with CMake packages, mainly because those have a build_type variant that comes first.
Solutions could be to reorder the variants attache ~variant to the spec, or use - instead of ~.
Running
spack specfor a CMake package where a variant is deactivated, Spack prints a spec that is not reusable:Spack version
Tested on develop and 13.2
Steps to reproduce the issue
Error Message
This doesn’t generate an error in Spack itself.
Information on your system
Default Spack configuration on MacOS, with zsh.
Comments
The problem is mainly that Spack generates a spec using
~variantafter a whitespace. This seems to happen only with CMake packages, mainly because those have abuild_typevariant that comes first.Solutions could be to reorder the variants attache
~variantto the spec, or use-instead of~.