stack clean
command clears local cache in .stack-work
.
The feature for cleaning .stack
cache is not implemented yet. See this GitHub issue:
stack setup
installs GHC for project but it stores GHC globally (so you don't need to install GHC again for another project if this project uses same version of GHC).
You can just do rm -rf .stack-work
to clean project local build cache (built modules, github dependencies for project, etc.). Though, rm -rf .stack-work
won't work for multipackage project. Just do stack clean --full
to clear local cache completely for project.
To clean global cache, you can just do rm -rf ~/.stack
.
Thus, again, citing latest comment from issue discussion:
The garbage collection question definitely needs to be answered in some form or another. If possible, I think I might find a documentation solution preferable to a new command. It would be great if the manual discussed the directory structure of ~/.stack
and explained what directories were safe to delete.