You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to inject manually downloaded 3rd party source code of a conan center recipe? #4578
Hi!
Due to a firewall, conan can't download for example libiconv-1.17.tar.gz form https://ftpmirror.gnu.org/gnu/libiconv/. Is there a way to download it manually and then tell conan to use it instead of downloading it? I already tried core.sources:download_urls = ["http://localhost:8080/", "origin"] in global.conf and then use a python http server, but it needs a complex .json file next to the downloaded file itself (which is renamed to the hash using sha256sum).
Is the format of the .json documented? Or is there another way to inject libiconv-1.17.tar.gz?
That will manage to download the sources then upload only the tarball to your http repo, without creating or uploading packages, just the source tarball, with the files it needs.
It is also possible to do a conan source --version=<version> command on the recipe to force the download, then run conan cache backup-upload.
I'm looking for a manual process, i.e. obtain a missing tarball somewhere else (other page or via USB stick), then rename it to its sha256 using sha256sum and then put it somewhere where conan finds it. It almost works when putting it into a directory and serve it with python -m http.server 8080, but conan also needs a .json file next to it. Conan could simply ignore a missing .json file or is any essential information in it? I now found the solution of copying and modifying the recipe to let it point to some file:/// url and then exporting it again.
At the moment, as the backup-sources feature was designed to be uploaded by Conan and not manually, the .json file is necessary.
But it is relatively simple, my PR above is showing an example:
Named the same as the other file but with the .json extension
Even if you are doing it manually, it would be a good thing to create and upload this file, to keep record of the original internet URL it was downloaded from and also to which package it belongs.
Maybe you can try to create the file and upload it? If you are automating the process with a script (recall you can create Conan custom commands for any automation tasks around Conan), then it sounds quite doable.
Activity
memsharded commentedon Nov 9, 2026
Hi @Jochen0x90h
Thanks for your question.
If you can execute Conan commands in an internet connected machine, then something like:
with the configuration as defined in https://docs.conan.io/2/devops/backup_sources/sources_backup.html
That will manage to download the sources then upload only the tarball to your http repo, without creating or uploading packages, just the source tarball, with the files it needs.
It is also possible to do a
conan source --version=<version>command on the recipe to force the download, then runconan cache backup-upload.Please let me know if this helps
memsharded commentedon Nov 9, 2026
I am creating an example in the docs for this explicit use case: #4579
Jochen0x90h commentedon Nov 9, 2026
I'm looking for a manual process, i.e. obtain a missing tarball somewhere else (other page or via USB stick), then rename it to its sha256 using sha256sum and then put it somewhere where conan finds it. It almost works when putting it into a directory and serve it with python -m http.server 8080, but conan also needs a .json file next to it. Conan could simply ignore a missing .json file or is any essential information in it? I now found the solution of copying and modifying the recipe to let it point to some file:/// url and then exporting it again.
memsharded commentedon Nov 9, 2026
At the moment, as the backup-sources feature was designed to be uploaded by Conan and not manually, the
.jsonfile is necessary.But it is relatively simple, my PR above is showing an example:
{ "references": { "libiconv/1.17": [ "https://ftpmirror.gnu.org/gnu/libiconv/libiconv-1.17.tar.gz", "https://ftp.gnu.org/gnu/libiconv/libiconv-1.17.tar.gz" ] }, "timestamp": 1794226585 }Named the same as the other file but with the .json extension
Even if you are doing it manually, it would be a good thing to create and upload this file, to keep record of the original internet URL it was downloaded from and also to which package it belongs.
Maybe you can try to create the file and upload it? If you are automating the process with a script (recall you can create Conan custom commands for any automation tasks around Conan), then it sounds quite doable.
Jochen0x90h commentedon Nov 11, 2026
Thanks, I will try it out (for now the patched recipe works)