I'm a bit concerned about setting arbitrary proto compiler via
environment variables. Protobuf runtime library requires exactly
matching protoc generated classes to work. Separating the protoc and
library potentially increased the risk of having incompatibility
errors. Not sure if this would bring security issues though.
Maybe you can write a wrapper script to symbol link the correct protoc
in your environment.
On Wed, Mar 23, 2011 at 8:36 AM, cmas...@chromium.org
> Hello! I'm a developer on Chromium OS, and we recently (today) started
> needing to build the protocol buffers with python support enabled in our
> cross-compilation environment. Passing --with-protoc to ./configure got me
> partway there, but then when it tried to run "python setup.py build", it got
> intro trouble. Turns out there's logic in setup.py to go looking for the
> protoc that was just compiled. In a cross-compile situation, that won't
> work :-/ I've got a patch to allow the desired protoc to be overridden by
> an environment variable:
> diff -Naur protobuf-2.3.0-orig/python/setup.py
> --- protobuf-2.3.0-orig/python/setup.py 2011-03-22 16:33:33.000000000 -0700
> +++ protobuf-2.3.0/python/setup.py 2011-03-22 17:01:14.000000000 -0700
> @@ -16,7 +16,9 @@
> maintainer_email = "firstname.lastname@example.org"
> # Find the Protocol Compiler.
> -if os.path.exists("../src/protoc"):
> +if 'PROTOC' in os.environ and os.path.exists(os.environ['PROTOC']):
> + protoc = os.environ['PROTOC']
> +elif os.path.exists("../src/protoc"):
> protoc = "../src/protoc"
> elif os.path.exists("../src/protoc.exe"):
> protoc = "../src/protoc.exe"
> Is such an approach acceptable? How would I go about getting this patch
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To post to this group, send email to email@example.com.
> To unsubscribe from this group, send email to
> For more options, visit this group at
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To post to this group, send email to firstname.lastname@example.org.
To unsubscribe from this group, send email to
For more options, visit this group at