Consolidate concretization output for environments#44489
Conversation
|
I like this 👍 much more compact. The thing that's lost is associating abstract with concrete spec, I wonder if people rely on that. |
|
I feel like in the For non-environment |
|
This reminds me that another place we should be concretizing together and displaying together is when people provide multiple specs on the |
|
Ok looking at that I think it's a separate PR -- there is some additional consolidation that needs to happen to merge all the ways we currently invoke |
alecbcs
left a comment
There was a problem hiding this comment.
Looks good to me. Unifying the ways in which we print spec trees will be great, but I agree that can be done in a follow up PR without blocking this work
|
@kennyweiss FYI |
When Spack concretizes environments, it prints every (newly concretized) root spec
individually with all of its dependencies. For most reasonably sized environments, this
is too much output. This is true for three commands:
* `spack concretize` when concretizing an environment with newly added specs
* `spack install` when installing an environment with newly added specs
* `spack spec` with no arguments in an environment
The output dates back to before we had unified environments or nicer spec traversal
routines, and we can improve it.
This PR makes environment concretization output analogous to what we do for regular
specs. Just like `spack spec` for a single spec, we show all root specs with no
indentation, so you can easily see the specs you explicitly requested. Dependencies are
shown:
1. With indentation according to their depth in a breadth-first traversal starting at
the roots;
2. Only once if they appear on paths from multiple roots
So, the default is now consistent with `spack spec` for one spec--it's `--cover=nodes`.
i.e., if there are 100 specs in your environment, you'll get 100 lines of output.
If you want to see more details, you can do that with `spack spec` using the arguments
you're already familiar with. For example, if you wanted to see dependency types and
*all* dependencies, you could use `spack spec -l --cover=edges`. Or you could add
deptypes and namespaces with, e.g. `spack spec -ltN`.
With no arguments in an environment, `spack spec` concretizes (if necessary) and shows
the concretized environment. If you run `spack concretize` *first*, inspecting the
environment repeatedly with `spack spec` will be fast, as everything is already in the
`spack.lock` file.
- [x] factor most logic of `Spec.tree()` out of `Spec` class into `spack.spec.tree()`,
which can take multiple specs as roots.
- [x] make `Spec.tree()` call `spack.spec.tree()`
- [x] `spack.environment.display_specs()` now uses `spack.spec.tree()`
- [x] Update `spack concretize`
- [x] Update `spack install`
- [x] Update `spack spec` to call `spack.spec.tree()` for environments.
- [x] Continue to output specs individually for `spack spec` when using
`--yaml` or `--json`
f14fc4f to
d9d7d9d
Compare
scheibelp
left a comment
There was a problem hiding this comment.
Overall this seems good. There appears to be a couple spots with minor inconsistencies/redundancies, but not something that should hold up the PR IMO.
| elif required_format == "json": | ||
| sys.stdout.write(spec.to_json(hash=ht.dag_hash)) | ||
| else: | ||
| sys.stdout.write(spack.spec.tree(result.specs, color=sys.stdout.isatty(), **kwargs)) |
There was a problem hiding this comment.
(minor) It seems like this could be consolidated into a function that replaces this and lines 108-129 of cmd/spec.py.
|
There is some discussion on refactoring at |
When Spack concretizes environments, it prints every (newly concretized) root spec
individually with all of its dependencies. For most reasonably sized environments, this
is too much output. This is true for three commands:
* `spack concretize` when concretizing an environment with newly added specs
* `spack install` when installing an environment with newly added specs
* `spack spec` with no arguments in an environment
The output dates back to before we had unified environments or nicer spec traversal
routines, and we can improve it.
This PR makes environment concretization output analogous to what we do for regular
specs. Just like `spack spec` for a single spec, we show all root specs with no
indentation, so you can easily see the specs you explicitly requested. Dependencies are
shown:
1. With indentation according to their depth in a breadth-first traversal starting at
the roots;
2. Only once if they appear on paths from multiple roots
So, the default is now consistent with `spack spec` for one spec--it's `--cover=nodes`.
i.e., if there are 100 specs in your environment, you'll get 100 lines of output.
If you want to see more details, you can do that with `spack spec` using the arguments
you're already familiar with. For example, if you wanted to see dependency types and
*all* dependencies, you could use `spack spec -l --cover=edges`. Or you could add
deptypes and namespaces with, e.g. `spack spec -ltN`.
With no arguments in an environment, `spack spec` concretizes (if necessary) and shows
the concretized environment. If you run `spack concretize` *first*, inspecting the
environment repeatedly with `spack spec` will be fast, as everything is already in the
`spack.lock` file.
- [x] factor most logic of `Spec.tree()` out of `Spec` class into `spack.spec.tree()`,
which can take multiple specs as roots.
- [x] make `Spec.tree()` call `spack.spec.tree()`
- [x] `spack.environment.display_specs()` now uses `spack.spec.tree()`
- [x] Update `spack concretize`
- [x] Update `spack install`
- [x] Update `spack spec` to call `spack.spec.tree()` for environments.
- [x] Continue to output specs individually for `spack spec` when using
`--yaml` or `--json`
When Spack concretizes environments, it prints every (newly concretized) root spec
individually with all of its dependencies. For most reasonably sized environments, this
is too much output. This is true for three commands:
* `spack concretize` when concretizing an environment with newly added specs
* `spack install` when installing an environment with newly added specs
* `spack spec` with no arguments in an environment
The output dates back to before we had unified environments or nicer spec traversal
routines, and we can improve it.
This PR makes environment concretization output analogous to what we do for regular
specs. Just like `spack spec` for a single spec, we show all root specs with no
indentation, so you can easily see the specs you explicitly requested. Dependencies are
shown:
1. With indentation according to their depth in a breadth-first traversal starting at
the roots;
2. Only once if they appear on paths from multiple roots
So, the default is now consistent with `spack spec` for one spec--it's `--cover=nodes`.
i.e., if there are 100 specs in your environment, you'll get 100 lines of output.
If you want to see more details, you can do that with `spack spec` using the arguments
you're already familiar with. For example, if you wanted to see dependency types and
*all* dependencies, you could use `spack spec -l --cover=edges`. Or you could add
deptypes and namespaces with, e.g. `spack spec -ltN`.
With no arguments in an environment, `spack spec` concretizes (if necessary) and shows
the concretized environment. If you run `spack concretize` *first*, inspecting the
environment repeatedly with `spack spec` will be fast, as everything is already in the
`spack.lock` file.
- [x] factor most logic of `Spec.tree()` out of `Spec` class into `spack.spec.tree()`,
which can take multiple specs as roots.
- [x] make `Spec.tree()` call `spack.spec.tree()`
- [x] `spack.environment.display_specs()` now uses `spack.spec.tree()`
- [x] Update `spack concretize`
- [x] Update `spack install`
- [x] Update `spack spec` to call `spack.spec.tree()` for environments.
- [x] Continue to output specs individually for `spack spec` when using
`--yaml` or `--json`
`spack spec` output has looked like this for a while: ```console > spack spec /v5fn6xo /wd2p2v7 Input spec -------------------------------- - /v5fn6xo Concretized -------------------------------- [+] [email protected]%[email protected]~docs+shared build_system=generic certs=mozilla arch=darwin-sequoia-m1 [+] ^ca-certificates-mozilla@2023-05-30%[email protected] build_system=generic arch=darwin-sequoia-m1 ... Input spec -------------------------------- - /wd2p2v7 Concretized -------------------------------- [+] [email protected]%[email protected] build_system=python_pip arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=generic arch=darwin-sequoia-m1 ``` But the input spec is right there on the CLI, and it doesn't add anything to the output. Also, since #44843, specs concretized in the CLI line can be unified, so it makes sense to display them as we did in #44489 -- as one multi-root tree instead of as multiple single-root trees. With this PR, concretize output now looks like this: ```console > spack spec /v5fn6xo /wd2p2v7 [+] [email protected]%[email protected]~docs+shared build_system=generic certs=mozilla arch=darwin-sequoia-m1 [+] ^ca-certificates-mozilla@2023-05-30%[email protected] build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]~guile build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]+cpanm+opcode+open+shared+threads build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]+cxx~docs+stl build_system=autotools patches=26090f4,b231fcc arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]~debug~pic+shared build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools libs=shared,static arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools patches=bbf97f1 arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]~symlinks+termlib abi=none build_system=autotools patches=7a351bc arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]+compat+new_strategies+opt+pic+shared build_system=autotools arch=darwin-sequoia-m1 [+] ^gnuconfig@2022-09-17%[email protected] build_system=generic arch=darwin-sequoia-m1 [+] [email protected]%[email protected] build_system=python_pip arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=generic arch=darwin-sequoia-m1 [-] ^[email protected]%[email protected] build_system=generic arch=darwin-sequoia-m1 ``` With no input spec displayed -- just the concretization output shown as one consolidated tree and multiple roots. - [x] remove "Input Spec" section and "Concretized" header from `spack spec` output - [x] print concretized specs as one BFS tree instead of multiple Signed-off-by: Todd Gamblin <[email protected]>
`spack spec` output has looked like this for a while: ```console > spack spec /v5fn6xo /wd2p2v7 Input spec -------------------------------- - /v5fn6xo Concretized -------------------------------- [+] [email protected]%[email protected]~docs+shared build_system=generic certs=mozilla arch=darwin-sequoia-m1 [+] ^ca-certificates-mozilla@2023-05-30%[email protected] build_system=generic arch=darwin-sequoia-m1 ... Input spec -------------------------------- - /wd2p2v7 Concretized -------------------------------- [+] [email protected]%[email protected] build_system=python_pip arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=generic arch=darwin-sequoia-m1 ``` But the input spec is right there on the CLI, and it doesn't add anything to the output. Also, since #44843, specs concretized in the CLI line can be unified, so it makes sense to display them as we did in #44489 -- as one multi-root tree instead of as multiple single-root trees. With this PR, concretize output now looks like this: ```console > spack spec /v5fn6xo /wd2p2v7 [+] [email protected]%[email protected]~docs+shared build_system=generic certs=mozilla arch=darwin-sequoia-m1 [+] ^ca-certificates-mozilla@2023-05-30%[email protected] build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]~guile build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]+cpanm+opcode+open+shared+threads build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]+cxx~docs+stl build_system=autotools patches=26090f4,b231fcc arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]~debug~pic+shared build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools libs=shared,static arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools patches=bbf97f1 arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]~symlinks+termlib abi=none build_system=autotools patches=7a351bc arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]+compat+new_strategies+opt+pic+shared build_system=autotools arch=darwin-sequoia-m1 [+] ^gnuconfig@2022-09-17%[email protected] build_system=generic arch=darwin-sequoia-m1 [+] [email protected]%[email protected] build_system=python_pip arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=generic arch=darwin-sequoia-m1 [-] ^[email protected]%[email protected] build_system=generic arch=darwin-sequoia-m1 ... ``` With no input spec displayed -- just the concretization output shown as one consolidated tree and multiple roots. - [x] remove "Input Spec" section and "Concretized" header from `spack spec` output - [x] print concretized specs as one BFS tree instead of multiple Signed-off-by: Todd Gamblin <[email protected]>
`spack spec` output has looked like this for a while: ```console > spack spec /v5fn6xo /wd2p2v7 Input spec -------------------------------- - /v5fn6xo Concretized -------------------------------- [+] [email protected]%[email protected]~docs+shared build_system=generic certs=mozilla arch=darwin-sequoia-m1 [+] ^ca-certificates-mozilla@2023-05-30%[email protected] build_system=generic arch=darwin-sequoia-m1 ... Input spec -------------------------------- - /wd2p2v7 Concretized -------------------------------- [+] [email protected]%[email protected] build_system=python_pip arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=generic arch=darwin-sequoia-m1 ``` But the input spec is right there on the CLI, and it doesn't add anything to the output. Also, since #44843, specs concretized in the CLI line can be unified, so it makes sense to display them as we did in #44489 -- as one multi-root tree instead of as multiple single-root trees. With this PR, concretize output now looks like this: ```console > spack spec /v5fn6xo /wd2p2v7 [+] [email protected]%[email protected]~docs+shared build_system=generic certs=mozilla arch=darwin-sequoia-m1 [+] ^ca-certificates-mozilla@2023-05-30%[email protected] build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]~guile build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]+cpanm+opcode+open+shared+threads build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]+cxx~docs+stl build_system=autotools patches=26090f4,b231fcc arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]~debug~pic+shared build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools libs=shared,static arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools patches=bbf97f1 arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]~symlinks+termlib abi=none build_system=autotools patches=7a351bc arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]+compat+new_strategies+opt+pic+shared build_system=autotools arch=darwin-sequoia-m1 [+] ^gnuconfig@2022-09-17%[email protected] build_system=generic arch=darwin-sequoia-m1 [+] [email protected]%[email protected] build_system=python_pip arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=generic arch=darwin-sequoia-m1 [-] ^[email protected]%[email protected] build_system=generic arch=darwin-sequoia-m1 ... ``` With no input spec displayed -- just the concretization output shown as one consolidated tree and multiple roots. - [x] remove "Input Spec" section and "Concretized" header from `spack spec` output - [x] print concretized specs as one BFS tree instead of multiple Signed-off-by: Todd Gamblin <[email protected]>
`spack spec` output has looked like this for a while: ```console > spack spec /v5fn6xo /wd2p2v7 Input spec -------------------------------- - /v5fn6xo Concretized -------------------------------- [+] [email protected]%[email protected]~docs+shared build_system=generic certs=mozilla arch=darwin-sequoia-m1 [+] ^ca-certificates-mozilla@2023-05-30%[email protected] build_system=generic arch=darwin-sequoia-m1 ... Input spec -------------------------------- - /wd2p2v7 Concretized -------------------------------- [+] [email protected]%[email protected] build_system=python_pip arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=generic arch=darwin-sequoia-m1 ``` But the input spec is right there on the CLI, and it doesn't add anything to the output. Also, since #44843, specs concretized in the CLI line can be unified, so it makes sense to display them as we did in #44489 -- as one multi-root tree instead of as multiple single-root trees. With this PR, concretize output now looks like this: ```console > spack spec /v5fn6xo /wd2p2v7 [+] [email protected]%[email protected]~docs+shared build_system=generic certs=mozilla arch=darwin-sequoia-m1 [+] ^ca-certificates-mozilla@2023-05-30%[email protected] build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]~guile build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]+cpanm+opcode+open+shared+threads build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]+cxx~docs+stl build_system=autotools patches=26090f4,b231fcc arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]~debug~pic+shared build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools libs=shared,static arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools patches=bbf97f1 arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]~symlinks+termlib abi=none build_system=autotools patches=7a351bc arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]+compat+new_strategies+opt+pic+shared build_system=autotools arch=darwin-sequoia-m1 [+] ^gnuconfig@2022-09-17%[email protected] build_system=generic arch=darwin-sequoia-m1 [+] [email protected]%[email protected] build_system=python_pip arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=generic arch=darwin-sequoia-m1 [-] ^[email protected]%[email protected] build_system=generic arch=darwin-sequoia-m1 ... ``` With no input spec displayed -- just the concretization output shown as one consolidated tree and multiple roots. - [x] remove "Input Spec" section and "Concretized" header from `spack spec` output - [x] print concretized specs as one BFS tree instead of multiple --------- Signed-off-by: Todd Gamblin <[email protected]> Co-authored-by: Harmen Stoppels <[email protected]>
`spack spec` output has looked like this for a while: ```console > spack spec /v5fn6xo /wd2p2v7 Input spec -------------------------------- - /v5fn6xo Concretized -------------------------------- [+] [email protected]%[email protected]~docs+shared build_system=generic certs=mozilla arch=darwin-sequoia-m1 [+] ^ca-certificates-mozilla@2023-05-30%[email protected] build_system=generic arch=darwin-sequoia-m1 ... Input spec -------------------------------- - /wd2p2v7 Concretized -------------------------------- [+] [email protected]%[email protected] build_system=python_pip arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=generic arch=darwin-sequoia-m1 ``` But the input spec is right there on the CLI, and it doesn't add anything to the output. Also, since #44843, specs concretized in the CLI line can be unified, so it makes sense to display them as we did in #44489 -- as one multi-root tree instead of as multiple single-root trees. With this PR, concretize output now looks like this: ```console > spack spec /v5fn6xo /wd2p2v7 [+] [email protected]%[email protected]~docs+shared build_system=generic certs=mozilla arch=darwin-sequoia-m1 [+] ^ca-certificates-mozilla@2023-05-30%[email protected] build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]~guile build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]+cpanm+opcode+open+shared+threads build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]+cxx~docs+stl build_system=autotools patches=26090f4,b231fcc arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]~debug~pic+shared build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools libs=shared,static arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools patches=bbf97f1 arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]~symlinks+termlib abi=none build_system=autotools patches=7a351bc arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]+compat+new_strategies+opt+pic+shared build_system=autotools arch=darwin-sequoia-m1 [+] ^gnuconfig@2022-09-17%[email protected] build_system=generic arch=darwin-sequoia-m1 [+] [email protected]%[email protected] build_system=python_pip arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=generic arch=darwin-sequoia-m1 [-] ^[email protected]%[email protected] build_system=generic arch=darwin-sequoia-m1 ... ``` With no input spec displayed -- just the concretization output shown as one consolidated tree and multiple roots. - [x] remove "Input Spec" section and "Concretized" header from `spack spec` output - [x] print concretized specs as one BFS tree instead of multiple --------- Signed-off-by: Todd Gamblin <[email protected]> Co-authored-by: Harmen Stoppels <[email protected]>
`spack spec` output has looked like this for a while: ```console > spack spec /v5fn6xo /wd2p2v7 Input spec -------------------------------- - /v5fn6xo Concretized -------------------------------- [+] [email protected]%[email protected]~docs+shared build_system=generic certs=mozilla arch=darwin-sequoia-m1 [+] ^ca-certificates-mozilla@2023-05-30%[email protected] build_system=generic arch=darwin-sequoia-m1 ... Input spec -------------------------------- - /wd2p2v7 Concretized -------------------------------- [+] [email protected]%[email protected] build_system=python_pip arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=generic arch=darwin-sequoia-m1 ``` But the input spec is right there on the CLI, and it doesn't add anything to the output. Also, since spack#44843, specs concretized in the CLI line can be unified, so it makes sense to display them as we did in spack#44489 -- as one multi-root tree instead of as multiple single-root trees. With this PR, concretize output now looks like this: ```console > spack spec /v5fn6xo /wd2p2v7 [+] [email protected]%[email protected]~docs+shared build_system=generic certs=mozilla arch=darwin-sequoia-m1 [+] ^ca-certificates-mozilla@2023-05-30%[email protected] build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]~guile build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]+cpanm+opcode+open+shared+threads build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]+cxx~docs+stl build_system=autotools patches=26090f4,b231fcc arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]~debug~pic+shared build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools libs=shared,static arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools patches=bbf97f1 arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]~symlinks+termlib abi=none build_system=autotools patches=7a351bc arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]+compat+new_strategies+opt+pic+shared build_system=autotools arch=darwin-sequoia-m1 [+] ^gnuconfig@2022-09-17%[email protected] build_system=generic arch=darwin-sequoia-m1 [+] [email protected]%[email protected] build_system=python_pip arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=generic arch=darwin-sequoia-m1 [-] ^[email protected]%[email protected] build_system=generic arch=darwin-sequoia-m1 ... ``` With no input spec displayed -- just the concretization output shown as one consolidated tree and multiple roots. - [x] remove "Input Spec" section and "Concretized" header from `spack spec` output - [x] print concretized specs as one BFS tree instead of multiple --------- Signed-off-by: Todd Gamblin <[email protected]> Co-authored-by: Harmen Stoppels <[email protected]>
`spack spec` output has looked like this for a while: ```console > spack spec /v5fn6xo /wd2p2v7 Input spec -------------------------------- - /v5fn6xo Concretized -------------------------------- [+] [email protected]%[email protected]~docs+shared build_system=generic certs=mozilla arch=darwin-sequoia-m1 [+] ^ca-certificates-mozilla@2023-05-30%[email protected] build_system=generic arch=darwin-sequoia-m1 ... Input spec -------------------------------- - /wd2p2v7 Concretized -------------------------------- [+] [email protected]%[email protected] build_system=python_pip arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=generic arch=darwin-sequoia-m1 ``` But the input spec is right there on the CLI, and it doesn't add anything to the output. Also, since spack#44843, specs concretized in the CLI line can be unified, so it makes sense to display them as we did in spack#44489 -- as one multi-root tree instead of as multiple single-root trees. With this PR, concretize output now looks like this: ```console > spack spec /v5fn6xo /wd2p2v7 [+] [email protected]%[email protected]~docs+shared build_system=generic certs=mozilla arch=darwin-sequoia-m1 [+] ^ca-certificates-mozilla@2023-05-30%[email protected] build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]~guile build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]+cpanm+opcode+open+shared+threads build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]+cxx~docs+stl build_system=autotools patches=26090f4,b231fcc arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]~debug~pic+shared build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools libs=shared,static arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools patches=bbf97f1 arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]~symlinks+termlib abi=none build_system=autotools patches=7a351bc arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=autotools arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected]+compat+new_strategies+opt+pic+shared build_system=autotools arch=darwin-sequoia-m1 [+] ^gnuconfig@2022-09-17%[email protected] build_system=generic arch=darwin-sequoia-m1 [+] [email protected]%[email protected] build_system=python_pip arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=generic arch=darwin-sequoia-m1 [+] ^[email protected]%[email protected] build_system=generic arch=darwin-sequoia-m1 [-] ^[email protected]%[email protected] build_system=generic arch=darwin-sequoia-m1 ... ``` With no input spec displayed -- just the concretization output shown as one consolidated tree and multiple roots. - [x] remove "Input Spec" section and "Concretized" header from `spack spec` output - [x] print concretized specs as one BFS tree instead of multiple --------- Signed-off-by: Todd Gamblin <[email protected]> Co-authored-by: Harmen Stoppels <[email protected]>
Closes #44386.
When Spack concretizes environments, it prints every (newly concretized) root spec individually with all of its dependencies. For most reasonably sized environments, this is too much output. This is true for three commands:
spack concretizewhen concretizing an environment with newly added specsspack installwhen installing an environment with newly added specsspack specwith no arguments in an environmentThe output dates back to before we had unified environments or nicer spec traversal routines, and we can improve it.
This PR makes environment concretization output analogous to what we do for regular specs. Just like
spack specfor a single spec, we show all root specs with no indentation, so you can easily see the specs you explicitly requested. Dependencies are shown:So, the default is now consistent with
spack specfor one spec--it's--cover=nodes. i.e., if there are 100 specs in your environment, you'll get 100 lines of output. Here's an example:You can see that the roots,
python,tcl, andzlib-ngare at the top level of theoutput. Specs like
gnuconfig, a shared dependency oftclandzlib-ng, are onlyshown for the first thing that requires them (
tclhere).If you want to see more details, you can do that with
spack specusing the arguments you're already familiar with. For example, if you wanted to see dependency types and all dependencies, you could usespack spec -l --cover=edges. Or you could add deptypes and namespaces with, e.g.spack spec -ltN.With no arguments in an environment,
spack specconcretizes (if necessary) and shows the concretized environment. If you runspack concretizefirst, inspecting the environment repeatedly withspack specwill be fast, as everything is already in thespack.lockfile.Spec.tree()out ofSpecclass intospack.spec.tree(), which can take multiple specs as roots.Spec.tree()callspack.spec.tree()spack.environment.display_specs()now usesspack.spec.tree()spack concretizespack installspack specto callspack.spec.tree()for environments.spack specwhen using--yamlor--json