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

new PkgConfigDeps generator creates wrong gtest suite pc files #9631

Closed
Makogan opened this issue Sep 19, 2021 · 6 comments · Fixed by #9635
Closed

new PkgConfigDeps generator creates wrong gtest suite pc files #9631

Makogan opened this issue Sep 19, 2021 · 6 comments · Fixed by #9635
Assignees
Milestone

Comments

@Makogan
Copy link
Contributor

Makogan commented Sep 19, 2021

Environment Details (include every applicable attribute)

  • Operating System+version: Ubuntu 21.04
  • Compiler+version: g++ 11
  • Conan version: 1.40.1
  • Python version: 3.9.5

Steps to reproduce (Include if Applicable)

Use PkgConfigDeps to download gtest as a dependency and if I set it to install teh pc files in a directory other than the build directory. I get the pc files:

gtest.pc
gtest-libgtest.pc

Inside gtest.pc I see:

Name: gtest
Description: Conan package: gtest
Version: 1.10.0
Requires: libgtest gtest_main gmock gmock_main

The libraries are wrong, it should be, for example gtest-libgtest, and manually changing the files to have that prefix solves the issue.

This does not happen if I install the files in the build directory using the old pkg_config generator, in that case I do get a plain libgtest.pc file.

@memsharded
Copy link
Member

Hi @Makogan

Do you mean the line shot be something like?

Requires: gtest-libgtest gtest-gtest_main gtest-gmock gtest-gmock_main

So it includes the other .pc file as transitive dependency automatically?

Yes, this seems a bug, lets try to fix it for next release. Thanks for reporting!

@memsharded
Copy link
Member

Btw, it could be something missing in the recipe itself, needs to be checked. I see something like:

 self.cpp_info.components["libgtest"].names["cmake_find_package"] = "gtest"
        self.cpp_info.components["libgtest"].names["cmake_find_package_multi"] = "gtest"
        self.cpp_info.components["libgtest"].libs = ["gtest{}".format(self._postfix)]

Which is the legacy way of setting names. It is possible that the new PkgConfigDeps uses only the new properties or something like that, and the recipe needs to be modernized too.

@Makogan
Copy link
Contributor Author

Makogan commented Sep 19, 2021

@memsharded Yes, that's what I mean, all the lib names are missing the prefix, I am not sure about the recipes, I have yet to write one myself so I am not in a good position to give feedback about it.

@franramirez688
Copy link
Contributor

Thanks @Makogan

You're completely right. There was a bug when the Requires names were composed by <PKG>-<COMPONENT>. Now it's solved in this PR #9635

@memsharded
Copy link
Member

#9635 merged, will be released in next 1.41 (can be tested now from "develop" branch). Thanks!

@Makogan
Copy link
Contributor Author

Makogan commented Oct 3, 2021

Happy to have helped!

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

Successfully merging a pull request may close this issue.

3 participants