ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Package Manifest 2 - <depend> attribute version does not work

asked 2018-01-17 02:02:35 -0500

takahashi gravatar image

updated 2018-01-17 02:19:55 -0500

I am currently looking into versioning my catkin packages and making sure that I am using the correct versions. I am using Package Manifest Version 2 and according to REP-140, I should be able to specify the versions of my dependencies.

E.g. I have a package A (version 1.1) and a package B that depends on package A. I now would like to make sure, that version 1.1 of package A is used when building package B. My package.xml's will contain the following (for the sake of simplicity, I only include the relevant parts):

package A package.xml

<?xml version="1.0"?>
  <package format='2'>
  <name>A</name>
  <version>1.1.0</version>
  ...
</package>

package B package.xml

<?xml version="1.0"?>
  <package format='2'>
  <name>B</name>
  <version>1.0.0</version>
  <depend version_eq="1.1.0">A</depend>
  ...
</package>

So far so good, everything compiles fine. However, if I change that depend tag in package B package.xml above, e.g. to

<depend version_eq="2.0.0">A</depend>

..it still compiles fine! Meaning that it just does not care about the version attribute.

What am I doing wrong?


Edit: I just noticed that a warning is printed:

catkin_package() version mismatch: the package.xml of 'B' build_depends on 'A = 1.0.0', but 'A 0.9.0' found

Is this the expected behaviour or should the build fail?

edit retag flag offensive close merge delete

Comments

Btw: the depend tag works just fine, it just doesn't do what you are expecting it to do. But that is something else :)

gvdhoorn gravatar image gvdhoorn  ( 2018-01-17 02:36:40 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-01-17 02:29:36 -0500

gvdhoorn gravatar image

updated 2018-01-17 02:44:20 -0500

I just noticed that a warning is printed:

catkin_package() version mismatch: the package.xml of 'B' build_depends on 'A = 1.0.0', but 'A 0.9.0' found

Is this the expected behaviour or should the build fail?

Yes (that is the expected behaviour right now), see #q254811 (and ros-infrastructure/rosdep#325).

As far as I know what I write there is still the current situation.

Enforcing versions of dependencies at this point is only possible in your CMakeLists.txt.

edit flag offensive delete link more

Comments

I found out that in the catkin_package.cmake script only a WARNING is printed upon a version mismatch, so this behaviour is expected. I think specifying the dependency versions in the package.xml rather than the CMakeLists.txt find_package() is more elegant, but the build should fail upon a mismatch

takahashi gravatar image takahashi  ( 2018-01-17 02:38:29 -0500 )edit

The build will fail, if you do a find_package(<DEPENDENCY> X.Y.Z EXACT ..) in your CMakeLists.txt.

I agree that it's less than elegant that you'd have to duplicate that, but the manifest is used for different things (see #q217475).

gvdhoorn gravatar image gvdhoorn  ( 2018-01-17 02:40:58 -0500 )edit

First of all, thanks a lot for the quick&clarifying answers! But if the manifest is used for different things, why is the version attribute in there at all? I see that you are a contributor to ROS, would it make sense to request this feature (build failure) in the ros/catkin repository?

takahashi gravatar image takahashi  ( 2018-01-17 02:51:22 -0500 )edit

I'm a ROS Industrial contributor, that is slightly different.

If you want to address this shortcoming in rosdep, then I guess ros-infrastructure/rosdep#325 would be the starting point.

gvdhoorn gravatar image gvdhoorn  ( 2018-01-17 03:05:28 -0500 )edit

re: why are version attributes there at all: I believe that is covered by #q217475?

gvdhoorn gravatar image gvdhoorn  ( 2018-01-17 03:06:22 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2018-01-17 02:02:35 -0500

Seen: 500 times

Last updated: Jan 17 '18