conan
conan copied to clipboard
[question] Why is progressing the conan version required in order to maintain gtest 1.10.0 dependency?
We have gtest 1.10.0 configured in a number of projects that use Conan to manage artifacts during compilation. We have found over the past few weeks that successive upgrades to the conan version breaks this dependency on gtest 1.10.0. We find this to be strange, seeing that the gtest 1.10.0 tag hasn't changed since October 2019.
The problem manifests with this error:
ERROR: gtest/1.10.0: Error in validate() method, line 95
if [self.info.settings.get_safe("compiler.cppstd"):
TypeError: 'NoneType' object is not callable
Previously, the solution has been to simply update the conan version, and the problem seems to go away. However, we are unclear as to why this should be the solution.
We suspected that there may be an issue calculating the conan hash, and to experiment, we have recently (with the update to conan v1.51.0) inserted the specific settings.info "compiler.cppstd=11" to no avail. We have not been using this settings.info setting in the past, and have had no specific issues. Just to note that we saw an update in the repo for Conan 2.0 just yesterday that looks to handle this issue for that release... is this related? Pull request 12885
We are under the impression that if we froze the conan version, that the dependency on gtest 1.10.0 should not change.
If someone could help advise us what we should be looking for to help prevent us from continually having to update our gtest version or conan version just to maintain this dependency. Or are we mistaken in thinking that successive versions of conan should not require constant update of older versions of gtest?
Any insight would be helpful, thanks!
@KyleJosling @delrizzo
- [x] I've read the CONTRIBUTING guide.
Hi @delrizzo
We are under the impression that if we froze the conan version, that the dependency on gtest 1.10.0 should not change.
It is true, but you have to freeze down to the recipe revision. One thing is the gtest source code version, 1.10.0, and the other are the conan packages generated from it. As the recipe evolves, gets fixes, support for more platforms or cross-building, it will be getting new recipe revisions in the form of gtest/1.10.0#recipe_revision.
If you want to freeze, you have several ways:
- Adding the recipe revision to your
requires - Using lockfiles
- Using your own repo to host a copy of the packages
the later is recommended for production in any case, using packages directly from ConanCenter is not recommended. You can read more about this in this blog post: https://blog.conan.io/2022/09/20/consuming-recipes-during-migration-conancenter.html
Just to note that we saw an update in the repo for Conan 2.0 just yesterday that looks to handle this issue for that release... is this related? Pull request 12885
Yes, but this PR did not update required_conan_version to 1.51.1, and that's a mistake. At least you could have seen a meaningful error message.
If someone could help advise us what we should be looking for to help prevent us from continually having to update our gtest version or conan version just to maintain this dependency. Or are we mistaken in thinking that successive versions of conan should not require constant update of older versions of gtest?
In conan-center repo, there are advices to protect your CI from breaking change in conan-center recipes: https://github.com/conan-io/conan-center-index/blob/master/docs/consuming_recipes.md