Techniques for distributing proto definitions

975 views
Skip to first unread message

Jeff White

unread,
Oct 19, 2017, 2:51:27 PM10/19/17
to Protocol Buffers
I don't see documentation on recommended mechanisms to share proto files across an organization. A few options I can think of:

* git subtree - seems pretty straightforward. I think some people are using a single monorepo to aggregate all protos across an organization?

* publish using language-specific artifact distribution mechanism, e.g jar + nexus for jvm langs, node module for nodejs, etc. Not sure if all the compilers are able to look into their respective language artifacts.

* Don't distribute protos. Instead, build client libraries for all languages in one central repo (I suspect this is what Google does internally)

* Manually copy proto files - works ok if they are guaranteed to not change for a particular version.

jeff




Mohamed Koubaa

unread,
Oct 19, 2017, 3:10:29 PM10/19/17
to Jeff White, Protocol Buffers
Hello,

For languages other than c++ with well-established package managers, your build system on your proto repo could start with .proto and end with pushing a package.  There probably aren't build systems this sophisticated but we're using SCons and a custom proto builder that can do incremental builds up to C# assemblies/C++ static libraries/python modules and leave the publishing to a second step.

Because of C++ runtime differences if you don't have control over client build settings (compiler version, runtime library, debug vs. release, ...) you almost have to distribute source files.  If they are for internal use and you do have such control, you could distribute libraries of your own design.

Another caveat is for c++, with recent versions of protobuf where lite runtime is a build flag, I could see places where a client/server would use the lite proto runtime on one side and the full runtime on the other, and you'd have another switch on the client libraries to contend with.

Regards,
Mohamed Koubaa
Software Developer
ANSYS, Inc

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to prot...@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages