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

Add compatibility with protobuf 28 #541

Open
wants to merge 1 commit into
base: gz-transport14
Choose a base branch
from

Conversation

ramir0-sultanov
Copy link

🎉 New feature

Adds compatibility with the Google Protocol Buffers v28.

Summary

Basically, rules for message down casting have been changed in protobuf and this PR modifies the way protobuf is used for downcasting.

Protobuf does not allow to use google::protobuf::internal::DownCast function to downcast message types with concepts enabled in version 28 (see port.h file in this diff). When compiling custom packages which depend on the gz-transport with C++ concepts enabled, there will be compile-time errors, if RepHandler::RunLocalCallback or SubscriptionHandler::RunLocalCallback functions were used (not necessarily used directly, but via some other function, for example: Node::Request).

Alternatively. there are google::protobuf::DynamicCastMessage and google::protobuf::DownCastMessage functions. Because google::protobuf::DynamicCastMessage function has more sanity checks, it was used in this PR with some additional error logging.

Test it

To test the changes you may install the Google Protocol Buffers v28, write some code that uses RepHandler::RunLocalCallback or SubscriptionHandler::RunLocalCallback (not necessarily directly) with C++ concepts enabled, and try to compile the code.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

@github-actions github-actions bot added the 🏛️ ionic Gazebo Ionic label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏛️ ionic Gazebo Ionic
Projects
Status: Inbox
Development

Successfully merging this pull request may close these issues.

1 participant