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

New issue 272 by protobuf-2.3.0 and greater don't cross-compile

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 build" attempts to execute the protoc it just built
3. Failure :-(

What is the expected output?
That allows overriding the proto compiler it uses; passing --with-protoc to ./configure doesn't do anything to change how 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/ protobuf-2.3.0/python/
--- protobuf-2.3.0-orig/python/ 2011-03-22 16:33:33.000000000 -0700
+++ protobuf-2.3.0/python/      2011-03-22 17:01:14.000000000 -0700
@@ -16,7 +16,9 @@
 maintainer_email = ""

 # 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
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to