diff options
author | Alec Scott <hi@alecbcs.com> | 2024-11-08 03:16:01 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-08 00:16:01 -0800 |
commit | ff26d2f8331c900123f6659f762e0cfa1aba47e2 (patch) | |
tree | 691e04554ce48d50fce2e6134b68493180c243d4 /pyproject.toml | |
parent | ed916ffe6ce9bd6af94cbd4538b06f258a8d766c (diff) | |
download | spack-ff26d2f8331c900123f6659f762e0cfa1aba47e2.tar.gz spack-ff26d2f8331c900123f6659f762e0cfa1aba47e2.tar.bz2 spack-ff26d2f8331c900123f6659f762e0cfa1aba47e2.tar.xz spack-ff26d2f8331c900123f6659f762e0cfa1aba47e2.zip |
`spack env track` command (#41897)
This PR adds a sub-command to `spack env` (`track`) which allows users to add/link
anonymous environments into their installation as named environments. This allows
users to more easily track their installed packages and the environments they're
dependencies of. For example, with the addition of #41731 it's now easier to remove
all packages not required by any environments with,
```
spack gc -bE
```
#### Usage
```
spack env track /path/to/env
==> Linked environment in /path/to/env
==> You can activate this environment with:
==> spack env activate env
```
By default `track /path/to/env` will use the last directory in the path as the name of
the environment. However users may customize the name of the linked environment
with `-n | --name`. Shown below.
```
spack env track /path/to/env --name foo
==> Tracking environment in /path/to/env
==> You can activate this environment with:
==> spack env activate foo
```
When removing a linked environment, Spack will remove the link to the environment
but will keep the structure of the environment within the directory. This will allow
users to remove a linked environment from their installation without deleting it from
a shared repository.
There is a `spack env untrack` command that can be used to *only* untrack a tracked
environment -- it will fail if it is used on a managed environment. Users can also use
`spack env remove` to untrack an environment.
This allows users to continue to share environments in git repositories while also having
the dependencies of those environments be remembered by Spack.
---------
Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
Diffstat (limited to 'pyproject.toml')
0 files changed, 0 insertions, 0 deletions