-
Notifications
You must be signed in to change notification settings - Fork 6.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
Avoid public reach of transitory dependency #43251
Comments
What do you mean?
You mean the openssl from vcpkg vs the openssl from the system? |
I have noticed that transient dependency contaminates my environment. That is, without using target_include_library(openssl) openssl is still in the executable. This is because I use curl and libarchive. Is there a way to make this transient dependency private to curl and libarchive, thus avoiding contamination of the environment? It would be nice if the transient openssl dependency was decommissioned and present only for the necessary ports, in my case curl and libarchive. as long as it remains hidden from others. I also use fmt and spdlog. Note that both include openssl internally although this should not be the case. When I remove both dependencies from an executable I notice that it warns me about the lack of openssl. it's very strange |
You can limit the displayed
However, it should be clear that in |
If the Hope to help you. :) |
The input is still to vague to give a good answer.
For static library linkage, even PRIVATE linking will need to pass on transitive link libraries, i.e. linking curl will pull in the openssl libs when curl is built with openssl.
From a vcpkg POV, there is only one openssl: the port. It is used to define port dependencies. |
I understand that openssl is public for curl and for all those who use curl. In my case when I only add spdlog and fmt, it still finds the openssl headers without having added curl. |
Who is it? Your cmake project?
The curl port also uses the openssl from vcpkg. |
I don't mind curl downloading openssl, I mind that even without adding curl with target_include_library() it finds openssl headers. This is the vcpkg.json fragment where I have the ports defined
This executable makes use of openssl headers and finds them. but I'm not adding them.
|
I will check my dependency tree again, but I don't understand why when I add fmt it finds the openssl headers |
Then you probably have installed the openssl headers on your system and they are found. |
I don't think so, because if I don't include any of the ports that I download vcpkg, it tells me about the error |
I understand that curl does not report errors. But I would expect that fmt, spdlog or any other port that has no relation to openssl would report the error to me. |
Please post your complete vcpkg.json, your CMakeLists.txt and the source file so that one can reproduce what you are describing |
Everything that is public depends on a target called base that only has fmt and spdlog public. As you can see, there are no references to curl. Even so, the openssl headers are in this executable. There are many cmakelists, but this case particularly calls my attention because I don't use curl anywhere and it still finds openssl. |
in the cmake cache I find this: //Path to a library. |
Any news regarding this? |
All headers go to Some packages use a subdir, and export But many packages, using a subdir or not, expect just Normally this isn't a problem unless using greedy autodection in configuration. Again, vcpkg more or less assumes a single installation of openssl to take part in the build. If you don't want the implementation from the vcpkg port, the proper approach is an overlay port which acts an interface to the external implementation. The link to an example was given in #43248 (reply in thread) |
Continuing with the problem #24558 I wanted to ask why the transient dependencies remain as public throughout the project. I use curl which has openssl installed. This causes that even if I do not link the library in the cmake of the project the transient dependency is found. How can I solve this? I would like to know if there is a way for all the executables to use the openssl that I configured in my vcpkg.json and not the transient dependency since it contaminates my environment.
The text was updated successfully, but these errors were encountered: