[protobuf] Re: File already exists in database: abort trap

2009-10-28 Thread Saptarshi Guha


On Oct 29, 2009, at 2:26 AM, Kenton Varda  wrote:

> I'm not familiar with R.  But, the error means that you've attempted  
> to load two different copies of rexp.pb.cc into the same process.   
> The protobuf runtime requires that all compiled-in .proto files have  
> unique names.
>
> Note that if you have two files with the same name, but in different  
> directories, then you should make sure to run protoc from the common  
> parent directory.  E.g., if you have foo/myproto.proto and bar/ 
> myproto.proto, DON'T do this:
>
>   (cd foo && protoc myproto.proto)
>   (cd bar && protoc myproto.proto)
>
> In this case, protoc assigns the same name to both files.
>
> Instead, you should do this:
>
>   protoc foo/myproto.proto
>   protoc bar/myproto.proto
>
> Then the directory name becomes part of each file name, making them  
> different.  Note that you can also use --proto_path to identify the  
> top-level source directory instead of actually running protoc from it.
>
Thanks , that is what us happening, the same file is being loaded  
twice. I'll follow your suggestion and see how things go.


> 
>
> PS.  I notice you wrote this:
>
> http://lists.r-forge.r-project.org/pipermail/rprotobuf-yada/2009-October/00.html
>
> There is a missing option (c) here:  Do like option (b), but do NOT  
> copy the protoc source code.  Instead, simply link against  
> libprotoc, which is one of the libraries included in the protobuf  
> package -- it provides the CommandLineInterface class, so all you  
> need to do is write a CodeGenerator implementation and a main()  
> function.  The .proto language DOES change over time (we add new  
> features), so you should not try to write your own parser!

Yes , after I sent that email, romain pointed me to the c++ API  
whereupon I found the methods you mentioned. My mistake. I saw the  
java generator and got a rudimentary idea if how it was being done.


Thanks again for your prompt help
Regards
Saptarshi


> S
> In the future I'm hoping to make protoc itself support "plugins";  
> see this thread:
> http://groups.google.com/group/protobuf/browse_thread/thread/1010da67218d45d2
>
> On Wed, Oct 28, 2009 at 10:12 PM, Fishtank  
>  wrote:
>
> Hello,
> I use R 2.9.2 and have written two packages which use a proto file,
> one proto is a subset of the other.
> When I load both packages(one after the other,though order does not
> matter) loading the second causes the following crash
>
> libprotobuf ERROR google/protobuf/descriptor_database.cc:56] File
> already exists in database: rexp.proto
> libprotobuf FATAL google/protobuf/descriptor.cc:857] CHECK failed:
> generated_database_->Add(encoded_file_descriptor, size):
> Abort trap
>
>
> What does this mean, and is there something I'm doing wrong on my
> side?
> Thank you for your time
> Regards
> Saptarshi
>
> >
>

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



[protobuf] Re: File already exists in database: abort trap

2009-10-28 Thread Kenton Varda
I'm not familiar with R.  But, the error means that you've attempted to load
two different copies of rexp.pb.cc into the same process.  The protobuf
runtime requires that all compiled-in .proto files have unique names.

Note that if you have two files with the same name, but in different
directories, then you should make sure to run protoc from the common parent
directory.  E.g., if you have foo/myproto.proto and bar/myproto.proto, DON'T
do this:

  (cd foo && protoc myproto.proto)
  (cd bar && protoc myproto.proto)

In this case, protoc assigns the same name to both files.

Instead, you should do this:

  protoc foo/myproto.proto
  protoc bar/myproto.proto

Then the directory name becomes part of each file name, making them
different.  Note that you can also use --proto_path to identify the
top-level source directory instead of actually running protoc from it.



PS.  I notice you wrote this:

http://lists.r-forge.r-project.org/pipermail/rprotobuf-yada/2009-October/00.html

There is a missing option (c) here:  Do like option (b), but do NOT copy the
protoc source code.  Instead, simply link against libprotoc, which is one of
the libraries included in the protobuf package -- it provides the
CommandLineInterface class, so all you need to do is write a CodeGenerator
implementation and a main() function.  The .proto language DOES change over
time (we add new features), so you should not try to write your own parser!

In the future I'm hoping to make protoc itself support "plugins"; see this
thread:
http://groups.google.com/group/protobuf/browse_thread/thread/1010da67218d45d2

On Wed, Oct 28, 2009 at 10:12 PM, Fishtank  wrote:

>
> Hello,
> I use R 2.9.2 and have written two packages which use a proto file,
> one proto is a subset of the other.
> When I load both packages(one after the other,though order does not
> matter) loading the second causes the following crash
>
> libprotobuf ERROR google/protobuf/descriptor_database.cc:56] File
> already exists in database: rexp.proto
> libprotobuf FATAL google/protobuf/descriptor.cc:857] CHECK failed:
> generated_database_->Add(encoded_file_descriptor, size):
> Abort trap
>
>
> What does this mean, and is there something I'm doing wrong on my
> side?
> Thank you for your time
> Regards
> Saptarshi
>
> >
>

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