Git Product home page Git Product logo

Comments (5)

memsharded avatar memsharded commented on July 19, 2024

Hi @joastoe

Thanks for your question.

I am afraid no, this is by design. If a package doesn't express a explicit requires = "libb/..., then it cannot use it in is recipe or code. It is considered an implementation detail of liba, that might exist or not, but it cannot be explicitly referenced.

Note that if your package code has direct #include to libb headers, then it is considered a direct dependency, and it must have a requires = "libb/..." to it. Is this the case? And if it is the case, why would it be an issue to declare the requires?

from conan.

joastoe avatar joastoe commented on July 19, 2024

Thanks @memsharded for this fast answer.

Indeed, compB has a direct dependency to libB. But not to libA. This is why I would not add libA as a dependency to compB, altough it could work.

My concern by adding libB to requires is to run into a version conflict. Because libA could request a different version of libB than mypackage.

from conan.

memsharded avatar memsharded commented on July 19, 2024

My concern by adding libB to requires is to run into a version conflict. Because libA could request a different version of libB than mypackage.

The moment that there is a direct dependency of compB to libB, the conflict effects are already a risk, no matter of the direct or indirect declaration of requires. Because the consumer has #includes that can break by using one version or another of the dependency, conflicts arising because of different versions will result in compilation errors anyway, with a much more complicated diagnosis than if failing fast because Conan detected.

The recommended way to deal with possible conflicts and minimize them is to use version ranges. If libA contains a requires to a fixed version of libB, then using the same version wouldn't be an issue if libA doesn't automatically upgrade it within the same revision. But still, it is possible to define a version range that includes the compatible versions of libB and as long as they match the declaration of the requires in libA, they will not conflict. And if they conflict, then it is good they do, because if the range is correct it would mean there will be a conflict and error in code anyway.

from conan.

joastoe avatar joastoe commented on July 19, 2024

Thanks for this explanation. I'll then add libB to requires.

from conan.

memsharded avatar memsharded commented on July 19, 2024

Thanks for this explanation. I'll then add libB to requires.

Sounds good. I'll close the ticket as responded, but please feel free to open new tickets for any further question you might have. Thanks for the feedback!

from conan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.