Conversation
|
cc @SteVwonder (better late than never 😆) |
|
@alalazo Could you please review this? Thanks! |
alalazo
left a comment
There was a problem hiding this comment.
In general I agree with the functionality added by this PR. I wonder if we should try to group this and other commands under a common umbrella. For instance:
$ spack store mark
$ spack store reindex
$ spack store find
...instead of adding a new one. This is because:
$ ls -1 lib/spack/spack/cmd/ | wc -l
74In case this discussion can be held in a separate issue.
|
I don't have a strong opinion regarding the amount of commands. Git also has a lot of commands and I think useful help output also solves the problem. Especially for common operations such as |
We must have a |
|
@tgamblin @scheibelp @adamjstewart @becker33 ping I use Spack for dependency management for projects outside of Spack. The |
b765672 to
0d140c2
Compare
becker33
left a comment
There was a problem hiding this comment.
I think this is useful, and an appropriately named command. I agree that the proliferation of commands is a concern, but I don't really see an obvious place to combine this command, and I think having poorly factored commands with suboptions that are unintuitive is a worse sin than too many commands. I think most users are able to find the (relatively few) commands they need, and documentation and the community support are able to point power users towards the more advanced commands they desire.
I think this PR probably requires documentation. I also have one note for code cleanup.
|
I have just pushed an updated version that also includes documentation and some tests. |
d162c27 to
0d04bdf
Compare
SteVwonder
left a comment
There was a problem hiding this comment.
Thanks @michaelkuhn! This is a very useful feature. I just had a question about some of the terminology used in the documentation (see below):
| on different versions of ``libsigsegv``. ``spack gc`` will not remove any of | ||
| the packages since both versions of ``m4`` have been installed explicitly. | ||
|
|
There was a problem hiding this comment.
Why are both versions of m4 considered being explicitly installed? Were they installed with spack install m4 ^[email protected] and spack install m4 ^[email protected]? If so, that makes sense to me.
If spack install m4 results in [email protected] getting marked as explicit, I'm confused. Are all packages marked as explict until someone comes by and manually marks them as implicit?
I could be wrong, but I think other package managers like apt use explicit to mean the package was explicitly mentioned by the user in a command line invocation, and implicit means the package was pulled in as a dependency of an explicit package.
If the terms used here differ, it might be worth precisely defining what explicit and implicit mean in this documentation.
There was a problem hiding this comment.
Why are both versions of
m4considered being explicitly installed? Were they installed withspack install m4 ^[email protected]andspack install m4 ^[email protected]? If so, that makes sense to me.
Exactly. I have now added some more lines to the example that should hopefully make this more clear.
If
spack install m4results in[email protected]getting marked asexplicit, I'm confused. Are all packages marked asexplictuntil someone comes by and manually marks them asimplicit?
No, only the two m4 packages will be marked as explicitly installed. I have also added a few sentences explaining this.
Thanks for your feedback! Let me know whether you think my changes are enough to clear things up.
There was a problem hiding this comment.
Awesome! Thanks for the clarifications. LGTM!
9aa923f to
53deb4c
Compare
becker33
left a comment
There was a problem hiding this comment.
@michaelkuhn sorry I haven't gotten back to this sooner. I have one more request on this PR.
lib/spack/spack/cmd/mark.py
Outdated
| print() | ||
| spack.cmd.display_specs(matching, **display_args) | ||
| print() |
There was a problem hiding this comment.
This is part of an error message, and should be printed to stderr
There was a problem hiding this comment.
I have added a new commit that should take care of this. It also fixes uninstall's error output.
|
@becker33 ping |
828988d to
88a8576
Compare
|
@becker33 I have rebased the PR to current develop and it now applies again. Anything else I should work on to get this merged? Thanks! |
becker33
left a comment
There was a problem hiding this comment.
It needs a rebase again, but it looks good. Sorry I dropped the ball on reviewing this.
This adds a new `mark` command that can be used to mark packages as either explicitly or implicitly installed. Apart from fixing the package database after installing a dependency manually, it can be used to implement upgrade workflows as outlined in spack#13385. The following commands demonstrate how the `mark` and `gc` commands can be used to only keep the current version of a package installed: ```console $ spack install pkgA $ spack install pkgB $ git pull # Imagine new versions for pkgA and/or pkgB are introduced $ spack mark -i -a $ spack install pkgA $ spack install pkgB $ spack gc ``` If there is no new version for a package, `install` will simply mark it as explicitly installed and `gc` will not remove it. Fixes spack#9626
`output` can be used to redirect `display_specs`'s output to stderr.
|
@michaelkuhn I took care of the rebase to get this into v0.16.0 |
* releases/v0.16: (6003 commits) update CHANGELOG.md for v0.16.0 bump version number to 0.16.0 clingo: add `master` branch version (spack#19958) cmd: add `spack mark` command (spack#16662) spack test (spack#15702) Added -level_zero -rocm -opencl flags and sha256 for TAU v2.30. (spack#19962) Improve warning message for deprecated attributes in "packages.yaml" Documentation: spack load/environments prefix inspections (spack#19961) spack load/environments: allow customization of prefix inspections (spack#18260) spack containerize: allow users to customize the base image (spack#15028) concretizer: modified weights for providers and matching for externals concretizer: maximize the number of default values used for a single variant concretizer: don't require a provider for virtual deps if spec is external concretizer: spec_clauses() shouldn't emit node_compiler_hard for rule bodies. concretizer: don't generate rules for empty version lists concretizer: add a rule to avoid cycles in the graph of dependencies External packages have a consistent hash across different concretizers Don't fail if MV variants have a tuple as default value Fixup for target preferences Added unit tests to for regressions on open concretizer bugs ... # Conflicts: # .gitignore # lib/spack/spack/binary_distribution.py # lib/spack/spack/cmd/setup.py # lib/spack/spack/modules/common.py # var/spack/repos/builtin/packages/med/package.py # var/spack/repos/builtin/packages/mofem-cephas/package.py # var/spack/repos/builtin/packages/mofem-fracture-module/package.py # var/spack/repos/builtin/packages/mofem-users-modules/package.py # var/spack/repos/builtin/packages/mpich/package.py # var/spack/repos/builtin/packages/petsc/package.py # var/spack/repos/builtin/packages/python/package.py
This adds a new
markcommand that can be used to mark packages as either explicitly or implicitly installed. Apart from fixing the package database after installing a dependency manually, it can be used to implement upgrade workflows as outlined in #13385.The following commands demonstrate how the
markandgccommands can be used to only keep the current version of a package installed:If there is no new version for a package,
installwill simply mark it as explicitly installed andgcwill not remove it.Fixes #9626