-
Notifications
You must be signed in to change notification settings - Fork 988
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
[bug] conan 1.42.0: CMakeDeps does not inherit anymore from cmake_find_package_multi names #9943
Comments
Hi @SpaceIm yes, this is known, not a bug. Adding the properties in recipes is the way to go. |
I understand, but to move forward in CCI recipes, I would have expected:
|
Yes, we tried so far, but the issue is that CMakeDeps have moved internally to use all the new The CCI hook was planned, but we haven't had the time to do it. So I think we should focus on keeping the |
The issue is that Another issue tho if that if you change the generator now - it'd also break users who already fixed their build scripts. And |
What can we do, if we are using recipes from CCI in conjuction with CMakeDeps? What exactly is required to patch the current recipes in CCI? |
move to |
Producing the I did run into the parent issue with Catch2 where it errors out when using |
not exactly. it uses a simple search within file system under the hood, and behavior depends whether or not your file system is case-sensitive itself. |
I've not tested again recently, but I'm pretty sure it's no true: #8048 (comment) |
I've just did a quick test on Windows vs Linux, and behavior is different:
then run:
on Windows it configures successfully, while on Linux it fails:
so it definetely uses a file system search.
also fails on Linux and passes on Windows. so it definetely depends on the file system in use. |
I guess what @SpaceIm means is that if you lowercase the config file
then all of
should now work on all platforms. |
yes, that's the only case it works portable on all platforms.
however it doesn't work case-insensitively on all platforms, it requires a config file to be lower-case in order to be portable. |
Good bloody grief, I meant that the package name parameter passed into Anyhow, @SpaceIm was right on. I was trying to echo the ideas from #8048 here because it's related. The same benefit in using the |
This is the current logic in CMakeDeps: @property
def filename(self):
if self.find_module_mode:
return "Find{}.cmake".format(self.file_name)
else:
if self.file_name == self.file_name.lower():
return "{}-config.cmake".format(self.file_name)
else:
return "{}Config.cmake".format(self.file_name) We don't plan to change this, and we think the solution is to update recipes to add |
Sounds reasonable to me. |
I think this can be closed, it is expected that CMakeDeps is not using those names anymore, and there are other initiatives (updating recipes in ConanCenter with newer properties) to fix this. But please tell if I am missing something. Thanks. |
So how to offer stable interface for consumers of CCI during this transition? I believe that breaking CMake imported targets and config files is not acceptable. Transition from cmake_find_package to CMakeDeps, and from conan v1 to conan v2 should be as transparent as possible for consumers of CCI. |
Hi @SpaceIm
|
Ok. Therefore I believe that:
|
There is way more Conan usage out there not using ConanCenter than using it. The estimation is around 70-80% of users do not depend on ConanCenter, but maintain their own recipes (forks or from scratch) for third party packages. I know a few teams that are already happily migrating to CMakeDeps (and not being affected by these issues) I am totally fine, and I agree that maybe we should wait in ConanCenter to adopt CMakeDeps until the properties are migrated and stabilized. |
Let's take Boost as an example. I don't believe there are 70% serious C++ software developers not ever using it or recreated its recipe from scratch. If they're so unlucky to adopt CMakeDeps in their projects (like me) - they're toast now. Yes, I forked Boost recipe and fixed it internally but it's big pain, Boost is not the only one. Your argument that CMakeDeps is experimental does not quite convince me: it's you who recommended it for new projects as other CMake generators will disappear in the near future: #9108 (comment) Yes, it's experimental but there are many features that are still experimental like python requires. components or lock files but without them one just can't use Conan nowadays. And a new Conan release that just makes such a feature completely unusable in many existing recipes without deprecation notice is IMHO unacceptable. |
I understand this is unfortunate, but in our defense, most of this came from a new requisite, that didn't exist before when CMakeDeps was starting to be promoted, and it is the need to define new ways of defining specific target names (with custom namespaces, etc). We couldn't foresee that, and the path forward in the migration is now more painful than expected. I really apologize for it. But also this is the case where the experimental qualifier kicks in. The fact that we have been doing a huge effort in not breaking other features labeled as experimental doesn't mean that at some point we would need to break one of them. Otherwise we would always be stuck in a very bad situation: nobody ever uses and tests new features, so they are never improved, so they keep experimental forever. Said that, I totally understand the pain, so lets try to alleviate it as fast as possible:
Thanks very much for the feedback. |
@memsharded I think what you proposed sounds like a decent plan. So I am understanding that CMakeDeps is great, as I can also, on recipe level, turn off generation of individual Config files 😄 |
#10077 (comment) contains some updates about this. Quick summary:
|
Environment Details (include every applicable attribute)
Steps to reproduce (Include if Applicable)
self.cpp_info.names["cmake_find_package_multi"]
inpackage_info()
has a different name than recipe name (a simple one isutfcpp
recipe).CMakeDeps
generator (you can replace cmake_find_package_multi by CMakeDeps in test_package of utfcpp recipe and run conan create).=> generated config file and target will have default value (recipe name), so
find_package()
andtarget_link_libraries()
might fail.It has been seen in conan-io/conan-center-index#7887
Workaround: migrate to
set_property()
(which has an unwanted side effect in CONAN_PKG targets ofcmake
generator: conan-io/conan-center-index#7925, so the combination of those 2 issues is really annoying).The text was updated successfully, but these errors were encountered: