Skip to content

Autogenerated protobuf code as public API #113

@azeey

Description

@azeey

Currently the c++ code autogenerated by protobuf is used in the public API of ign-msgs. While this is convenient in that users of ign-msgs can just link against ign-msgs and immediately start using the message classes in their applications, it comes with some downsides.

  1. Adding a field to a message breaks ABI even though the wire protocol of protobuf is designed to be backward compatible. This this requires a major version bump whereas adding a completely new message can be done in a minor release of ign-msgs.
  2. Platforms like macOS with more frequent updates suffer from breakages caused by updates to libprotobuf. Even minor version updates need new bottles. Rebuild bottles for protobuf 3.14 osrf/homebrew-simulation#1205
  3. Incompatibility with other versions of libprotobuf installed on the system. protobuf error on ubuntu 18.04 gazebo-classic#2496

A potential solution for (1) would be to make ign-msgs only contain the .proto files and generate message classes in each downstream library. For (2) and (3), we could consider statically link against libprotobuf as recommended in
https://github.com/protocolbuffers/protobuf/tree/master/src#binary-compatibility-warning

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions