-
Notifications
You must be signed in to change notification settings - Fork 1.6k
protoc-gen-go: import public should be recursive #695
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
Comments
It seems that this can be addressed in the new API by changing protobuf/reflect/protoreflect/type.go Lines 181 to 183 in b4e370e
to also search the name within any files that were publicly imported (by also calling DescriptorByName which will have the desired recursive effect).
|
I'm fairly certain that the v2 API resolves this since protobuf/reflect/prototype/protofile_desc.go Lines 303 to 320 in 01ab296
However, this behavior is a more liberal than necessary, and validation (when implemented) will need to make sure not to accidentally break this again. |
FYI, the definition of "import public" back when it was introduced (circa 2010) was not transitive. Maybe something changed, but it's possible that C++ is only "accidentally" supporting it. |
Consider the following set of files.
In file
test1.proto
:In file
test2.proto
:In file
test3.proto
:Compiling these with
protoc --go_out=. test3.proto
produces:However, C++ is able to resolve
google.protobuf.FileDescriptorProto
just fine when runningprotoc --cpp_out=. test3.proto
.It seems that the behavior is that indirectly publicly import declarations are exported.
\cc @neild
The text was updated successfully, but these errors were encountered: