[question] cleanup huge CONAN_USER_HOME (dl directories?)
See original GitHub issueHello,
when I analyze my CONAN_USER_HOME
directory, then I can find a lot of files which could actually be removed.
For some of my packages (which are both build from source or for some packages downloaded prebuilt), I can find following files:
<conan_download_cache>/<hash>.tar.gz
dl/export/conan_export.tgz
dl/export/conan_sources.tgz
dl/pkg/<hash>/conan_package.tar.gz
export_source/
(which is actually the unpackedconan_sources.tgz
)source/
(which is actually same asexport_source/
)- (
build/
(which is actually the same assource/
if not usingno_copy_source=True
)) package/<hash>/
(which is actually the unpackedconan_package.tgz
Background:
We always have to use exports_source
to upload everything what we need alongside with the conanfile.py
to the same remote artifactory. We need this to ensure that our packages always can be built from source in future (e.g. if a remote is mirrored, if the actual URL is not available anymore on github.com, …). Therefore our conan_sources.tgz
may be very large. For Example: clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz
= 520MB (unpacked: 3.5GB)
Note regarding the download_cache <conan_download_cache>/<hash>.tar.gz
(1.5GB): This file we do not need to consider for now, since it is of course our job to cleanup the download_cache from time to time…
In my CONAN_USER_HOME
this conan package requires more space than expected (I would expect 3.5GB all in all).
dl/export/conan_export.tgz
1kBdl/pkg/<hash>/conan_package.tar.gz
1.5GBexport_source/
1.5GBsource/
1.5GB (Note: This file we can remove in oursource()
after we have unpacked it)build/
0kB (we useno_copy_source=True
)package/<hash>/
3.5GB
Is it a bug, that the dl/*
files are not automatically removed after they have been unpacked?
What is the easiest way for now to cleanup all files in the conan cache which are actually not required anymore (especially the export_source
, source
, build
and dl
directories)?
Will following command make the conan cache corrupt?
cd ~/.conan/data
find . -mindepth 5 -maxdepth 5 -type d -name 'dl' -o -name 'build' -o -name 'source' -o -name 'export_source' -exec rm -rf {} +
Issue Analytics
- State:
- Created a year ago
- Comments:7 (7 by maintainers)
Not yet.
At some point in Conan 2.X, when the LRU cache metadata is managed, it will be possible to
conan install
one conanfile, and then removed everything that was not used in the last 5 minutes or something like that.Is there a way to remove all cached packages except the ones required by a recipe/conanfile.py?