open-simulation-interface icon indicating copy to clipboard operation
open-simulation-interface copied to clipboard

Changes in Protobuf C++ versions and their implications on OSI

Open doganulus opened this issue 5 months ago • 1 comments

Realized that Google's official Protobuf implementation depends on libabsl, their Abseil C++ Library after Protobuf v22. Not only a dependency, but also they expose absl types at the public API. Now this has some consequences as follows.

  1. This creates an ODR violation risk for statically linked applications. For example, if an OSI application has another dependency on a project using absl statically. Then, it will cause an ODR.
  2. Hence, Google's Protobuf implementation after v22 is safely usable as a shared object only.

I wonder what the OSI project's recommendation is for this situation, where the project still uses pre-v22 versions and recommends static linkage in the documentation.

Some related issues and PRs:

  • https://github.com/OpenSimulationInterface/open-simulation-interface/issues/765
  • https://github.com/OpenSimulationInterface/open-simulation-interface/pull/766

doganulus avatar Aug 07 '25 09:08 doganulus