Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 272 by cmas...@chromium.org: protobuf-2.3.0 and greater don't cross-compile
http://code.google.com/p/protobuf/issues/detail?id=272

What steps will reproduce the problem?
1. Attempt to cross-compile protobuf 2.3.0 in the chromiumos/portage build environment 2. See that "python setup.py build" attempts to execute the protoc it just built
3. Failure :-(

What is the expected output?
That setup.py allows overriding the proto compiler it uses; passing --with-protoc to ./configure doesn't do anything to change how setup.py behaves

What do you see instead?
Some mechanism to force the usage of another proto compiler.

The following patch allows setting PROTOC in the environment to override. Would that be acceptable?

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"


--
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