Merged 'purge' command with 'clean' and deleted 'purge' #4970
Merged 'purge' command with 'clean' and deleted 'purge' #4970becker33 merged 3 commits intospack:developfrom
Conversation
lib/spack/docs/packaging_guide.rst
Outdated
| Also, cleans up temporary files for a particular package, by deleting the | ||
| expanded/checked out source code *and* any downloaded archive. If | ||
| ``fetch``, ``stage``, or ``install`` are run again after this, Spack's | ||
| build process will start from scratch. |
There was a problem hiding this comment.
I'm not sure if I would expect spack clean foo to delete the downloaded archive. Does spack clean delete the downloaded archive for everything? If not, we should keep them in line. I think this would be a good setup:
$ spack clean --stage foo # delete stage for foo
$ spack clean foo # same as above
$ spack clean --downloads foo # delete downloaded archive for foo
$ spack clean --stage --downloads foo # both of the above
It would actually be really nice if spack clean --downloads foo worked. It makes it a lot easier to test fetching for packages I've already downloaded. I've been manually deleting archives for so long.
There's also a reference above that should be updated.
When called with
--stageor without arguments this removes all staged files and will be equivalent to runningspack cleanfor every package you have fetched or staged.
This is no longer equivalent to spack clean, it is spack clean.
There was a problem hiding this comment.
The functionality didn't change at all. The command:
$ spack clean --stage foo
in this branch is equivalent to:
$ spack clean foo
$ spack purge --stagein develop (so it deletes the stage for foo, and then it deletes all stages.). Same for other commands. This is reflected in the command help (hopefully):
$ spack help clean
usage: spack clean [-h] [-s] [-d] [-m] [-a] ...
remove temporary build files and/or downloaded archives
positional arguments:
specs removes the build stages and tarballs for specs
optional arguments:
-h, --help show this help message and exit
-s, --stage remove all temporary build stages (default)
-d, --downloads remove cached downloads
-m, --misc-cache remove long-lived caches, like the virtual package index
-a, --all equivalent to -sdm
Good catch for the docs. I'll update the reference.
There was a problem hiding this comment.
I'm not sure if that's true:
$ spack clean zlib
$ spack fetch zlib
==> Using cached archive: /Users/Adam/spack/var/spack/cache/zlib/zlib-1.2.11.tar.gz
spack clean foo doesn't delete the archived tarball. Or are we talking about different tarballs? Maybe you're talking about the one copied to the stage? I was talking about the one in the downloads mirror.
Anyway, I would like to see this behavior:
$ spack clean --stage foo # delete stage for foo
$ spack clean foo # same as above
$ spack clean --downloads foo # delete downloaded archive for foo
$ spack clean --stage --downloads foo # both of the above
As long as I can do this, I'm happy. Not sure how much work would be involved in spack clean --downloads foo though.
There was a problem hiding this comment.
Can we keep this extension for another PR? The code here behaves exactly like the code in develop, it just merges the two commands. Example:
$ spack clean --stage zlib
==> Cleaning build stage [[email protected]%[email protected]+pic+shared arch=linux-ubuntu14-x86_64 /pgxsxv7]
==> Removing all temporary build stages
$ spack clean --all
==> Removing all temporary build stages
==> Removing cached downloads
==> Removing cached information on repositoriesThere was a problem hiding this comment.
I'll open an issue after this is merged.
b94cefa to
b1c168a
Compare
lib/spack/docs/packaging_guide.rst
Outdated
|
|
||
| When called with positional arguments, cleans up temporary files only | ||
| for a particular package, by deleting the | ||
| expanded/checked out source code *and* any downloaded archive. If |
There was a problem hiding this comment.
Just to clarify, does spack clean foo delete the stage and the cached download archive? Or just the former?
There was a problem hiding this comment.
If think what was meant is any downloaded archive in the stage. I didn't check, but maybe this documentation precedes the introduction of the cached download archive. Any suggestion for writing this part better is welcome.
There was a problem hiding this comment.
I would just remove the second half of the sentence. We've already explained what spack clean/spack clean --staged does. Here we are clarifying that spack clean foo only applies to foo, not to every package.
b1c168a to
66bc68d
Compare
|
Oh, don't forget to update the Bash completion script! |
'spack purge' has been merged with 'spack clean'. Documentation has been updated accordingly. The 'clean' and 'purge' behavior are not mutually exclusive, and they log brief information to tty while they go.
66bc68d to
39fc37d
Compare
|
@tgamblin If you agree with the removal of |
|
@davydden I was wondering if you could do a test drive of this and provide some feedback? |
davydden
left a comment
There was a problem hiding this comment.
It looks like spack -h does not show clean as an option. Otherwise looks good:
$ spack clean
==> Removing all temporary build stages
$ spack clean -a
==> Removing all temporary build stages
==> Removing cached downloads
==> Removing cached information on repositories
|
@davydden That's because neither $ spack help -a |
did not know that! Thanks. |
|
Should we put |
|
Not sure we should add it, but I think we could make clearer in the basic help that there are additional commands not listed. |
|
@becker33 Kind of. I realized that I missed an important detail back then: we don't maintain a db for the build stages as we do for installed packages. Without having a db it's difficult to know what is in the stage and select directories based on the constraints given by the anonymous specs. We can of course maintain a simplified db in the stage, but I am not sure it is worth the effort. Thoughts?
Fine with me. If everybody agrees I can change the group here. |
|
I'd agree that it's not worth it, or at least can be a separate issue. If we wanted to do it we could add things to the database when staged and then mark them installed when installed, but I wouldn't necessarily go for it right now. |
fixes #2942
spack purgehas been merged withspack clean. Documentation has been updated accordingly. Thecleanandpurgebehavior are not mutually exclusive, and they log brief information tottywhile they go.