osrf/osrf_testing_tools_cpp

Invocation of find_package_handle_standard_args with a different package name warns with CMake 3.17

tfoote opened this issue · 4 comments

All builds are causing multiple instances of the following warning:

From: https://ci.ros2.org/job/ci_osx/8744/consoleFull

14:02:52 CMake Warning (dev) at /usr/local/Cellar/cmake/3.17.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:272 (message):
14:02:52   The package name passed to `find_package_handle_standard_args` (libdw) does
14:02:52   not match the name of the calling package (Backward).  This can lead to
14:02:52   problems in calling code that expects `find_package` result variables
14:02:52   (e.g., `_FOUND`) to follow a certain pattern.
14:02:52 Call Stack (most recent call first):
14:02:52   src/memory_tools/vendor/bombela/backward-cpp/BackwardConfig.cmake:61 (find_package_handle_standard_args)
14:02:52   src/memory_tools/CMakeLists.txt:7 (find_package)
14:02:52 This warning is for project developers.  Use -Wno-dev to suppress it.

There are 3 instances

Full error messages:

--- stderr: osrf_testing_tools_cpp
14:02:52 CMake Warning (dev) at /usr/local/Cellar/cmake/3.17.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:272 (message):
14:02:52   The package name passed to `find_package_handle_standard_args` (libdw) does
14:02:52   not match the name of the calling package (Backward).  This can lead to
14:02:52   problems in calling code that expects `find_package` result variables
14:02:52   (e.g., `_FOUND`) to follow a certain pattern.
14:02:52 Call Stack (most recent call first):
14:02:52   src/memory_tools/vendor/bombela/backward-cpp/BackwardConfig.cmake:61 (find_package_handle_standard_args)
14:02:52   src/memory_tools/CMakeLists.txt:7 (find_package)
14:02:52 This warning is for project developers.  Use -Wno-dev to suppress it.
14:02:52 
14:02:52 CMake Warning (dev) at /usr/local/Cellar/cmake/3.17.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:272 (message):
14:02:52   The package name passed to `find_package_handle_standard_args` (libbfd)
14:02:52   does not match the name of the calling package (Backward).  This can lead
14:02:52   to problems in calling code that expects `find_package` result variables
14:02:52   (e.g., `_FOUND`) to follow a certain pattern.
14:02:52 Call Stack (most recent call first):
14:02:52   src/memory_tools/vendor/bombela/backward-cpp/BackwardConfig.cmake:72 (find_package_handle_standard_args)
14:02:52   src/memory_tools/CMakeLists.txt:7 (find_package)
14:02:52 This warning is for project developers.  Use -Wno-dev to suppress it.
14:02:52 
14:02:52 CMake Warning (dev) at /usr/local/Cellar/cmake/3.17.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:272 (message):
14:02:52   The package name passed to `find_package_handle_standard_args` (libdwarf)
14:02:52   does not match the name of the calling package (Backward).  This can lead
14:02:52   to problems in calling code that expects `find_package` result variables
14:02:52   (e.g., `_FOUND`) to follow a certain pattern.
14:02:52 Call Stack (most recent call first):
14:02:52   src/memory_tools/vendor/bombela/backward-cpp/BackwardConfig.cmake:87 (find_package_handle_standard_args)
14:02:52   src/memory_tools/CMakeLists.txt:7 (find_package)
14:02:52 This warning is for project developers.  Use -Wno-dev to suppress it.
14:02:52 
14:02:52 ---
14:02:52 Finished <<< osrf_testing_tools_cpp [32.9s]

I'll look into it. I feel like I addressed this or something like it when I upgraded backward, but maybe I missed something, I did run CI on this change:

#45 (comment)

And it did not show up there:

https://ci.ros2.org/job/ci_osx/8402/

The only thing that I did to that CI was reduce to Fast-RTPS which I feel like should not have caused an issue.

Could it be a difference in the CI machines? This warning would be produced if certain libraries needed to produce stack traces were not installed. See:

https://github.com/bombela/backward-cpp#libraries-to-read-the-debug-info

So, I feel like these warnings are desired perhaps? I don't know if we have any explicit instructions for installing these dependencies or if they are in the package.xml or not. I'll look. Maybe we'd prefer to suppress the warning in this case.

Not sure it is related but I couldn't build the latest master. Tag 1.3.0 works fine however. On MacOSX Mojave.
I get ld: library not found for -liberty for this package related to backward-cpp when trying to build from source on the latest Ros2 master.
Trying to build the latest master of backward-cpp I get the same issue.

Unfortunately I couldn't for my life figure out how to install libiberty on Mac, so created this: https://stackoverflow.com/questions/61863018/how-do-you-install-library-iberty-for-macos

But I might just go with 1.3.0 of this library, might be something locally since this is working on the CI ?

The problem likely happens on all platforms as of CMake 3.17.