Pin ament install destinations to lib/include/bin (fixes #1175)#1176
Merged
Conversation
The ROS build farm (bloom/debhelper) configures with -DCMAKE_INSTALL_LIBDIR=lib/<multiarch-triplet>. Since #1152 made the BTCPP_*_DESTINATION variables honor GNUInstallDirs, farm binaries installed libbehaviortree_cpp.so to /opt/ros/<distro>/lib/x86_64-linux-gnu, which breaks ament_export_libraries lookup in downstream packages and is not on the LD_LIBRARY_PATH set by the ament environment hooks. Shadow the cache variables with plain set() in the ament build path, so ROS builds always install to $prefix/lib regardless of CMAKE_INSTALL_LIBDIR, while standalone builds keep the GNUInstallDirs override behavior introduced for #1120. Also add a ros2-lyrical CI job that emulates the build farm flags and asserts the library lands in $prefix/lib. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes #1175
Problem
Since #1152, the
BTCPP_*_DESTINATIONvariables honorCMAKE_INSTALL_LIBDIR(GNUInstallDirs). The ROS build farm (bloom/debhelper) always configures with-DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu, so the Lyrical/Rolling binaries started installinglibbehaviortree_cpp.soto/opt/ros/<distro>/lib/x86_64-linux-gnu/instead of/opt/ros/<distro>/lib/.That path breaks ROS in two independent ways:
ament_export_libraries()hardcodesfind_library(... PATHS "${prefix}/../../../lib" NO_DEFAULT_PATH), so downstreamfind_package(behaviortree_cpp)fails (see ament_cmake_export_libraries fails when CMAKE_INSTALL_LIBDIR is set ament/ament_cmake#630, e.g. theauto_apms_behavior_tree_corefarm failure).$prefix/libonLD_LIBRARY_PATH, andldconfigdoes not index/optpaths — so even with the ament fix, binaries would not find the library. This is why fixing ament alone is not sufficient and BT.CPP must pin the path itself.Solution
Plain
set()calls incmake/ament_build.cmakeshadow the GNUInstallDirs-based cache variables whenever the ament build path is active, pinning the destinations tolib/include/binregardless of what debhelper injects. Standalone (non-ROS) builds are untouched and keep the override behavior introduced for #1120.Also adds a
ros2-lyricalCI job (industrial_ci, same pattern as humble/jazzy) that emulates the build farm by passingTARGET_CMAKE_ARGS: -DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu, with anAFTER_SCRIPTasserting the library lands ininstall/behaviortree_cpp/lib/— a permanent regression test for this issue.Verified (locally against /opt/ros/lyrical)
-DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu(farm emulation)lib✅cmake --installlayoutlib/libbehaviortree_cpp.so, no multiarch dir ✅-DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu(#1120 feature)lib/x86_64-linux-gnu✅-DBTCPP_LIB_DESTINATION=custom/libcustom/lib✅API / ABI
Build-system change only; no API or ABI impact. Restores the pre-4.9.1 install layout for ROS binaries — needs a 4.9.2 patch release + bloom re-release for the affected distros.
🤖 Generated with Claude Code