-
Notifications
You must be signed in to change notification settings - Fork 1k
[question] Conan 2.x - Store conan create json output directly in conan package #17516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @Jannis1994 Thanks for your question. Yes, at this moment that json can only be added to the package metadata after the package has been created. This is the reason we are working to add a new capability to conan, see: #17203 The feature is called like One of the key points for that feature is that every package should create the manifest/graph.json/sbom of itself, that is, including its subgraph of dependencies, and computing that subgraph explicitly is not available yet in Conan. But #17203 is adding that capability, so the idea is that creating and storing such file is doable, either directly in recipes, or in the new |
Hi @memsharded thanks for your quick answer. Old conaninfo.txt in Conan1.X:
New conaninfo.txt in Conan2.X:
Also the requires package version looks diferent. In our project we used the conaninfo.txt really often, especially the properties conan.package.* |
The The The |
Thanks for the clarification. Best regards, |
closed |
Thanks to you for the feedback! If you can, please follow #17203 too, it would be great to have your feedback when this is merged and release. Thanks again! |
Sure I will consider it, as soon as it is merged. |
Hello again, during migration to Conan2 we saw another problem. It is mainly about the former conan.requires attribute visible in Artifactory when selecting conaninfo.txt properties view. In the past some other scripts used it for further evaluation and it would be great if we could add this attribute atleast manually. Is it possible to extend the standard attributes (conan.package.channel, conan.package.license, conan.package.name etc,) with a custom attribute? I saw methods like package_info() but I dont get it visible in the properties overview and I dont want to add it as an option, as it is mainly a parameter like the version, we also have other custom properties in mind, that we would like to add. Was thinking of something like the following:
Could you maybe help us again? Thank you and best regards, |
Whatever is added to the The recommended way to define Artifactory properties would be to use the Conan extension commands, in the If you could/should use metadata files instead, it might depend on the specific use case and usage patterns. If it is just a couple of small key-value things, Artifactory properties might be better, but if more information is needed, maybe metadata files would be better. Note there is some work in #17203 to help generating "manifest" files like SBOMs while creating packages, without needing to modify or hardcode this in all recipes. |
Thanks for your detailed answer. I think the metadata approach fits good. Unfortunately it is only available for Conan2.X and not for Conan1.X. We would like to have a similar file location for legacy releases in conan1 format and new releases in conan2 format. |
Storing things in extra folders inside the server side paths (or client side paths in Conan 1.X) can be quite problematic and break things. Conan 2 allowed this because it implemented some new logic to filter or manage differently "metadata" folders, but in Conan 1.X this will easily fail. I'd probably focus efforts in upgrading to Conan 2 first, then try the metadata approach (also, because the new tools like the one in that PR will be in Conan 2.X). If this is completely impossible, maybe doing something like we have done in ConanCenter in the past, and we have seen other users doing similar things: define some parallel storage, for example in a generic repo, that follows similar folder conventions using the package/revision/package_id/package_revision folders to store things. And try to keep the logic completely separated from recipes to allow the transition to Conan 2, for example using hooks or something like that. |
Also an extra info, to clarify, just in case.: The idea is that any metadata approach (both Artifactory properties or Conan metadata files) is for actual strict metadata, that is, the main package resolution and usage shouldn't really require the metadata in the process, and could be able to work even without that metadata (metadata files in Conan 2 are actually not downloaded in every |
Thank you @memsharded for the suggestions. We will take one of this approaches. Thank you. |
No, it will not be breaking at all, it will be released in one Conan 2.X versions, and the idea is that users will not be affected at all. |
Ok, thank you and for your effort putting in Conan2 |
Hi @memsharded
Thank you. |
No, there are no plans to remove it, the
No, this is not possible, because of the above, there is a 1:1 relation now between the There is no way to do such a thing from
We have the new Please let me know if this helps. |
Thank you again, that was exactly my question. |
So you cannot recommend something like the following, even if it is technically possible after package creation to add a property (just tried it): Then I only would do it to metadata after package creation and uploading to artifactory: |
Yes, this is possible, sorry I didn't understand it. What is not possible is to modify the contents of the |
Ah okay that is great, thank you, that helps us alot . |
What is your question?
Hello together,
in the past we used the conaninfo.txt file for checking dependencies. Now in Conan2 I saw it is better to use the json output of conan create as some details are not in conaninfo.txt anymore (Reference: #16763).
For instance I am missing:
[full_settings]
[full_options]
[recipe_hash]
I only get [options] and [requires]
So I used the following command:
My question would be now, how can I add this conan_info.json file to conan package after already creating it?
Is this only possible with the metadata option or is there something similiar to conaninfo.txt.
Using the conanfile.py package method and taking it from the recipe folder was also not possible without errors.
One idea I also thought of was executing the conan create steps manually but then it is not a one-liner anymore.
Best regards,
Jannis
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: