Kenton,

The flaw in your assumption is that I actually use the current machine to build 
my product.  I don't.

I'm cross-compiling on platform A (redhat) for deployment on platform B (mips). 
 Other than the cross-compilation, I never, ever, need to run 'protoc' on 
platform A (redhat).  The cross-compiled protoc compiler is never used until 
after it has been deployed on platform B (mips).

Clear?

Now, with your fix, I must build GPB on platform A (redhat) just so I can 
cross-compile GPB for platform B (mips).  That is an entirely unnecessary 
dependency.  Since the tests can never be run using the cross-compiled protoc, 
there is absolutely no need to generate the files used by those tests.  
Furthermore, if there was a protoc installed locally on platform A (redhat), 
there is no guarantee that is is compatible with the version I am 
cross-compiling for platform B (mips) -- which would again require me to build 
a local version...

In the GNU software world, when a cross-compile is being performed, no tests 
are performed, and no attempt is made to generate files used by the tests.  It 
requires a leap of faith... That is the model you should be following.  The 
autotools support this, but is extremely obtuse.  Luckily for me I am only a 
consumer of GNU components, and not an author of any...

As a supplier of third party tools you should work to resolve this issue. Until 
there is a better solution, I will continue to rip out the "test" parts from 
the GPB makefiles so that my cross-compiles don't croak.

Regards,

Reid Madsen


From: Kenton Varda [mailto:[email protected]]
Sent: Friday, May 15, 2009 6:23 PM
To: Madsen, Reid
Cc: [email protected]; [email protected]
Subject: Re: Cross-compile of Google Protocol Buffers fails

On Thu, May 14, 2009 at 4:08 PM, 
<[email protected]<mailto:[email protected]>> wrote:

There's only one problem with this.  It assumes that you have a locally 
compiled and installed the protoc compiler.  Thus, before building a 
cross-compiled version, one must also build a native version.  This is an 
unnecessary dependency that should be avoided.
You have to install the compiler locally anyway in order to compile any code 
that uses protocol buffers, right?  So why is this a problem?

 Instead, you should provide a mechanism to disable the generation of all tests 
files.
Unfortunately autotool makes this hard.  It's mechanism for 
dynamically-generated sources is very weak and you cannot tell it "only 
generate these if building tests".

But also, you really should build the tests and run them on your target 
platform, to make sure there are no subtle problems with protocol buffers on 
that platform.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to