Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support package specifiers #91

Open
WebDrake opened this issue Aug 12, 2016 · 1 comment
Open

Support package specifiers #91

WebDrake opened this issue Aug 12, 2016 · 1 comment

Comments

@WebDrake
Copy link
Contributor

The proto2 specification allows for imported data structures to be specified precisely using package specifiers, as described here:
https://developers.google.com/protocol-buffers/docs/proto#packages

However, dproto fails to handle package specifiers, emitting an undefined identifier error. This makes it very difficult to have shared .proto definition files between, say, a D app and a Java app (since protoc will fail to compile for Java if the package specifiers are missing).

As an example, consider the two following .proto files:

inner.proto

package innerproto;

message InnerMessage {
    optional uint64 id = 1;
    optional string message = 2;
}

outer.proto

import "inner.proto";

message OuterMessage {
    optional uint64 id = 1;
    optional innerproto.InnerMessage message1 = 2;
    optional innerproto.InnerMessage message2 = 3;
}

If the innerproto. package specifier is removed from outer.proto, then protoc will fail to compile it for Java. OTOH dproto will fail to handle outer.proto if the package specifier is present.

@timotheecour
Copy link
Contributor

timotheecour commented Jul 13, 2017

@msoucy This feature would be great to correctly implement spec and interoperate with systems that use these; how much work would that be? Any pointers (eg what to change) would help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants