Comments (5)
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.
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.
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.
Thanks for this explanation. I'll then add libB
to requires.
from conan.
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)
- [bug] detect_api.detect_msvc_compiler() returns an incorrect version HOT 1
- [question] How to use source_buildenv HOT 5
- [question] Is it possible to check arguments passed in the CLI in the profiles? HOT 1
- [question] How to use Ninja with `CMake` helper? HOT 6
- [question] Issue with Custom Deployer - Dependencies Pointing to Cache Folder HOT 3
- Cross compiling macos x86_64 library on macos arm64 - what is best practice HOT 4
- [question] How to create package with submodule HOT 11
- [question] Manually injecting Requires.private into pkg-config modules HOT 2
- [question] When testing a package from a test_package folder how can I ensure that the macro PKG_API_STATIC_DEFINE is defined in the test project when --option:all=pkg/*:shared=False is used? HOT 4
- Easiest way to get the URL from a ref in Conan 2 HOT 8
- [question] How to manage cross-compilation with existing Linux Image and sysroot/libraries
- [bug] Recipes with invalid remote URLs in conandata can be uploaded HOT 7
- [question] Why is self.settings_target None ? HOT 2
- [bug] In build-order.json, build_args is wrong when options have whitespaces HOT 4
- [question] Dependency loop when including gcc as a profile tool_requires HOT 3
- [question] What is the recommended way to read environment variables HOT 2
- [feature] System cache HOT 5
- [question] export-pkg failes on dependencies for a standalone application [conan 2] HOT 9
- [question] system_requirements only needed for building HOT 2
- [question] Using deployers to get Conan package binaries without invoking Conan generators HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from conan.