Skip to content

spack spec: simplify and unify output#47574

Merged
tgamblin merged 2 commits intodevelopfrom
simplified-spec-output
Nov 13, 2024
Merged

spack spec: simplify and unify output#47574
tgamblin merged 2 commits intodevelopfrom
simplified-spec-output

Conversation

@tgamblin
Copy link
Copy Markdown
Member

spack spec output has looked like this for a while:

> 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:

> 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.

  • remove "Input Spec" section and "Concretized" header from spack spec output
  • print concretized specs as one BFS tree instead of multiple

@spackbot-app spackbot-app bot added commands core PR affects Spack core functionality labels Nov 13, 2024
@tgamblin tgamblin changed the title : simplify and unify output spack spec: simplify and unify output Nov 13, 2024
`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]>
@tgamblin tgamblin force-pushed the simplified-spec-output branch from 0e60ec6 to 130a62e Compare November 13, 2024 01:29
@tgamblin tgamblin added this to the v0.23 milestone Nov 13, 2024
becker33
becker33 previously approved these changes Nov 13, 2024
@haampie
Copy link
Copy Markdown
Member

haampie commented Nov 13, 2024

  • specs is a list of tuples (abstract, concrete) but the first part of it is never used, so that can be simplified
  • key=spack.traverse.by_dag_hash is not used consistently, which is necessary for consistent output since the lookup logic conditionally copies, so id not very reliable.

the input spec is right there on the CLI, and it doesn't add anything to the output

it does add colors, so users understand how their input spec is parsed. But I agree that's not always necessary and makes grep output cluttered.

@tgamblin
Copy link
Copy Markdown
Member Author

I like the simplifications a lot -- thanks!

Copy link
Copy Markdown
Member

@haampie haampie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@tgamblin tgamblin enabled auto-merge (squash) November 13, 2024 07:56
@haampie haampie mentioned this pull request Nov 13, 2024
5 tasks
@tgamblin tgamblin merged commit 6f948eb into develop Nov 13, 2024
@tgamblin tgamblin deleted the simplified-spec-output branch November 13, 2024 15:21
haampie added a commit that referenced this pull request Nov 14, 2024
`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]>
fryeguy52 pushed a commit to fryeguy52/spack that referenced this pull request Dec 17, 2024
`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]>
kshea21 pushed a commit to kshea21/spack that referenced this pull request Dec 26, 2024
`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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands core PR affects Spack core functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants