spack/lib/spack
Todd Gamblin 24d12c632c
spack gc: add options for environments and build dependencies (#41731)
This adds a few options to `spack gc`.

One to give you a little more control over dependencies:

* `-b` / `--keep-build-dependencies`: By default, `spack gc` considers build dependencies to be "no longer needed" once their dependents are installed. With this option, we'll keep build dependencies of needed installations as well.

And two more to make working with environments easier:

* `-E` / `--except-any-environment`: Garbage collect anything NOT needed by an environment. `spack gc -E` and `spack gc -bE` are now easy ways to get rid of everytihng not used by some environment.

* `-e` / `--except-environment` `ENV`: Instead of considering all environments, garbage collect everything not needed by a *specific* environment. Note that you can use this with `-E` to add directory environments to the list of considered envs, e.g.:

      spack gc -E -e /path/to/direnv1 -e /path/to/direnv2 #...

- [x] rework `unused_specs()` method on DB to add options for roots and deptypes
- [x] add `all_hashes()` method on DB
- [x] rework `spack gc` command to add 3 more options
- [x] tests
2023-12-26 14:52:10 -08:00
..
docs build(deps): bump mypy from 1.7.1 to 1.8.0 in /lib/spack/docs (#41821) 2023-12-24 06:59:21 -08:00
env cc: Ensure that user-specified flags take precedence over others (#37376) 2023-06-18 14:07:08 -07:00
external archspec: update to v0.2.2 (#40917) 2023-11-07 07:44:52 +01:00
llnl bootstrap: Don't catch Ctrl-C (#41449) 2023-12-06 14:58:14 +01:00
spack spack gc: add options for environments and build dependencies (#41731) 2023-12-26 14:52:10 -08:00
spack_installable Consolidate definition of Spack's extra sys.path components (#41816) 2023-12-21 16:25:12 -08:00