writing a plugin in python, on windows

44 views
Skip to first unread message

Eyal Farago

unread,
Oct 2, 2011, 9:27:03 AM10/2/11
to prot...@googlegroups.com
Just finished writing my first protoc plugin, I chose python as it requires no compilation (so I don't have to keep an executable in my source control), and did it on windows as this is my main development environment.
long story short, had to spit blood to get it working, due to these issues:

1. it's almost impossible to understand from the docs how to specify an executable name to a plugin using protoc --plugin.
 protoc --help spits out something about NAME=PATH, this combined with the documentation at plugin.proto where $NAME stands for a 'clean' name confused the hell out of me, I eventually had to debug protoc in order to understand what name to use in --plugin.
2. while writing a plugin in python is fairly easy, launching it is not. protoc --plugin does not support executable with arguments, only a path to an executable, when you're trying to launch a python script in windows your executable has to be the python interpreter, not the script itself (tried, it just wouldn't work), the only way to get around this was to wrap the script with a batch file -for some reason batch files do work...

I posted this on the group because I'm not sure if these two issues deserve a ticket, though I think #1 can be 'resolved' by improving the docs, and #2 probably requires a mini-feature,
I'd appreciate a response from one of the maintainers.

thanks,
Eyal.


Reply all
Reply to author
Forward
0 new messages