I can't seem to wrap my head around a way to distribute protobuf generated code.
I have 2 projects, A and B
B imports project As proto definition
A and B have python and C++ generated code.
For python it seems to all work well (had issues with protoc not generating the righ import package path, but I seem to have solved this)
In C++ it get's complicated
Say I build a .so from project A and I bundle the header with the librairy (protobuf 3.17 was used).
If The person working on B had a different version of protobuf installed, he can't use the header or he'll get the 'error: #error This file was generated by an older version of protoc which is' message
So for C++ I can't bundle a library with headers, I need to share the proto and let the users generate the code in their own build system... This seems wrong.
In the same line of thought, should the _pb2.py be disitributed or should the client installing the lib locally generate (say have instructions in setup.py) the code
Thanks