Skip to content
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.21.1 breaks existing recipes using cmake targets #6357

Closed
planetmarshall opened this issue Jan 14, 2020 · 4 comments
Closed

[bug] Conan 1.21.1 breaks existing recipes using cmake targets #6357

planetmarshall opened this issue Jan 14, 2020 · 4 comments
Assignees

Comments

@planetmarshall
Copy link
Contributor

CMake targets generated using 1.21.1 have changed from conan 1.21.0

Steps to reproduce:

pip install conan==1.21.0
conan install eigen/3.3.7@conan/stable -g cmake
grep CONAN_PKG:: conanbuildinfo.cmake

outputs

add_library(CONAN_PKG::Eigen3 INTERFACE IMPORTED)

Whereas

pip install conan==1.21.1
conan install eigen/3.3.7@conan/stable -g cmake
grep CONAN_PKG:: conanbuildinfo.cmake

outputs

add_library(CONAN_PKG::eigen INTERFACE IMPORTED)
@jgsogo jgsogo self-assigned this Jan 14, 2020
@jgsogo
Copy link
Contributor

jgsogo commented Jan 14, 2020

Hi! This is not a bug nor a regression in this version. It is how we think we can bypass a misunderstanding we had with the cpp_info.name and cpp_info.names features in recipes in conan-center-index. You can read all the rationale starting in this comment and the links from there: #6269 (comment)

In this version (v1.21.1), the cmake, cmake_multi and cmake_paths will use the name of the package without taking into account cpp_info.name (they also use cpp_info.names["cmake"] and cpp_info.names["cmake_multi"] if present).

@planetmarshall
Copy link
Contributor Author

planetmarshall commented Jan 14, 2020

Thanks for the explanation, though it does contradict what is stated here on the Conan Release Notes -

Conan 1.21 shouldn’t break any existing 1.0 recipe or command line invocation. If it does, please submit a report on GitHub. Read more about the Conan stability commitment.

As any recipe which uses CONAN_PKG cmake targets where the name has changed will break (as last CI did due to this change).

@jgsogo
Copy link
Contributor

jgsogo commented Jan 14, 2020

Yes, we knew it could break some users, but this misunderstanding was propagating bugs to the recipe files (those changes in conan-center-index were breaking users with each new revision). Now we know how we want this recipes to work and the community agree with it (many recipes has been changed from cpp_info.name to cpp_info.names thanks to this patch/fix/workaround).

The fix for your work environment is really easy, just declare the name for your generator:

def package_info(self):
    self.cpp_info.names["cmake"] = "Eigen3"

I'm sorry this has bitten you, are you using eigen from conan-center-index?

@planetmarshall
Copy link
Contributor Author

We use our own fork of conan-center-index and cache the packages we use locally due to network issues. I'll apply your fix, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants