conan-extensions
conan-extensions copied to clipboard
Build info does not include conan_package.tgz
Hi
I'm creating a new CI/CD infrastructure for our Conan 2.x packages. I used the demo in this repo as a reference to create build infos. The problem is that they don't include the most important part of a package, the archive with binaries and stuff.
It's weird that build-info only includes conanfile.py, conaninfo.txt, and metadata. Dumps from conan upload ... --format=json show that conan_package.tgz exists and was uploaded.
So my scripts do the following: For each package:
conan create ... --format=json > unique_id.json
conan art:build-info create unique_id.json extra_unique_id 1 my_repo --server my_server > extra_unique_id.json
Upload:
conan remote login my_repo
conan upload --confirm -r my_repo *
conan remote logout my_repo
# For each build info:
conan art:build-info upload extra_unique_id.json --server my_server
# And then aggregate
conan art:build-info append aggregate 1 --build-info=extra_unique_id,1 ... > aggregate.json
conan art:build-info upload aggregate.json --server my_server
Then I wanted to promote the aggregate, but it does not include build artefacts.
The Conan recipes are primitive, as we only repack existing archives.
Am I doing something wrong? Also, any advice on how to improve batch upload would be appreciated.
Thanks
Hi @Krakenus00,
Thanks a lot for your question.
Regarding the missing conan_package.tgz:
- Would you be able to provide a bit more information about your workflow? Did you try the example demo before? Did it work for you? What would be the main differences between that an yours? I would always start doing a workflow as close as possible to the one in the demo.
- Does your Conan package have dependencies? Is the
conan_package.tgzmissing for your package or for the dependencies? - Can you try to add
--add-cached-depstoconan build-info createand check if that solves the issue?
For the aggregation part and promotion. I think the best way is to create a bundle with all the build infos (using conan art:build-info bundle-create), then you will be able to promote that using Artifactory UI or directly the API. Use that instead of conan art:build-info append because the Build Info resulting from the append I think may have some problems to be promoted, (This was used before Artifactory Release Bundle v2 was released).
Hope this helps
Hi @czoido
Thanks for the answer.
- It's the first time I've ever used Conan extensions. I followed the demo up to the
bundle-createand decided to useart:build-info appendinstead. I don't remember the reason already; maybe I misunderstood the purpose of a bundle. So, in the end, it promoted only the files listed in thebuild-info, and conan_package.tgz was not there. Even withoutappend, thebuild-infodoes not include the archive. Maybebundle-createadds the archive by default, but I have not tried it. I switched to usingart:promotewithconan uploaddump. - I tried recipes with and without dependencies. All conan_package.tgz were ignored.
- I'll try it and let you know if it changes anything.
I can create an example script + recipe this weekend. Switching to bundles may be complicated now, but I can try.
Hi @Krakenus00,
Thanks a lot for the detailed info 🙏. Let’s first focus on why the conan_package.tgz is missing before diving into bundles or promotion flows.
If you can prepare a minimal reproducible example (script + recipe), that would be the most effective way to pinpoint the issue.
Looking forward to it.
Hi @Krakenus00,
Probably, you are facing this issue if your packages are not uploaded to Artifactory before creating the build info. This is because the Conan client creates the .tgz files right before uploading, so this step is needed for the build info to be complete.
I have proposed https://github.com/conan-io/conan-extensions/pull/224 to issue a warning when .tgz files are missing and added a note to the readme as well.
I hope this helps to clarify your issue. Thank you 😄