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

pkg-config does not include required components from dependencies #450

Open
azeey opened this issue Sep 3, 2024 · 3 comments
Open

pkg-config does not include required components from dependencies #450

azeey opened this issue Sep 3, 2024 · 3 comments
Labels
Breaking change Breaks API, ABI or behavior. Must target unstable version. bug Something isn't working

Comments

@azeey
Copy link
Contributor

azeey commented Sep 3, 2024

Environment

  • OS Version: Ubuntu 24.04
  • Source or binary build? gz-utils3

Description

  • Expected behavior: The pkg-config file generated for a project to include required components from dependencies.
  • Actual behavior: The generated file only includes the required core library of the dependency, but not any additional required components

Steps to reproduce

  1. Add the line
gz_find_package(gz-utils3 REQUIRED COMPONENTS log)

Right before gz_configure_build in

gz_configure_build(QUIT_IF_BUILD_ERRORS)

3. Assuming you have gz-utils3-log installed, build project and read the contents of cmake/pkgconfig/gz-core_no_deps.pc in the build directory. You should see

prefix=${pcfiledir}/../../
libdir=${prefix}/lib
includedir=${prefix}/include/gz/core_no_deps0

Name: Gazebo core_no_deps
Description: A set of core_no_deps classes for robot applications
Version: 0.1.0
Requires: gz-cmake4 >= 1.1 gz-utils3
Requires.private: 
Libs: -L${libdir} -lgz-core_no_deps 
Libs.private: 
CFlags: -I${includedir} -std=c++11

In the Requires clause, there is gz-utils3, but not gz-utils3-log.

@scpeters
Copy link
Member

scpeters commented Sep 4, 2024

I noticed this too. I think the fix needs to be in the following lines of gz-config.cmake.in:

gz_pkg_config_entry is called once with the package name, but we should collect the names of required components and include those as well in a space-separated string (like gz-utils3 gz-utils3-log). This could be done by:

  • adding a gz_pkg_config_append_entry macro and calling that within the component for loop
  • or constructing the space-separated list of requirements in the for loop and moving the call to gz_pkg_config_entry after the for loop

@scpeters
Copy link
Member

scpeters commented Sep 4, 2024

potential fix in #451

@azeey
Copy link
Contributor Author

azeey commented Nov 11, 2024

Per our discussion in the PMC meeting, we should remove pkg-config support from gz-cmake since it's not used anywhere in our code base and most users are probably not using it.

@scpeters scpeters added the Breaking change Breaks API, ABI or behavior. Must target unstable version. label Nov 11, 2024
@caguero caguero moved this from Inbox to To do in Core development Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking change Breaks API, ABI or behavior. Must target unstable version. bug Something isn't working
Projects
Status: To do
Development

Successfully merging a pull request may close this issue.

2 participants