aussierobots / ublox_dgnss

This usb based ROS2 driver is focused on UBLOX Generation 9 UBX messaging, for a DGNSS rover. High precision data is available.
Apache License 2.0
38 stars 21 forks source link

Failed to build ublox_dgnss_node on Rolling/Humble #3

Closed clalancette closed 2 years ago

clalancette commented 2 years ago

This package is failing to build on the buildfarm for Rolling and Humble, one example is: https://build.ros2.org/job/Hbin_uJ64__ublox_dgnss_node__ubuntu_jammy_amd64__binary/9/consoleFull .

The problem ends up being this:

00:01:22.492 CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
00:01:22.492   Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)

The containers that the ROS buildfarm uses only install things that are listed in the package.xml. In this case, the package.xml does not list a dependency on pkg-config, and so that executable is not available for CMake to find. If you add a <build_depend>pkg-config</build_depend> to your package.xml and do a new release, that should fix this problem.

hortovanyi commented 2 years ago

@clalancette its exactly the same as what I’m using to build it on galactic … where is this requirement listed?

clalancette commented 2 years ago

@clalancette its exactly the same as what I’m using to build it on galactic … where is this requirement listed?

You may have been getting lucky on Galactic, and one of your dependent packages was pulling it in. I'm not sure. But you always need to declare all dependencies in the package.xml, otherwise it is not guaranteed to build.

hortovanyi commented 2 years ago

@clalancette i don’t use pkg-config and it compiles/builds successfully on my local environment. This seems to be an build-farm configuration issue?

gavanderhoorn commented 2 years ago

https://github.com/aussierobots/ublox_dgnss/blob/120c4c89db9e5bf993c9e091da5bce158b537d9e/ublox_dgnss_node/CMakeLists.txt#L28-L29

?

hortovanyi commented 2 years ago

@clalancette @gavanderhoorn that was to include libusb-1.0 only … works everywhere else. Is libusb-1.0 library available still on the buildfarm virtual machines for humble on Ubuntu jammy?

gavanderhoorn commented 2 years ago

@clalancette @gavanderhoorn that was to include libusb-1.0 only … works everywhere else.

that's not the same as "I'm not using it".

Is libusb-1.0 library available still on the buildfarm virtual machines for humble on Ubuntu jammy?

I would agree with @clalancette: this is more likely a problem with you not stating that dependency in your manifest than with the buildfarm config or whether Jammy introduced some sort of change.

Regardless of whether your package happened to build previously, you should list all your dependencies explicitly. Avoid transitively depending on something, as this can lead to problems with your immediate dependencies change their dependencies.

hortovanyi commented 2 years ago

@gavanderhoorn it’s a cmake module https://cmake.org/cmake/help/latest/module/FindPkgConfig.html .. libusb-1.0 is the actual dependency. I’ll try adding it as a build dependency per above tomorrow. It’s late where I am

gavanderhoorn commented 2 years ago

So CMake tries to use Pkg-Config to find libusb, as you ask it to do here:

https://github.com/aussierobots/ublox_dgnss/blob/120c4c89db9e5bf993c9e091da5bce158b537d9e/ublox_dgnss_node/CMakeLists.txt#L28-L29

if Pkg-Config is not present on the system where CMake tries to do that, you'll get this error:

Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)

which is the error you find in your buildfarm build log.

So even though your code depends on libusb, your build additionally depends on pkg-config.

If you don't state that dependency, your build will fail.

libusb does not bring Pkg-Config "with it", as it doesn't need it.

hortovanyi commented 2 years ago

@gavanderhoorn @clalancette change made but I cant bloom-release it

==> Checking on GitHub for a fork to make the pull request from...
Could not find a fork of ros/rosdistro on the hortovanyi GitHub account.
Would you like to create one now?
Continue [Y/n]?
Aborting pull request: HTTP Error 401: Unauthorized (https://api.github.com/repos/ros/rosdistro/forks)
The release of your packages was successful, but the pull request failed.
Please manually open a pull request by editing the file here: 'https://raw.githubusercontent.com/ros/rosdistro/master/humble/distribution.yaml'
<== No pull request opened.
hortovanyi commented 2 years ago

Project building successfully now thank you @gavanderhoorn @clalancette for your help