This is what I ended up doing in the end.
Thanks

On Mon, Aug 1, 2022 at 2:12 PM 'Deanna Garcia' via Protocol Buffers
<protobuf@googlegroups.com> wrote:
>
> In general we recommend that you distribute the .proto file itself and not 
> the generated code. As you pointed out, distributing generated code doesn't 
> allow any user to use a different runtime. The wire format is always 
> compatible so it doesn't matter that you are using a different version of 
> protobuf than your users. This also lets them use your proto in any language, 
> giving them more flexibility.
>
> On Friday, May 27, 2022 at 9:39:32 AM UTC-7 lo...@sportlogiq.com wrote:
>>
>> 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
>
> --
> You received this message because you are subscribed to a topic in the Google 
> Groups "Protocol Buffers" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/protobuf/ib5YQH-MXF4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> protobuf+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/protobuf/9c6a68f0-be63-457f-ac3b-402f87076771n%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/CAJS4rrGmYdXKcGW0GZccnE975nqNGgh5NgMMFA0MWm5-zuFuCg%40mail.gmail.com.

Reply via email to