conan-io/conan-package-tools

How to upload build dependencies too?

bilke opened this issue · 5 comments

bilke commented

I have a package A which has other packages (e.g. B) as build dependencies. Package B is not available as a binary package. When I build A with build_policy set to missing package B is build from source as well.

At the end the new package for A is uploaded to my repo. Is it possible to automatically upload the new package for B as well?

Not currently.

Hah, while my first instinct is that it's better to have a dedicated job to build B separately, while thinking about it, I definitely noticed the temptation. As bincrafters, we could define one job "boost_all" with build missing, and let the whole boost tree be built (and now uploaded) recursively. I still don't think it's a good idea in our case, has lots of impracticalities at scale, but now I can see it being worthwhile in some cases. For example, if you are setting up CPT for a small new project, and building a few unique combination of settings/options for which there are no binaries in conan center, and use an OSS package which has 10 dependencies. It would be tedious to have to setup a CI job to build each separately.

I know how you feel ... I have a bunch of projects and sometimes I need to build a specific configuration, but the transitive dependency raises an error when I want to build just the top of level. It's really boring waste minutes, maybe an hour, building all chain of dependencies.

We also need this feature. I might be able to contribute it but need some advice on how to implement it. Would you envision this as an option of the conan upload command? If so, wouldn't we need two options: (1) upload transitive runtime dependencies and (2) upload transitive build dependencies?

I wrote some lines of code regarding this issue. Since there is already an open PR I will not create a second one.
@uilianries feel free to use my code for your PR ;) Would be cool to see this feature in one of the next versions..