spack
spack copied to clipboard
New command, `spack change`, to change existing env specs
If you have an environment like
$ cat spack.yaml
spack:
specs: [[email protected]+cuda]
this PR provides a new command spack change
that you can use to adjust environment specs from the command line:
$ spack change openmpi~cuda
$ cat spack.yaml
spack:
specs: [[email protected]~cuda]
in other words, this allows you to tweak the details of environment specs from the command line.
Notes:
- This is only allowed for environments that do not define matrices
- This is possible but not anticipated to be needed immediately
- If this were done, it should probably only be done for "named"/not-anonymous specs (i.e. we can change
openmpi+cuda
but not spec like+cuda
or@4.0.1~cuda
)
will anybody ever use this though?
will anybody ever use this though?
This was based on an internal request. There are a couple goals with this:
- Make it easier for tools running "on top of" Spack to manipulate data structures within it (without this PR, if you want to change an environment spec you have to manually open/edit the
spack.yaml
, which is fine for users interfacing with Spack directly but not for programs or scripts) - Provide a more-streamlined interface for interacting with Spack (while I personally find it convenient to manually edit the
spack.yaml
, other users may not want to, and it admittedly requires familiarity with yaml and other concepts they may not care about in the moment that they want to change specs).
Right, I think if I would use spack change I would immediately check the resulting yaml file, so there's no time saved
Can it at least be put under spack env
instead in the global set of commands? I'm still thinking it will rarely be used and change
is such a generic command...
Also, I don't think this pr deals with changing say a provider. Or "changing" the flavor of a dependency not listed as root spec. :shrug:
Close/reopen to restart docs build
@tgamblin I have addressed the review comments: I think this is ready for another look.