As Kenton said, including plugin.proto would bloat the core library. Only people implementing proto compilers such as yourself need to use it.
On the C++ side, you would typically just build a statically linked binary that has all of the plugin generated code linked in. It's not included in the C++ core library either. There are various mechanisms to package python programs, e.g. http://www.pyinstaller.org/, that would allow you to give users a functioning plugin program without requiring that they install the generated modules for plugin.proto. On Wed, Oct 6, 2010 at 12:42 AM, Louis-Marie <[email protected]> wrote: > Thanks for your answer. > > To give you a little bit more information, here's what I'm trying to > do. I want to deliver a tool using a custom protoc plugin implemented > in python, so that end user can generate code from its own proto > files. > > There would be nothing special to do before using this plugin, but > since it depends on plugin_pb2, I need to find the plugin.proto file > (using pkg-config), compile it, and put it in some appropriate > location. > > Also, I can't put it in its "natural" parent python package > (google.protobuf) which is already provided by protobuf installation. > On the other side, the c++ code is generated (and I guess, compiled > into the shared library), which makes it a little bit more > straightforward to write c++ plugins. > > What would be the best way to achieve what I'm trying to do? If the > python library size increase is not acceptable there, couldn't the > plugin_pb2 file be generated in an independent location, so that one > could still rely on it being present on any protobuf install? > > Thanks for your advices, > > Louis-Marie > > > 2010/10/6 Kenton Varda <[email protected]>: > > It's not generated because none of the python implementation actually > uses > > it. So, generating it and including it in the egg would just increase > the > > library size for everyone, when most people don't need it. > > What makes you feel uncomfortable about generating it yourself? > > > > On Fri, Oct 1, 2010 at 6:01 AM, Louis-Marie <[email protected]> wrote: > >> > >> Hi all, > >> > >> It looks like python installation of protocol buffers does not > >> generate the google.protobuf.compiler.plugin_pb2 python file, while > >> google.protobuf.descriptor_pb2 is explicitly generated by > >> protobuf/python/setup.py > >> > >> generate_proto("../src/google/protobuf/descriptor.proto") > >> > >> Shouldn't the plugin.proto file be compiled and installed the same > >> way? Maybe I am missing something there, be I feel very uncomfortable > >> recompiling it when I need to write a plugin. > >> > >> Thanks, > >> > >> Louis-Marie > >> > >> -- > >> You received this message because you are subscribed to the Google > Groups > >> "Protocol Buffers" group. > >> To post to this group, send email to [email protected]. > >> To unsubscribe from this group, send email to > >> [email protected]<protobuf%[email protected]> > . > >> For more options, visit this group at > >> http://groups.google.com/group/protobuf?hl=en. > >> > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Protocol Buffers" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > > [email protected]<protobuf%[email protected]> > . > > For more options, visit this group at > > http://groups.google.com/group/protobuf?hl=en. > > > > -- > You received this message because you are subscribed to the Google Groups > "Protocol Buffers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<protobuf%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/protobuf?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
