[protobuf] Compiling .proto files with scons
Sorry if this is a bit of a newbie question, but I'm new to both protobuffers and scons. What's the easiest way to get .proto files to compile to .pb.cc and .pb.h files? I know you guys use scons at google, so I'm hoping that there's a cut-and-paste solution - but if now, can someone recommend where to look to figure it out? -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to proto...@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=.
Re: [protobuf] Compiling .proto files with scons
Sorry, I thought I had read in an interview somewhere that you guys were using scons internally. And I actually can get scons to run protoc, I'm just having trouble getting it to read the .proto files from the right source directories and write the .pb.cc and .pb.h files to the right build directories. If there's not a cut-n-paste solution that folks here know about, I'll move this question to a scons discussion group. On Tue, Nov 24, 2009 at 2:20 AM, Kenton Varda ken...@google.com wrote: Actually, most of Google does not use scons. I've never used it myself. We mostly use an in-house build system full of Google-specific hacks -- like how to build protocol buffers. But it can't be that hard to get scons to run a shell command, can it? On Mon, Nov 23, 2009 at 2:14 AM, Thomas Johnson thomas.j.john...@gmail.com wrote: Sorry if this is a bit of a newbie question, but I'm new to both protobuffers and scons. What's the easiest way to get .proto files to compile to .pb.cc and .pb.h files? I know you guys use scons at google, so I'm hoping that there's a cut-and-paste solution - but if now, can someone recommend where to look to figure it out? -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to proto...@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=. -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to proto...@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.
Re: [protobuf] Compiling with Debug
Thanks for your help - I found that I was exceeding the recursion limit in CodedInputStream. I was able to instantiate my own CodedInputStream and increase the limit, but it would be nice if some sort of error was printed when the limit is exceeded. On Mon, Dec 28, 2009 at 9:52 AM, Kenton Varda ken...@google.com wrote: ./configure CXXFLAGS='-O0 -ggdb3' Instead of stepping through the protobuf code, though, I'd recommend is that you add some code to your own project to read the bytes directly from the istream and then verify that they are the same bytes that were originally produced by the protobuf serializer. You'll probably find that they are different in some way, which will point you towards the problem. On Sat, Dec 26, 2009 at 12:35 PM, Thomas Johnson thomas.j.john...@gmail.com wrote: I've got a protobuf file that for some reason can't be loaded using ParseFromIStream. The function just returns false, without printing any error, and seems to deserialize only part of the message. How can I compile a debug version of protobuf (i.e. -O0 -ggdb3) to step through the code and find out what's going on? -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to proto...@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 proto...@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.
Re: [protobuf] Compiling with Debug
I understand why it's there, and it makes sense for apps in general. I admit I'm using proto bufs for general serialization purposes within my app rather than the over-the-wire communication tool it was designed as. It just seems much easier to use than boost::serialization or other alternatives. What I was serializing in this case was a tree that had more than 64 levels, so yeah the data was legitimate. Do you recommend a different library for general purpose serialization? On Monday, December 28, 2009, Kenton Varda ken...@google.com wrote: Huh, I thought we did print a message there, but I guess not. That said, you're the first person I've ever heard of who hit that limit with (presumably) legitimate data. Consider designing you protocol differently? The limit exists for security reasons (to avoid stack overflows), so simply bumping it up isn't the best solution (though you can probably increase it significantly before running any real risks). On Sun, Dec 27, 2009 at 7:31 PM, Thomas Johnson thomas.j.john...@gmail.com wrote: Thanks for your help - I found that I was exceeding the recursion limit in CodedInputStream. I was able to instantiate my own CodedInputStream and increase the limit, but it would be nice if some sort of error was printed when the limit is exceeded. On Mon, Dec 28, 2009 at 9:52 AM, Kenton Varda ken...@google.com wrote: ./configure CXXFLAGS='-O0 -ggdb3' Instead of stepping through the protobuf code, though, I'd recommend is that you add some code to your own project to read the bytes directly from the istream and then verify that they are the same bytes that were originally produced by the protobuf serializer. You'll probably find that they are different in some way, which will point you towards the problem. On Sat, Dec 26, 2009 at 12:35 PM, Thomas Johnson thomas.j.john...@gmail.com wrote: I've got a protobuf file that for some reason can't be loaded using ParseFromIStream. The function just returns false, without printing any error, and seems to deserialize only part of the message. How can I compile a debug version of protobuf (i.e. -O0 -ggdb3) to step through the code and find out what's going on? -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to proto...@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 proto...@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.