Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for format three package.xml conditions #653

Closed
AAlon opened this issue Jan 23, 2019 · 4 comments
Closed

Support for format three package.xml conditions #653

AAlon opened this issue Jan 23, 2019 · 4 comments
Assignees
Labels

Comments

@AAlon
Copy link

AAlon commented Jan 23, 2019

Hey,
Looking at REP-149 http://www.ros.org/reps/rep-0149.html it looks like the support should already exist as the status is "Final". However, it seems like the tool does not recognize the condition option. Or maybe I'm just defining it wrong.
The motivation is being able to use catkin's CMake test macros when building for ROS1 and ament's macros when building for ROS2. Other than that the code itself is ROS-agnostic.

Configuration

package.xml has:

...
<package format="3">
...
<build_depend condition="$ROS_VERSION == 1">catkin</build_depend>
<build_depend condition="$ROS_VERSION == 2">ament_cmake_gtest</build_depend>

Error encountered

When using rosdep under ROS2 I'm getting Cannot locate rosdep definition for [catkin]
When using rosdep under ROS1 I'm getting Cannot locate rosdep definition for [ament_cmake_gtest]

Full log:

$ rosdep --version
0.14.0
$ echo $ROS_DISTRO
kinetic
$ echo $ROS_VERSION
1
$ rosdep install --from-paths src/utils-common --ignore-src -r -y
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
aws_common: Cannot locate rosdep definition for [ament_cmake_gtest]
Continuing to install resolvable dependencies...
#All required rosdeps installed successfully
$ echo $ROS_DISTRO
crystal
$ echo $ROS_VERSION
2
$ rosdep install --from-paths src/utils-common --ignore-src -r -y
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
aws_common: Cannot locate rosdep definition for [catkin]
Continuing to install resolvable dependencies...
#All required rosdeps installed successfully

I looked briefly but didn't see any portion of the code/docs explicitly calling out rep149 support, so I'd appreciate your help figuring out if this is really an issue in rosdep or just misconfiguration on my end.
Thanks!

@AAlon AAlon changed the title Support for format three package.xml Support for format three package.xml conditions Jan 23, 2019
@dirk-thomas dirk-thomas self-assigned this Jan 23, 2019
@dirk-thomas
Copy link
Member

It seems that this wasn't implemented in rosdep. Please try the patch from #654 and comment if that works for you.

@AAlon
Copy link
Author

AAlon commented Jan 24, 2019

Yep, #654 fixed it :) Thanks for the quick fix!

@JWhitleyWork
Copy link

JWhitleyWork commented Mar 25, 2019

@dirk-thomas - This PR fixed the issue in rosdep. However, it looks like the official XSD (http://download.ros.org/schema/package_format3.xsd) hasn't been updated to support the condition attribute. As such, xmllint fails when attempting to validate package.xml files which use it. Where can I request a change to the XSD?

Looks like an issue was created for it some time ago but it wasn't ready yet (ros-infrastructure/rep#148).

@dirk-thomas
Copy link
Member

The xsd files are stored in the REP repository. An issue there (or even better a pull request updating the schema file) would be best.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants