ROS V2 plugins: resolve conditional dependencies
Metadata
Current evaluation
Merged to master, enabling conditional dependencies in ROS V2 plugins for ROS_VERSION, ROS_DISTRO, and ROS_PYTHON_VERSION. Approved after CI passed and spread tests were updated to cover the feature.
Suggested action: —
No scores available.
Issue body
This PR enables ROS conditional dependencies in `package.xml` such as e.g.
```xml
<build_depend condition="$ROS_VERSION == 1">roscpp</build_depend>
<build_depend condition="$ROS_VERSION == 2">rclcpp</build_depend>
```
It only enables conditions based on "ROS_VERSION", "ROS_DISTRO" and "ROS_PYTHON_VERSION" which are the most commonly encountered.
This is the plugin V2 equivalent of #3313.
- [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] Have you successfully run `./runtests.sh static`?
- [x] Have you successfully run `./runtests.sh tests/unit`?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged to master, enabling conditional dependencies in ROS V2 plugins for ROS_VERSION, ROS_DISTRO, and ROS_PYTHON_VERSION. Approved after CI passed and spread tests were updated to cover the feature. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged into master. Enables ROS conditional dependency resolution in package.xml for ROS_VERSION, ROS_DISTRO, and ROS_PYTHON_VERSION. Added functional spread tests per reviewer request, increasing coverage by 0.03%. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged after adding functional tests. Enables ROS V2 plugins to resolve conditional dependencies in package.xml based on ROS_VERSION, ROS_DISTRO, and ROS_PYTHON_VERSION, implementing the V2 equivalent of PR #3313. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3313 Set ROS_VERSION for rosdep in plugins v1 | snapcraft | merged | Merged changes set the ROS_VERSION environment variable for rosdep in plugins v1. Approved by two reviewers and passing CI, this update enables conditional dependency resolution in package.xml files for ROS 1 and ROS 2. | |
| #3536 ROS plugins v2 misc fixes | snapcraft | merged | Merged. Fixes ROS plugins v2 staging failures by checking local ROS directories and skipping rosdep resolution for locally available packages. Updated tests for core20. Approved by two reviewers and passed CI. | |
| #3566 ROS 2 plugins v2 misc fixes | snapcraft | merged | Merged after resolving conflicts and passing CI. Fixes ROS 2 plugins v2 by updating the colcon install path, resolving local packages during staging by removing the COLCON_IGNORE marker, and adding spread tests. | |
| #3664 ROS plugins v2: respect source-subdir key | snapcraft | merged | Merged. Updates ROS plugins v2 to respect the source-subdir key, removes an unnecessary catkin_tools dependency, and adds tests for Colcon and catkin v2 subdir handling. Approved by reviewers and passed CI. |