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
<cmas...@chromium.org> wrote:
> 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/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 = "protobuf@googlegroups.com"
>
>  # 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
> committed?
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To post to this group, send email to protobuf@googlegroups.com.
> To unsubscribe from this group, send email to
> protobuf+unsubscr...@googlegroups.com.
> 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 protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to