Repository navigation
ament_vendor: Add AMENT_VENDOR_POLICY CMake option - #592
Conversation
0a73c9e to
3e77b2f
Compare
|
As one of the ros-nix-overlay users, I'm excited about this solution 😄 |
Great, feel free to comment if there is anything that could be improved from the nix point of view, as I a not so familiar with nix. |
sloretz
left a comment
There was a problem hiding this comment.
Thank you for the PR!
I have a couple nits and a question, but this code seems to do what it says.
d02b2ee to
57678fe
Compare
|
Thanks a lot for the review @sloretz and @cottsay, I should have addressed all your comments, and sorry for the delay in the reply. Downstream projects are adopting local workarounds due to this option not being available (see for example ros2/rmw_zenoh#908) so it would be great to have this option in ament_cmake_vendor_package itself. |
|
@mjcarroll I should have addressed your feedback. On an unrelated note, could it make sense to enable signoff on web commits for this repo or org? See for example https://docs.github.com/en/organizations/managing-organization-settings/managing-the-commit-signoff-policy-for-your-organization#managing-compulsory-commit-signoffs-for-your-organization, this is already done in gazebosim and ros orgs, and simplifies the process of making simple web-based commits without the DCO bot complaining. |
|
@mjcarroll @sloretz @cottsay if there is anything I can do to simplify the review of this PR, feel free to ask! It would be great to reduce the amount of patches we have downstream in robostack, and this modification is quite extensively used, so it would be great to have it merged upstram at some point, thanks a lot! |
|
Pulls: #592 |
|
Quick reminder @mjcarroll @sloretz @cottsay |
|
Tick the box to add this pull request to the merge queue (same as
|
Hello @mjcarroll @sloretz @cottsay , friendly remainder on this, having this upstream would be really useful to drop a bunch of robostack-specific patches, and remove the need for all downstream package introduce custom specific-options, as done for example in ros2/rmw_zenoh#908 . |
|
Hello @mjcarroll @sloretz @cottsay , a friendly ping on this PR! |
|
since this has multiple approvals, can you just rebase on |
…_VENDOR_POLICY CMake option Signed-off-by: Silvio <[email protected]> Signed-off-by: Silvio Traversaro <[email protected]>
Co-authored-by: Shane Loretz <[email protected]> Signed-off-by: Silvio Traversaro <[email protected]> Signed-off-by: Silvio Traversaro <[email protected]>
Signed-off-by: Silvio Traversaro <[email protected]>
Co-authored-by: Scott K Logan <[email protected]> Signed-off-by: Silvio Traversaro <[email protected]> Signed-off-by: Silvio Traversaro <[email protected]>
Signed-off-by: Silvio Traversaro <[email protected]>
Signed-off-by: Silvio Traversaro <[email protected]>
Done! |
|
Tick the box to add this pull request to the merge queue (same as
|
|
Pulls: #592 |
I believe all the comments have been addressed
|
@cottsay I believe all your comments have been addressed, so I dismissed your review. Otherwise please let me know. |
|
I believe the arm64 and Windows test failures are known/unrelated. |
|
Thanks a lot @christophebedard ! |
FORCE_BUILD_VENDOR_PKG is deprecated in favor of AMENT_VENDOR_POLICY=FORCE_BUILD_VENDOR (ament/ament_cmake#592). Keep FORCE_BUILD_VENDOR_PKG for older ament_cmake versions. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Patrick Roncagliolo <[email protected]>
…_POLICY are set (#31) * Install environment hooks when FORCE_BUILD_VENDOR_PKG is set When FORCE_BUILD_VENDOR_PKG is ON, ament_vendor builds the vendored library even if it was already found, but the environment hooks were only registered when ${LIB_NAME_FULL}_FOUND was false. This left GZ_CONFIG_PATH unset, so e.g. 'gz sdf' was not available. Fixes gazebo-release/sdformat_vendor#30 Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Patrick Roncagliolo <[email protected]> * Also check AMENT_VENDOR_POLICY for forced vendor builds FORCE_BUILD_VENDOR_PKG is deprecated in favor of AMENT_VENDOR_POLICY=FORCE_BUILD_VENDOR (ament/ament_cmake#592). Keep FORCE_BUILD_VENDOR_PKG for older ament_cmake versions. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Patrick Roncagliolo <[email protected]> --------- Signed-off-by: Patrick Roncagliolo <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Evolution of #552 .
This PR aim is based on our experience at RoboStack with the ament_vendor, and aims to improve the experience of downstream packagers of ROS on non-officially supported platform (being them conda/robostack, nix or similar), reducing the need of patching the vendor package to obtain the required behaviour.
In particular, a common pattern that we are experiencing is that compare to stable linux distributions, rolling releases as conda-forge have much more recent packages, so in many case we want to disable completely the vendoring in
_vendorpackages.A few examples:
zenoh_cpp_vendor: In conda-forge, we have a build ofzenoh_cppthat includes all the features required byrmw_zenoh(see https://github.com/ros2/rmw_zenoh/blob/56f2688994600a176b9b26f7c2f23c00487e220c/zenoh_cpp_vendor/CMakeLists.txt#L18) and also all the default features enabled, so we want to force the use of the conda-forge version, instead of havingzenoh_cpp_vendorbuilds its own limited variant ofzenoh, that could conflict with the conda-forge' zenoh.gz-*-vendorpackages: In conda-forge, we have a build of the gz libraries that support Python bindings (differently from vendor packages, see Enable Python Bindings gazebo-tooling/gz_vendor#2) so we want to use them. However, the satisfied check in gz-math-vendor and other packages isEXACTby default (see https://github.com/gazebo-release/gz_math_vendor/blob/51d2e68e872d2f071bdf40fe7017b9a00ddd8a19/CMakeLists.txt#L31-L37), and the check is not easily disabled by CMake arguments (just from environment variables, but that is tricky for example to set via colcon.pkg files).At the moment, we handle that with a lot of patches (see for example https://github.com/RoboStack/ros-kilted/blob/main/patch/ros-kilted-zenoh-cpp-vendor.patch, https://github.com/RoboStack/ros-kilted/blob/main/patch/ros-kilted-gz-cmake-vendor.patch, https://github.com/RoboStack/ros-kilted/blob/main/patch/ros-kilted-gz-rendering-vendor.patch and all similar patch in that directory). However, patches are typically cumbersome to maintain, as you need to frequently update them if patched project changes.
To deal with this, this PR adds the
AMENT_VENDOR_POLICYCMake option, whose documentation is included in the code, and is reported in the following:One downside of having this option, is that now it is not anymore trivial to know ifament_vendoractually vendored something or not, while before it was sufficient to check if the variable passed toSATISFIEDwasTRUEor not (see for example https://github.com/gazebo-release/gz_sim_vendor/blob/423f5eaf34d1c69735c99704c610e434e902886e/CMakeLists.txt#L90). For this reason, the PR also adds aIS_VENDORED_OUTPUT_VARIABLE_NAMEargument that pass the variable name that is populated byament_vendorreporting if the package is actually vendored or not.To check if a package was actually vendored, you can check if the target name passed to
ament_vendorexists. For example, thegz-vendorpackages can check that with: