-
Notifications
You must be signed in to change notification settings - Fork 15
Remove cpp_info.config multi-configuration definition #21
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
Remove cpp_info.config multi-configuration definition #21
Conversation
I wasn't even aware that this feature exists in Conan, yet once I had the need for such a feature, but I found a different solution. Notably, the package in question had a lot of headers and not many binaries (similar to The solution was to split the package into two packages - one containing only the headers and marked as "header-only" and another containing only the libs that depend on the first one. Thus, the headers were downloaded and unzipped once and the packages containing the binaries were pretty much lightweight. @memsharded, if you like that solution, feel free to add it to the The only downside of the solution was the need to always release both packages simultaneously (not a big deal, especially when done by the CI) and to ensure that there is no version mismatch between the package containing the binaries and the package containing the headers (a bit tricky, but could be done). |
since I never used that I am fine with removing it however, I do not think that this feature is largely unsupported by many build systems, XCode, VS Studio, njnia , and also CMake have support for that, and for sure some others I do not know about |
I agree. This is something that many CMake generators do support well, at least for consumer usage, but since approximately no conan recipes do the current conan feature is more confusion than value. If there was a way to instead resolve the recipes, then choose more than one package_id by (by varying settings.build_type), and put together more than one IMPORTED_LOCATION_<CONFIG> property in the targets generated by cmake_multi, or cmake_find_package_multi, that would be a nice quality-of-life improvement for these multi-config generators. But the support in |
I agree with @a4z and @puetzk. We would love more consistent support for multi-configuration. Many of our users are used to generating VS solutions and switching between configs. It was a hard sell to tell them to generate different builds for the different configs. That being said, since we were never satisfied with the multi-config support of conan, we abandoned it and reluctantly standardized on single-config builds. If we it can't be supported well, then perhaps removing support in conan as a "lowest common denominator" solution is warranted. However, our developers would prefer great mutli-config support, if it can be done. |
I like enforcing 1 configuration per binary package_id. I'd be happy to see dependency graph/generator support for scenarios where you might more than one binary package_id chosen per recipe (e.g. cross-compiler usage where you want to use tools from |
If include and library search locations update for configurations, then on the end user side multi config should still work fine. |
Similar to what @kenfred told our environment was very used to multi-configuration Visual Studio solutions. But with the introduction of Conan we dropped multi-configuration support. Now we usually generate Visual Studio solutions (from CMake) which support either debug or release builds. My impression is that solid multi-configuration support implies a lot of complexity on the Conan side which is not worth the benefit. So I will upvote this proposal. |
Just to clarify: the fact that this proposal removes multi-config definitions in packages, doesn't imply that we will not keep working in multi-configuration support on the consumer side. The current |
I just want to confirm that |
I may be misunderstanding this, could you clarify something for me please? Let's say I make a recipe for an upstream lib (eg, zlib or whatever), and by default that project will build a |
No, you will have to do nothing. The zlib recipe will typically contain: def package_info(self):
suffix = "d" if self.settings.build_type == "Debug" else ""
self.cpp_info.libs = ["libzlib{}".format(suffix)] With that you will be able to create both Debug and Release packages, with the usual:
Then upload the recipe with those 2 binaries, and use them later. When you are using the Debug one, the Please let me know if this explains it, thanks! |
@memsharded Ok thank you for the explanation, it has cleared out my concerns. |
As proposed and described in the document, it seems that this feature is not used and its value more than questionable. Lets remove it. |
@memsharded Disappointed to see this going away. It was a bit painful to set up packages with multiple configs, but you couldn't beat the convenience of being able to change build configs in Visual Studio/Xcode and have it 'just work'. I've even set up If one Until this is possible, please bring back self.cpp_info.debug.libs/self.cpp_info.release.libs, it's vital to simple multi-config CMake workflows which, with the addition of Ninja Multi-Config, encompasses any platform, desktop, mobile, and beyond. |
Hi @ssrobins The thing is that it is still possible to change build configs in VisualStudio/XCode IDE and have everything working. The new So the only inconvenience is that you should call 2 (or more) |
Good to know, @memsharded, thanks. Any end-to-end examples of
But |
For CMakeDeps, the integration is via The |
Do I have to explicitly call I have no Anyway, thanks for your time, I'll keep poking at the Conan 2.0 conversion when I have time... |
Only for your direct dependencies. Transitive dependencies are managed within the direct one.
This was our rationale back in Conan first release, and the reason we went with our
You are welcome, and great, feedback is very welcome, so thanks to you! |
This PR proposes to remove the
cpp_info
multi-configuration definition that can be used inpackage_info()
as:It makes packages more bloated, inefficient, unsecure and fragile. The 1 configuration per binary package model works very well, and this feature is largely unsupported by many build systems, so it seems there is evidence that this is not a commonly used feature.