Skip to content

spack prints spec that is not reusable ( CMakePackage + ~variant ) #15362

@adrienbernede

Description

@adrienbernede

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
[email protected]%[email protected] build_type=RelWithDebInfo ~mpi arch=darwin-mojave-x86_64
...
$ spack spec [email protected]%[email protected] 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 ~.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingradiusstriageThe issue needs to be prioritizedvariants

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions