question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[question] cleanup huge CONAN_USER_HOME (dl directories?)

See original GitHub issue

Hello, 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 unpacked conan_sources.tgz)
  • source/ (which is actually same as export_source/)
  • (build/ (which is actually the same as source/ if not using no_copy_source=True))
  • package/<hash>/ (which is actually the unpacked conan_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 1kB
  • dl/pkg/<hash>/conan_package.tar.gz 1.5GB
  • export_source/ 1.5GB
  • source/ 1.5GB (Note: This file we can remove in our source() after we have unpacked it)
  • build/ 0kB (we use no_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:open
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
memshardedcommented, Sep 25, 2022

Is there a way to remove all cached packages except the ones required by a recipe/conanfile.py?

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.

0reactions
IceflowREcommented, Sep 25, 2022

Is there a way to remove all cached packages except the ones required by a recipe/conanfile.py?

Read more comments on GitHub >

github_iconTop Results From Across the Web

C:\Windows\SoftwareDistribution\Download Taking Up Too ...
As soon as the service starts again, some folders will be re-created. This is ok. You will find that the folder size grows...
Read more >
How to Clear Your Downloads Folder - Computer Hope
Information on how to delete individual items in your downloads folder or clear them all in Windows, iOS, and various Internet browsers.
Read more >
Where can i find and clean up partially downloaded content?
Here's another way to find the Mac App Store downloads folder by ... the new "Debug" menu in the menu bar and choose...
Read more >
Safe to delete "C:\WINDOWS\SoftwareDistribution\Download"
I think this folder is used as a temporary storage for Windows Update, but as all the pending Windows updates have now been...
Read more >
How to download HTTP directory with all files and sub ...
But, the problem is that when wget downloads sub-directories it downloads the index.html file which contains the list of files in that directory...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found