-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[package] nlohmann_json/3.11.3: Requiring nlohmann_json in a library does not transitively issue required generators. #23970
Comments
I believe your issue is not related to conan-center-index. I don't think it's a bug, but a question you should ask to conan client team: https://github.com/conan-io/conan/issues. It's likely related to the fact that you have written a conanfile of |
Hi @SpaceIm, thank you for your response. After discussions on the #conan slack, I do not know if it is a bug of the recipe, or a breaking change in Conan V2 client. The literal requirements declaration in our MRE is:
And there is nothing else touching requirements. And from that trivial requirement declaration, As far as we can see this is highly inconsistent, either all recipes should be implicitly "transitively public" or "transitively private" (with the usual ability for users to explicitly override). So either |
As I said, in conan v2 dependencies are private by default
The fact that conan generates CMake config file for private transitive dependencies when dependency is static and its dependencies are static/shared (and not when they are header-only) is related to conan client. There is no issue in recipes themselves. Now for your recipe |
I missed your edit @SpaceIm , sorry. Even though it feels "surprising" that implicit visibility now changes depending on the context, it is a Conan V2 decision. Just a clarification, which does not change the fact that this is not a bug.
Not necessarily, see this statement from CMake documentation:
This means that a well behaved CMake package config file will call |
Not-a-bug, the requirements are not transitive by default in Conan v2. |
Description
Let's describe a minimal example reproducing the issue.
Library
A
dependsnlohmann_json/3.11.3
andspdlog/1.13.0
. (note: the issue is the same with other nlohmann_json versions).If a downstream
B
depends onA
(for example, the downstream could beA
's test_package), we need it to locate bothnlohmann_json
andspdlog
: this gives the ability to issuefind_package()
statements for those requirements inB
CMake scripts.With
spdlog
, this works as expected. But withnlohmann_json
,find_package()
is failing with error:Investigating further, we can see that
B
'sgenerators
folder contain generators forA
, forspdlog
and its upstreams, but not fornlohmann_json
, which explains whyfind_package()
is failing.Package and Environment Details
Conan profile
--
Steps to reproduce
Please see the minimal example in the description.
Logs
--
The text was updated successfully, but these errors were encountered: