{"action":"created","issue":{"url":"https://api.github.com/repos/protocolbuffers/protobuf/issues/5415","repository_url":"https://api.github.com/repos/protocolbuffers/protobuf","labels_url":"https://api.github.com/repos/protocolbuffers/protobuf/issues/5415/labels{/name}","comments_url":"https://api.github.com/repos/protocolbuffers/protobuf/issues/5415/comments","events_url":"https://api.github.com/repos/protocolbuffers/protobuf/issues/5415/events","html_url":"https://github.com/protocolbuffers/protobuf/issues/5415","id":386304379,"node_id":"MDU6SXNzdWUzODYzMDQzNzk=","number":5415,"title":"Inconsistent behaviour when FileDescriptorProto is missing custom extensions dependencies ","user":{"login":"vishen","id":1715545,"node_id":"MDQ6VXNlcjE3MTU1NDU=","avatar_url":"https://avatars0.githubusercontent.com/u/1715545?v=4","gravatar_id":"","url":"https://api.github.com/users/vishen","html_url":"https://github.com/vishen","followers_url":"https://api.github.com/users/vishen/followers","following_url":"https://api.github.com/users/vishen/following{/other_user}","gists_url":"https://api.github.com/users/vishen/gists{/gist_id}","starred_url":"https://api.github.com/users/vishen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vishen/subscriptions","organizations_url":"https://api.github.com/users/vishen/orgs","repos_url":"https://api.github.com/users/vishen/repos","events_url":"https://api.github.com/users/vishen/events{/privacy}","received_events_url":"https://api.github.com/users/vishen/received_events","type":"User","site_admin":false},"labels":[{"id":314289982,"node_id":"MDU6TGFiZWwzMTQyODk5ODI=","url":"https://api.github.com/repos/protocolbuffers/protobuf/labels/protoc","name":"protoc","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-30T18:42:28Z","updated_at":"2018-11-30T22:05:52Z","closed_at":null,"author_association":"NONE","body":"**What version of protobuf and what language are you using?**\r\nVersion: v3.6.1\r\nLanguage: Java\r\n**What operating system (Linux, Windows, ...) and version?**\r\nLinux jonathan 4.15.0-39-generic 42-Ubuntu SMP Tue Oct 23 15:48:01 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux\r\n\r\n**What did you do?**\r\nWe have a tool where we create a [FileDescriptorProto](https://github.com/protocolbuffers/protobuf/blob/704037f23a9ede00ec4fcf40d568712ce6200934/src/google/protobuf/descriptor.proto#L61) manually and then pass that to `protoc --python_out=. --descriptor_set_in=/dev/stdin all.proto` via stdin.\r\n\r\nWhen using the google api annotations as custom extensions on the `MethodOptions` which are options for `MethodDescriptorProto`, we were not adding the `google/api/annotations.proto` dependency.\r\n\r\nWhen running the protoc generator for Python, or any language other than Java, protoc succeeds. However, when we run it for the Java generator `--java_out=`, it generates this error:\r\n\r\n```\r\n[libprotobuf FATAL ../../../../../src/google/protobuf/compiler/java/java_file.cc:129] CHECK failed: file_proto_desc: Find unknown fields in FileDescriptorProto when building all.proto. It's likely that those fields are custom options, however, descriptor.proto is not in the transitive dependencies. This normally should not happen. Please report a bug.\r\nterminate called after throwing an instance of 'google::protobuf::FatalException'\r\n  what():  CHECK failed: file_proto_desc: Find unknown fields in FileDescriptorProto when building all.proto. It's likely that those fields are custom options, however, descriptor.proto is not in the transitive dependencies. This normally should not happen. Please report a bug.\r\n```\r\n\r\nThen when I add the missing dependency, everything works fine.\r\n\r\nI realise that this was an error on our behalf, but there seems to be some inconsistency between Java and the other generators in protoc when it comes to missing dependencies for custom extensions / options. I am just curious as to what the expected behaviour should be; \r\n\r\n1) should protoc error if custom extensions dependencies are missing\r\n2) protoc should ignore custom extensions when generating code\r\n"},"comment":{"url":"https://api.github.com/repos/protocolbuffers/protobuf/issues/comments/443353979","html_url":"https://github.com/protocolbuffers/protobuf/issues/5415#issuecomment-443353979","issue_url":"https://api.github.com/repos/protocolbuffers/protobuf/issues/5415","id":443353979,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MzM1Mzk3OQ==","user":{"login":"BSBandme","id":5126482,"node_id":"MDQ6VXNlcjUxMjY0ODI=","avatar_url":"https://avatars0.githubusercontent.com/u/5126482?v=4","gravatar_id":"","url":"https://api.github.com/users/BSBandme","html_url":"https://github.com/BSBandme","followers_url":"https://api.github.com/users/BSBandme/followers","following_url":"https://api.github.com/users/BSBandme/following{/other_user}","gists_url":"https://api.github.com/users/BSBandme/gists{/gist_id}","starred_url":"https://api.github.com/users/BSBandme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BSBandme/subscriptions","organizations_url":"https://api.github.com/users/BSBandme/orgs","repos_url":"https://api.github.com/users/BSBandme/repos","events_url":"https://api.github.com/users/BSBandme/events{/privacy}","received_events_url":"https://api.github.com/users/BSBandme/received_events","type":"User","site_admin":false},"created_at":"2018-11-30T22:05:52Z","updated_at":"2018-11-30T22:05:52Z","author_association":"CONTRIBUTOR","body":"Hi Would you please provide a concrete example that shows the behavior difference between java and other languages?"}}
{"actor":{"display_login":"BSBandme"}}