conan-io / conan

Conan - The open-source C and C++ package manager
https://conan.io
MIT License
8.13k stars 969 forks source link

[platform_requires] and consumers use of dependencies['somelib'] #16659

Open klausholstjacobsen opened 2 months ago

klausholstjacobsen commented 2 months ago

Hello I've read a previous thread about this issue, and understand the complications and limitations.

It would be nice if recipes could detect if a dependency is a normal dependency or a platform_requires.

In the boost recipe I have similar challenges with libiconv. One solution could be to to just probe dependencies for the existence of a dependency and otherwise asume it is an platform_requires? Like this:

image

Regards Klaus

Have you read the CONTRIBUTING guide?

klausholstjacobsen commented 2 months ago

Maybe replace_requires is the way to go. So I create a replacement package for my toolchain/system library and "inject" it with replace_requires?

//Klaus

AbrilRBS commented 2 months ago

Hi @klausholstjacobsen I'd caution that using replace_requires might have some unintended issues if your recipes expect the original name, see https://github.com/conan-io/conan/pull/16443 where we're exploring solutions to these problems, but nothing concrete yet

memsharded commented 1 week ago

Hi @klausholstjacobsen

I have done some progress in my PR: https://github.com/conan-io/conan/pull/16443, if you want to give it a try and see if it works in your case, that would be very valuable feedback.