Open exitingtheloop opened 1 year ago
Hi @exitingtheloop
If packaging existing pre-compiled binaries, the recommended approach is using conan export-pkg
to avoid having an extra copy as "sources", specially if the binaries are large. Please check:
If you still decide to go with the binaries packaged initially as sources, you need to make sure those files are also copy()
in the package()
method. Exporting them as part of the recipe doesn't make them available to consumers, as the sources are only involved when creating the package from sources, but that doesn't happen when the final package is already existing.
Hi @memsharded ! Thanks for getting back so quickly!
Yes the zipped bin files are also being copied in the package() method through copy().
When I install a recipe that doesn't have any dependencies I'm able to get hold of the bin files by using "conan cache name/version" and it gives me the downloaded folder in the conan cache, and the bin files are on the "es/" folder.
However, when they depend on other recipes, including them in the requirements() method downloads them too, using "conan cache dependency_name/version" gives me the downloaded folder in cache too but they're missing the "es/" folder which should be containing the zipped bin files. I was aiming to do my own installation script; hence, the use of conan cache, leading to a conan install command.
Yes, that makes sense. Please note:
conan cache path name/version
gives access to the "recipe" part, which is considered the "sources" of the packagees
folder is the short for exports_sources
folder. It is a folder that only exists when:
conan create
, conan export
)conan create
, conan install --build=missing/pkg)
)es
folder will not exist at alles
folder is not intended for user consumption. Users should use packages from the "binary" package view.conan cache path name/version:package_id
conan cache path
for normal operation. Conan has better mechanisms like generators to get information from dependencies and consume them, or deployers.Please let me know if this clarifies the issue, and how usage of Conan packages is intended.
Hi @memsharded !
I've tried the instructions here: https://docs.conan.io/2/tutorial/creating_packages/other_types_of_packages/package_prebuilt_binaries.html#packaging-already-pre-built-binaries
So far so good! I'm able to package them and include the zip files. Given that all of my packages have the same structure(where their bin files are), in which method do I define the installation steps in the recipe (actions such as unzipping the included files to a directory)?
Thank you so much
So far so good! I'm able to package them and include the zip files. Given that all of my packages have the same structure(where their bin files are), in which method do I define the installation steps in the recipe (actions such as unzipping the included files to a directory)?
In principle the idea of using Conan is that it is not necessary. When packages are installed:
Using the files from the cache is what allows to use different versions and different binary variants from different projects simultaneously in the same machine without conflicts.
If you still want to do some system-level install, there could be a couple of different mechanisms:
generate()
method that do copy()
the files from the cache.deployer
to automate the task, there are built-in deployers and users can write their own deployers: https://docs.conan.io/2/reference/extensions/deployers.htmlHi @memsharded , whenever I do a conan download, it brings 2 folders. 1 containing the recipe and another containing the included bin files. How do I get to this path via a deployer? since im planning to unzip them to a directory.
Thanks!
conan download
does not run deployers
, but conan install
does.
You can check the dependencies
interface in https://docs.conan.io/2/reference/conanfile/methods/generate.html#dependencies-interface, you can see that for every package you get the recipe_folder
and the package_folder
.
What is your question?
Hi! I'm trying to utilize Conan's dependency handling.
I created multiple packages that don't need to compile anything, just contains a zipped bin file in each of them (included through 'exports_sources', path is same folder as recipe).
Ex: Package A (contains zipped bin file A ) Package B (contains zipped bin file B)
When I install them individually, they successfully download both the recipe and the zipped bin file. But when I make them reference each other, say Package A requires Package B (self.requires), I get the following result: -Recipe for Package B is downloaded, zipped bin file is not -Recipe and zipped bin file for Package A are both downloaded
I saw somewhere that when we don't compile the exports_sources, they wont be downloaded when included as package dependency through self.requires of a package.
Any thoughts are appreciated!
Have you read the CONTRIBUTING guide?