-
Notifications
You must be signed in to change notification settings - Fork 69
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
Consider versioning the RMW interface #188
Comments
Thanks! |
This grows complexity quite quickly, and then the question becomes when do you remove such "shims" for older versions. |
I would actually like to have this as a CMake variable instead (which dependent packages could choose to put in as compiler defines), but I guess we could generate a file in Maintaining the version in two places (in the |
The benefit of using CMake to convey the version and adding syntactic sugar to make it easy to use is that it can immediately be extended to all packages (e.g. via a patch to |
Lets figure out how we want to do this (a header, a CMake variable, etc.) by collecting the pros and cons of either proposal. That being said we should land this before the upcoming Eloquent deadline (Oct. 14th) so that RMW implementation can choose to support multiple versions of the changing RMW interface from a single branch. |
After an offline conversation we identified that we need to distinguish that something has changed in the interface compared to the last release. We came up with the following options:
Unrelated: We want to make the package version (from the We are looking for any kind of feedback / opinion with the hope that we can get this new option implemented in time for Eloquent. |
And now after the summary my personal opinion: I think option 4. is less elegant. It requires more logic (combining both versions) and has that "upcoming" version embedded in the CMake code (if it isn't being removed after a future release when not needed anymore, and we don't want to do that hence we rules out option 1.). It will also require a comparison of a X.Y.Z version number in downstream packages (which would probably demand to additionally store the version number in an easy-to-compare combined - e.g. a 6 digit number with two digits per part of the version triplet). Option 3. is simple and straight forward to implement in a package - either in CMake or as a header-only. It is also coupled with the package version which I think is a good thing. Downstream packages do a simple numeric comparison to toggle between the old and new interface. |
I think option 3 has a few problems:
There are some benefits to option 3:
Based on the above, I actually prefer option 4, since it doesn't require us to track two separate "versions" and because it's easier to associate logic in downstream packages to an upstream version (and therefore git tag). For the drawbacks mentioned for option 4:
I think this is more work, but not prohibitive. Since we're probably generating code, we can make macros to make this comparison easier, or we can just have the versions broken into a triplet, again we could make this easier to work with. So I do think this is a valid criticism, but not a deal breaker for me.
It does require more logic, but not for the end user, it's just one comparison we'd need to place in a cmake macro in a common place.
I don't fully follow this completely. The reason (in my opinion) we didn't want to have to undo the flag was because if we forgot then there would be no way to tell between the new version and the master branch that builds on it (because the flag was on at the release on accident), but that's not an issue with option 4. The "upcoming" version could be removed, updated, or left alone after a new release and nothing would be broken. I'd actually like to see this for option 4 (maybe call it option 5), as opposed to "upcoming" you'd just add Then in cmake you'd do something like this: mark_as_development_if_version_less_than(1.2.3) and in C++: // assuming the last release was 1.2.2 and the above cmake line
// FOO_VERSION would be 1.2.2+dev (well, the equivalent hex value)
#if (FOO_VERSION > FOO_VERSION_CHECK(1, 2, 2))
// new thing
#else
// old thing
#endif We can do the same as Qt and use a hex pattern (https://doc.qt.io/qt-5/qtglobal.html#QT_VERSION), e.g. While this is definitely more complex than a single number, it's also something we only need to implement once and it is easier to interpret when reading downstream code. After you release |
@eboasson Using this change implemented in ament/ament_cmake#204 and #191 you should be able to implement a conditional logic based on the exported version number (likely using |
Feature request
Feature description
Every now and then there is a change to the RMW interface that necessitates updating all the RMW implementations — for example #187, which gives the application a way to control options offered by the underlying implementation that are not otherwise exposed in the regular RCL interfaces. This then obviously results in the updated RMW implementations no longer being compatible with older versions of ROS2.
Having a version number for the RMW interface allows an implementation to be compatible with a larger range of ROS2 versions using a single source version.
One could also do the same in reverse: let RMW implementations advertise the version they implement, then provide compatibility with older RMW implementations where possible with a small effort. (#187 would have been pretty trivial.) The more different implementations of the RMW interface exist outside the ROS2 sources, the more valuable this becomes.
Implementation considerations
In my view the implementation could be as simple as defining an
RMW_VERSION
macro inrmw.h
, expanding to an integer that gets incremented whenever there is an interface change. That would have a minimal impact on managing the RMW interface but would give RMW implementers options.While letting RMW implementations advertise the interface version they implement and providing compatibility with older RMW implementations would definitely be very nice for the RMW implementers, it would also require some real effort in maintaining the RMW interface layer. That might be a bit too much to ask for 😄 .
The text was updated successfully, but these errors were encountered: