RE: protoc feature question
http://www.zeroc.com/vsplugin.html From: Kenton Varda [mailto:ken...@google.com] Sent: Friday, September 11, 2009 12:18 PM To: George Georgiev Cc: Protocol Buffers Subject: Re: protoc feature question Is there precedent for other tools like protoc providing this kind of behavior? I've never heard of such a thing. E.g. GCC does not check if the .cc file is newer than the .o file before compiling. On Fri, Sep 11, 2009 at 8:41 AM, George Georgiev georgi.georg...@citrix.commailto:georgi.georg...@citrix.com wrote: Just one more thing. I forgot to mention that the output is just one side of the coin. What about of the dependencies. If I have a proto file that includes another proto file now I need to extend the makefile to handle this too. What about if the dependencies are more complex and dynamic. My personal opinion is that the best place to handle all this is the protoc itself. -G From: protobuf@googlegroups.commailto:protobuf@googlegroups.com [mailto:protobuf@googlegroups.commailto:protobuf@googlegroups.com] On Behalf Of George Georgiev Sent: Thursday, September 10, 2009 6:19 PM To: Kenton Varda; Protocol Buffers Subject: RE: protoc feature question That seems reasonable to me. If you changed the package of any of your other Java files it would mean moving source code around which would certainly require updating the makefile. for me too, but some colleagues find this as extra pain Another idea is to have protoc output the .java files into a temporary directory, and then jar up that whole directory, and consider the .jar to be the output of the operation. That way you have just one output and it's the same regardless of the content of the .proto files. this means I will need to rebuild the whole jar file if any of the proto files is changed It looks like my use case isn't usual, but the way I'm using protobufs involves permanent updates of the proto files. Anyway, I could live with it as is. Thanks, George From: Kenton Varda [mailto:ken...@google.commailto:ken...@google.com] Sent: Thursday, September 10, 2009 5:45 PM To: George Georgiev; Protocol Buffers Subject: Re: protoc feature question On Thu, Sep 10, 2009 at 4:59 PM, George Georgiev georgi.georg...@citrix.commailto:georgi.georg...@citrix.com wrote: So you suggest if I change the java package in a proto file, I to update the makefile too? That seems reasonable to me. If you changed the package of any of your other Java files it would mean moving source code around which would certainly require updating the makefile. Another idea is to have protoc output the .java files into a temporary directory, and then jar up that whole directory, and consider the .jar to be the output of the operation. That way you have just one output and it's the same regardless of the content of the .proto files. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: protoc feature question
On Fri, Sep 11, 2009 at 1:51 PM, Monty Taylor mord...@inaugust.com wrote: Well, the build-if-newer is handled by either Make or VisualStudio, not by the compiler in either case. Right, the link is to a build system plugin. I'm all for build system plugins for protocol buffers but those wouldn't involve changing protoc. As for the dependencies ... gcc _does_ have options (-MD -MP -MF) to spit out depends that it determines from following include files in Makefile format. I'd definitely accept adding an option like that to protoc, if someone sends me a patch, though this is pretty different from what George was asking for. So I would be in favor of protoc including support for the second. I have no interest (and actually a negative interest) in protoc handling the first thing - that's a job for a build system) Sounds like we're in agreement here. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
RE: protoc feature question
Sorry guys. Yes, I asked for something else. My bad. How exactly this will handle the problem with the different output files? From: Kenton Varda [mailto:ken...@google.com] Sent: Friday, September 11, 2009 2:59 PM To: Monty Taylor Cc: George Georgiev; Protocol Buffers Subject: Re: protoc feature question On Fri, Sep 11, 2009 at 1:51 PM, Monty Taylor mord...@inaugust.commailto:mord...@inaugust.com wrote: Well, the build-if-newer is handled by either Make or VisualStudio, not by the compiler in either case. Right, the link is to a build system plugin. I'm all for build system plugins for protocol buffers but those wouldn't involve changing protoc. As for the dependencies ... gcc _does_ have options (-MD -MP -MF) to spit out depends that it determines from following include files in Makefile format. I'd definitely accept adding an option like that to protoc, if someone sends me a patch, though this is pretty different from what George was asking for. So I would be in favor of protoc including support for the second. I have no interest (and actually a negative interest) in protoc handling the first thing - that's a job for a build system) Sounds like we're in agreement here. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: protoc feature question
On Fri, Sep 11, 2009 at 3:25 PM, George Georgiev georgi.georg...@citrix.com wrote: How exactly this will handle the problem with the different output files? It won't -- like I said, it's not what you were asking for. We're still saying that your issue is the responsibility of the build system. Sorry. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
RE: protoc feature question
javac doesn't produce a java file - what you mean it will put it in its package subfolder? -Original Message- From: henner.zel...@googlemail.com [mailto:henner.zel...@googlemail.com] On Behalf Of Henner Zeller Sent: Friday, September 11, 2009 4:34 PM To: George Georgiev Cc: Kenton Varda; Monty Taylor; Protocol Buffers Subject: Re: protoc feature question On Fri, Sep 11, 2009 at 4:22 PM, George Georgiev georgi.georg...@citrix.com wrote: I think that protoc already has a compromise with pure compiler functionality - namely placing the java class in the package subfolder. javac does the same: compile a java file and it will put it in its package subfolder. But javac as well lets the build system handle the dependencies. -h --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: protoc feature question
On Fri, Sep 11, 2009 at 4:22 PM, George Georgiev georgi.georg...@citrix.com wrote: I think that protoc already has a compromise with pure compiler functionality - namely placing the java class in the package subfolder. Since you have so strong fillings not to make another compromise you probably will consider to remove the pervious one, or at least to make it optional? protoc outputs multiple files -- e.g. if you give it multiple inputs or if you use the java_multiple_files option. So the output location has to be a directory. And anyway, it's Java that imposes the rules about directory layout. I have been considering adding an option to output to a .jar file instead of a directory. This would get you a trivially-predictable output while still following Java's rules about directory layout. BTW, this may not be helpful to you, but the Java code generator is already capable of generating a separate file containing a list of outputs by invoking it like: protoc my.proto --java_out=output_list_file=list.txt:path/to/outdir This will place a file list.txt into the output directory (path/to/outdir) which is a simple text file listing the names of the other files generated, one per line. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: protoc feature question
Hi, On Thu, Sep 10, 2009 at 4:16 PM, George Georgiev georgi.georg...@citrix.com wrote: Hi, Is there a way to tell to protoc to recompile the files only if the output files are missing or are older than the input file? Isn't this what makefiles are for ? -h --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: protoc feature question
Hi, On Thu, Sep 10, 2009 at 4:26 PM, George Georgiev georgi.georg...@citrix.com wrote: Sure, but it is really hard for me to prepare something general since the java output files are located in a different folders based on the package specified in the proto file. I think it will be easier if the protoc provides this feature. mmh, I understand. And if you do it from an ant-buildfile (often used in java projects) then it would be as well hard as ant has not really a notion of file-dependencies (yeah, ant sucks as build-tool). So I guess the best way is to add this feature in your local version of protoc (say, switched on with a commandline flag) and send a patch to this list for review and to be integrated in the mainline. -h Thanks -Original Message- From: henner.zel...@googlemail.com [mailto:henner.zel...@googlemail.com] On Behalf Of Henner Zeller Sent: Thursday, September 10, 2009 4:21 PM To: George Georgiev Cc: Protocol Buffers Subject: Re: protoc feature question Hi, On Thu, Sep 10, 2009 at 4:16 PM, George Georgiev georgi.georg...@citrix.com wrote: Hi, Is there a way to tell to protoc to recompile the files only if the output files are missing or are older than the input file? Isn't this what makefiles are for ? -h --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: protoc feature question
On Thu, Sep 10, 2009 at 4:36 PM, Henner Zeller h.zel...@acm.org wrote: Hi, On Thu, Sep 10, 2009 at 4:26 PM, George Georgiev georgi.georg...@citrix.com wrote: Sure, but it is really hard for me to prepare something general since the java output files are located in a different folders based on the package specified in the proto file. I think it will be easier if the protoc provides this feature. mmh, I understand. I don't. Why should be taking on responsibilities of the build system in protoc? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: protoc feature question
Hi, On Thu, Sep 10, 2009 at 4:51 PM, Kenton Varda ken...@google.com wrote: On Thu, Sep 10, 2009 at 4:36 PM, Henner Zeller h.zel...@acm.org wrote: Hi, On Thu, Sep 10, 2009 at 4:26 PM, George Georgiev georgi.georg...@citrix.com wrote: Sure, but it is really hard for me to prepare something general since the java output files are located in a different folders based on the package specified in the proto file. I think it will be easier if the protoc provides this feature. mmh, I understand. I don't. Why should be taking on responsibilities of the build system in protoc? I once had to program in java and the build tools available in that world are really crappy. So from that point of view I can understand the pain. Maybe if someone wrote an ant-task for protoc then this could take care of it. -h --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: protoc feature question
On Thu, Sep 10, 2009 at 4:59 PM, George Georgiev georgi.georg...@citrix.com wrote: So you suggest if I change the java package in a proto file, I to update the makefile too? That seems reasonable to me. If you changed the package of any of your other Java files it would mean moving source code around which would certainly require updating the makefile. Another idea is to have protoc output the .java files into a temporary directory, and then jar up that whole directory, and consider the .jar to be the output of the operation. That way you have just one output and it's the same regardless of the content of the .proto files. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: protoc feature question
Henner Zeller wrote: And if you do it from an ant-buildfile (often used in java projects) then it would be as well hard as ant has not really a notion of file-dependencies (yeah, ant sucks as build-tool). Perhaps you are looking for uptodate or dependset -O --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
RE: protoc feature question
That seems reasonable to me. If you changed the package of any of your other Java files it would mean moving source code around which would certainly require updating the makefile. for me too, but some colleagues find this as extra pain Another idea is to have protoc output the .java files into a temporary directory, and then jar up that whole directory, and consider the .jar to be the output of the operation. That way you have just one output and it's the same regardless of the content of the .proto files. this means I will need to rebuild the whole jar file if any of the proto files is changed It looks like my use case isn't usual, but the way I'm using protobufs involves permanent updates of the proto files. Anyway, I could live with it as is. Thanks, George From: Kenton Varda [mailto:ken...@google.com] Sent: Thursday, September 10, 2009 5:45 PM To: George Georgiev; Protocol Buffers Subject: Re: protoc feature question On Thu, Sep 10, 2009 at 4:59 PM, George Georgiev georgi.georg...@citrix.commailto:georgi.georg...@citrix.com wrote: So you suggest if I change the java package in a proto file, I to update the makefile too? That seems reasonable to me. If you changed the package of any of your other Java files it would mean moving source code around which would certainly require updating the makefile. Another idea is to have protoc output the .java files into a temporary directory, and then jar up that whole directory, and consider the .jar to be the output of the operation. That way you have just one output and it's the same regardless of the content of the .proto files. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---