Re: [protobuf] Circular package import problem

2011-02-22 Thread David Yu
On Wed, Feb 23, 2011 at 2:29 AM, Kenton Varda  wrote:

> On Tue, Feb 8, 2011 at 4:14 AM, David Yu  wrote:
>
>> Hmm, so protoc doesn't handle cyclic imports as well.
>> Are there plans to support it in the near future?
>>
>
> No, cyclic imports are not likely to be supported.  Many programming
> languages do not support them, so supporting them in .proto would make it
> hard to support those languages.
>
Makes sense.  Thanks!

> Not to mention, handling cyclic dependencies just between declarations in a
> single .proto file is already ridiculously complicated.
>



-- 
When the cat is away, the mouse is alone.
- David Yu

-- 
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: [protobuf] Circular package import problem

2011-02-22 Thread Kenton Varda
On Tue, Feb 8, 2011 at 4:14 AM, David Yu  wrote:

> Hmm, so protoc doesn't handle cyclic imports as well.
> Are there plans to support it in the near future?
>

No, cyclic imports are not likely to be supported.  Many programming
languages do not support them, so supporting them in .proto would make it
hard to support those languages.  Not to mention, handling cyclic
dependencies just between declarations in a single .proto file is already
ridiculously complicated.

-- 
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: [protobuf] Circular package import problem

2011-02-08 Thread David Yu
On Tue, Feb 8, 2011 at 6:36 AM, Kenton Varda  wrote:

> With protoc (the standard compiler), this should produce a simple error.
>  Since Ken said he "got StackOverFlow exception", it sounds like he's using
> some other compiler (not written in C++).

Hmm, so protoc doesn't handle cyclic imports as well.
Are there plans to support it in the near future?

>
>
> On Mon, Feb 7, 2011 at 10:26 AM, Pherl Liu  wrote:
>
>> You probably need to break up your proto files to eliminate the circular
>> dependency.. (i.e. have multiple .proto files for a package, and only import
>> necessary .proto files).
>>
>>
>> On Mon, Feb 7, 2011 at 5:42 PM, Ken  wrote:
>>
>>> Hi,
>>>
>>> I have two proto files: A.proto and B.proto. If I import package B in
>>> A and import A in B, I got StackOverFlow exception during compiling.
>>> Does anyone know any sulotion for it?
>>>
>>> Thanks,
>>>
>>> Ken
>>>
>>> --
>>> 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.
>>>
>>>
>>  --
>> 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.
>>
>
>  --
> 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.
>



-- 
When the cat is away, the mouse is alone.
- David Yu

-- 
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: [protobuf] Re: Circular package import problem

2011-02-08 Thread David Yu
On Tue, Feb 8, 2011 at 8:04 PM, Ken  wrote:

> I am using protostuff-maven-plugin 1.0.0.M7. Currently I have to put
> all classes into one big proto file. multiple .proto files can't avoid
> cross referencing
>
You're posting in the wrong googlegroups :-)
Might wanna file a bug report on the googlecode issue tracker of protostuff.

>
> On Feb 7, 10:36 pm, Kenton Varda  wrote:
> > With protoc (the standard compiler), this should produce a simple error.
> >  Since Ken said he "got StackOverFlow exception", it sounds like he's
> using
> > some other compiler (not written in C++).
> >
> > On Mon, Feb 7, 2011 at 10:26 AM, Pherl Liu  wrote:
> > > You probably need to break up your proto files to eliminate the
> circular
> > > dependency.. (i.e. have multiple .proto files for a package, and only
> import
> > > necessary .proto files).
> >
> > > On Mon, Feb 7, 2011 at 5:42 PM, Ken  wrote:
> >
> > >> Hi,
> >
> > >> I have two proto files: A.proto and B.proto. If I import package B in
> > >> A and import A in B, I got StackOverFlow exception during compiling.
> > >> Does anyone know any sulotion for it?
> >
> > >> Thanks,
> >
> > >> Ken
> >
> > >> --
> > >> 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.
> >
> > >  --
> > > 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.
>
> --
> 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.
>
>


-- 
When the cat is away, the mouse is alone.
- David Yu

-- 
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: Circular package import problem

2011-02-08 Thread Ken
I am using protostuff-maven-plugin 1.0.0.M7. Currently I have to put
all classes into one big proto file. multiple .proto files can't avoid
cross referencing

On Feb 7, 10:36 pm, Kenton Varda  wrote:
> With protoc (the standard compiler), this should produce a simple error.
>  Since Ken said he "got StackOverFlow exception", it sounds like he's using
> some other compiler (not written in C++).
>
> On Mon, Feb 7, 2011 at 10:26 AM, Pherl Liu  wrote:
> > You probably need to break up your proto files to eliminate the circular
> > dependency.. (i.e. have multiple .proto files for a package, and only import
> > necessary .proto files).
>
> > On Mon, Feb 7, 2011 at 5:42 PM, Ken  wrote:
>
> >> Hi,
>
> >> I have two proto files: A.proto and B.proto. If I import package B in
> >> A and import A in B, I got StackOverFlow exception during compiling.
> >> Does anyone know any sulotion for it?
>
> >> Thanks,
>
> >> Ken
>
> >> --
> >> 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.
>
> >  --
> > 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.

-- 
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: [protobuf] Circular package import problem

2011-02-07 Thread Kenton Varda
With protoc (the standard compiler), this should produce a simple error.
 Since Ken said he "got StackOverFlow exception", it sounds like he's using
some other compiler (not written in C++).

On Mon, Feb 7, 2011 at 10:26 AM, Pherl Liu  wrote:

> You probably need to break up your proto files to eliminate the circular
> dependency.. (i.e. have multiple .proto files for a package, and only import
> necessary .proto files).
>
>
> On Mon, Feb 7, 2011 at 5:42 PM, Ken  wrote:
>
>> Hi,
>>
>> I have two proto files: A.proto and B.proto. If I import package B in
>> A and import A in B, I got StackOverFlow exception during compiling.
>> Does anyone know any sulotion for it?
>>
>> Thanks,
>>
>> Ken
>>
>> --
>> 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.
>>
>>
>  --
> 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.
>

-- 
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: [protobuf] Circular package import problem

2011-02-07 Thread Pherl Liu
You probably need to break up your proto files to eliminate the circular
dependency.. (i.e. have multiple .proto files for a package, and only import
necessary .proto files).

On Mon, Feb 7, 2011 at 5:42 PM, Ken  wrote:

> Hi,
>
> I have two proto files: A.proto and B.proto. If I import package B in
> A and import A in B, I got StackOverFlow exception during compiling.
> Does anyone know any sulotion for it?
>
> Thanks,
>
> Ken
>
> --
> 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.
>
>

-- 
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] Circular package import problem

2011-02-07 Thread Ken
Hi,

I have two proto files: A.proto and B.proto. If I import package B in
A and import A in B, I got StackOverFlow exception during compiling.
Does anyone know any sulotion for it?

Thanks,

Ken

-- 
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: import problem

2009-09-28 Thread Kenton Varda
On Mon, Sep 28, 2009 at 9:44 AM, Michi  wrote:

>
> Hello,
>
> I have defined the following messages:
>
> package myapp.proto.modules.diagnostics;
>
> message DiagnosticsConfigMessage {
>optional bool watchdog_enabled = 1;
>optional uint32 watchdog_timeout = 2;
> }
>
> package myapp.proto;
>
> import "src/myapp/proto/modules/diagnostics/DiagnosticsConfig.proto";
>
> message ViewServerMessage {
>...
>optional DiagnosticsConfig set_diagnostics_config = 8;
>

This needs to be:

  optional modules.diagnostics.DiagnosticsConfig set_diagnostics_config = 8;

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



import problem

2009-09-28 Thread Michi

Hello,

I have defined the following messages:

package myapp.proto.modules.diagnostics;

message DiagnosticsConfigMessage {
optional bool watchdog_enabled = 1;
optional uint32 watchdog_timeout = 2;
}

package myapp.proto;

import "src/myapp/proto/modules/diagnostics/DiagnosticsConfig.proto";

message ViewServerMessage {
...
optional DiagnosticsConfig set_diagnostics_config = 8;
...
}

The first message is in src/myapp/proto and the second is in src/myapp/
proto/modules/diagnostics

When I try to compile Java classes with

 c:\users\myname\bin\protoc.exe --proto_path="C:\projects\MyApp.root
\MyApp" --java_out "C:\projects\MyApp.root\MyApp\build\generated-
sources\protobuf-java" "C:\projects\MyApp.root\MyApp\src\myapp\proto
\ViewServer.proto"

I always get an error message:
src/myapp/proto/ViewServer.proto:20:14: "DiagnosticsConfigMessage" is
not defined. How is it possible to include a message defined in a
subdirectory? Defining all messages in the same namespace would work,
but it is quite ugly and I would like to avoid this if possible.

I am using protoc.exe 2.0.3 on Windows.

--~--~-~--~~~---~--~~
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: Recursive import problem

2009-08-13 Thread Kenton Varda
Sorry, but mutually recursive messages must be declared in a single file.
 It would be excessively complicated to support cyclically dependent files
under the current implementation.

On Thu, Aug 13, 2009 at 11:34 AM, Justin Muncaster <
justin.muncas...@gmail.com> wrote:

>
> I have the following message structure:
>
> ===A.proto===
> message A
> {
>  optional B1 b1 = 1;
> }
>
> message B1
> {
>  optional A a = 1;
> }
>
> Everything works as intended when the messages are in the same file.
> However, in my situation there are several child messages (B2,
> B3, ...) which all naturally all go in their own separate files
> (B2.proto, B3.proto, ...). Unfortunately, B1 cannot go in its own file
> due to a problem with a recursive import.
>
> Is there any way to solve this? Can I "forward declare" messages?
>
> Thanks,
>
> Justin
>
> >
>

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



Recursive import problem

2009-08-13 Thread Justin Muncaster

I have the following message structure:

===A.proto===
message A
{
  optional B1 b1 = 1;
}

message B1
{
  optional A a = 1;
}

Everything works as intended when the messages are in the same file.
However, in my situation there are several child messages (B2,
B3, ...) which all naturally all go in their own separate files
(B2.proto, B3.proto, ...). Unfortunately, B1 cannot go in its own file
due to a problem with a recursive import.

Is there any way to solve this? Can I "forward declare" messages?

Thanks,

Justin

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