Is there any way to trigger a pants cache cleanup ...
# general
w
Is there any way to trigger a pants cache cleanup to remove unneeded files? And if not what can i delete safely in the named caches dir without pants having problems? Some context: We are developing inside a container and i mount the pants cache dir to make it persistent, but the cache keeps on growing. I tried some naive commands like _`find $HOME/.cache/pants/named_caches/pex_root/{venvs/,installed_wheels/} -maxdepth 1 -type d -mtime +1 -exec rm -rv {} \;`_ but it resulted in pants errors like:
... pex.dist_metadata.MetadataError: Failed to determine project name and version for distribution at ...
(Errors may be expected since i'm just deleting files in
installed_wheels
)
w
https://www.pantsbuild.org/2.23/docs/using-pants/troubleshooting-common-issues#how-to-change-your-cache-directory There is no fine-grained cleanup yet, as each tool that pants supports has varying levels of partial cache support. Those are some common dirs pants uses, and then the
nce
folder where pants is unpacked. In general, I just wipe the caches entirely and let pants rebuild when needed https://www.pantsbuild.org/2.23/docs/using-pants/using-pants-in-ci#directories-to-cache