ros2 / rcl_logging

Logging implementations for ROS 2.
Apache License 2.0
18 stars 34 forks source link

[rcl_logging_spdlog] remove dep on spdlog (and only have it on spdlog_vendor)? #25

Closed ahcorde closed 3 years ago

ahcorde commented 4 years ago

There are two kind of vendor packages in ROS 2.

My question here is should we try to get rid off the second find_package or don't we mind the find the library twice ?

Here you can find an example what I mean with "find the library twice":

find_package(spdlog_vendor REQUIRED) # Provides spdlog 1.3.1 on platforms without it.
find_package(spdlog REQUIRED)

This question is extensible to poco, yaml, yaml-cpp and the other vendor packages.

@wjwwood and @dirk-thomas what do you think?

wjwwood commented 4 years ago

I'm not sure. I can see benefit in both approaches. Just find packaging the vendor is nice because no matter where the dependency comes from, or what version it is, the vendor package can provide a uniform interface to it. But on the other hand, it's more transparent to find package the actual dependency and use variables from that, it's more "natural", especially if the dependency already provides a CMake module.

There are two cases where always using the vendor is nice, imo:

It also avoids any extra logic needed to use the upstream dependency from being duplicated in downstream packages (the ogre example is good for this again), because this can be encapsulated in the vendor package's logic.

The downside to this is that if you ever wanted to move away from the vendor package in the future, it would be harder to do so. Personally, I don't mind the vendor packages, but that's been a concern in the past.

clalancette commented 3 years ago

As far as I can tell, spdlog_vendor does try to use the system library if it is available: https://github.com/ros2/spdlog_vendor/blob/4683c3926f432cdc07ada6792c5e63142d82f000/CMakeLists.txt#L77 . But I'm not sure if that substantially changes the question.

@ahcorde is there anything in regards to rcl_logging that you think we would do here?

ahcorde commented 3 years ago

nope, we can close this issue