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

warning: already initialized constant Google::Protobuf::FileDescriptorSet #425

Closed
ykitamura-mdsol opened this issue Sep 17, 2021 · 1 comment

Comments

@ykitamura-mdsol
Copy link

When using with the latest version of google-protobuf 3.18.0, the gem starts producing these warnings:

../gems/google-protobuf-3.18.0-universal-darwin/lib/google/protobuf/descriptor_pb.rb:9: warning: already initialized constant Google::Protobuf::FileDescriptorSet
../gems/protobuf-cucumber-3.10.8/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb:15: warning: previous definition of FileDescriptorSet was here
../gems/google-protobuf-3.18.0-universal-darwin/lib/google/protobuf/descriptor_pb.rb:10: warning: already initialized constant Google::Protobuf::FileDescriptorProto
../gems/protobuf-cucumber-3.10.8/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb:16: warning: previous definition of FileDescriptorProto was here
../gems/google-protobuf-3.18.0-universal-darwin/lib/google/protobuf/descriptor_pb.rb:11: warning: already initialized constant Google::Protobuf::DescriptorProto
../gems/protobuf-cucumber-3.10.8/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb:17: warning: previous definition of DescriptorProto was here
../gems/google-protobuf-3.18.0-universal-darwin/lib/google/protobuf/descriptor_pb.rb:15: warning: already initialized constant Google::Protobuf::FieldDescriptorProto
../gems/protobuf-cucumber-3.10.8/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb:23: warning: previous definition of FieldDescriptorProto was here
../gems/google-protobuf-3.18.0-universal-darwin/lib/google/protobuf/descriptor_pb.rb:18: warning: already initialized constant Google::Protobuf::OneofDescriptorProto
../gems/protobuf-cucumber-3.10.8/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb:53: warning: previous definition of OneofDescriptorProto was here
../gems/google-protobuf-3.18.0-universal-darwin/lib/google/protobuf/descriptor_pb.rb:19: warning: already initialized constant Google::Protobuf::EnumDescriptorProto
../gems/protobuf-cucumber-3.10.8/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb:54: warning: previous definition of EnumDescriptorProto was here
../gems/google-protobuf-3.18.0-universal-darwin/lib/google/protobuf/descriptor_pb.rb:21: warning: already initialized constant Google::Protobuf::EnumValueDescriptorProto
../gems/protobuf-cucumber-3.10.8/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb:55: warning: previous definition of EnumValueDescriptorProto was here
../gems/google-protobuf-3.18.0-universal-darwin/lib/google/protobuf/descriptor_pb.rb:22: warning: already initialized constant Google::Protobuf::ServiceDescriptorProto
../gems/protobuf-cucumber-3.10.8/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb:56: warning: previous definition of ServiceDescriptorProto was here
../gems/google-protobuf-3.18.0-universal-darwin/lib/google/protobuf/descriptor_pb.rb:23: warning: already initialized constant Google::Protobuf::MethodDescriptorProto
../gems/protobuf-cucumber-3.10.8/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb:57: warning: previous definition of MethodDescriptorProto was here
../gems/google-protobuf-3.18.0-universal-darwin/lib/google/protobuf/descriptor_pb.rb:24: warning: already initialized constant Google::Protobuf::FileOptions
../gems/protobuf-cucumber-3.10.8/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb:58: warning: previous definition of FileOptions was here
../gems/google-protobuf-3.18.0-universal-darwin/lib/google/protobuf/descriptor_pb.rb:26: warning: already initialized constant Google::Protobuf::MessageOptions
../gems/protobuf-cucumber-3.10.8/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb:67: warning: previous definition of MessageOptions was here
../gems/google-protobuf-3.18.0-universal-darwin/lib/google/protobuf/descriptor_pb.rb:27: warning: already initialized constant Google::Protobuf::FieldOptions
../gems/protobuf-cucumber-3.10.8/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb:68: warning: previous definition of FieldOptions was here
../gems/google-protobuf-3.18.0-universal-darwin/lib/google/protobuf/descriptor_pb.rb:31: warning: already initialized constant Google::Protobuf::EnumOptions
../gems/protobuf-cucumber-3.10.8/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb:83: warning: previous definition of EnumOptions was here
../gems/google-protobuf-3.18.0-universal-darwin/lib/google/protobuf/descriptor_pb.rb:32: warning: already initialized constant Google::Protobuf::EnumValueOptions
../gems/protobuf-cucumber-3.10.8/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb:84: warning: previous definition of EnumValueOptions was here
../gems/google-protobuf-3.18.0-universal-darwin/lib/google/protobuf/descriptor_pb.rb:33: warning: already initialized constant Google::Protobuf::ServiceOptions
../gems/protobuf-cucumber-3.10.8/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb:85: warning: previous definition of ServiceOptions was here
../gems/google-protobuf-3.18.0-universal-darwin/lib/google/protobuf/descriptor_pb.rb:34: warning: already initialized constant Google::Protobuf::MethodOptions
../gems/protobuf-cucumber-3.10.8/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb:86: warning: previous definition of MethodOptions was here
../gems/google-protobuf-3.18.0-universal-darwin/lib/google/protobuf/descriptor_pb.rb:36: warning: already initialized constant Google::Protobuf::UninterpretedOption
../gems/protobuf-cucumber-3.10.8/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb:87: warning: previous definition of UninterpretedOption was here
../gems/google-protobuf-3.18.0-universal-darwin/lib/google/protobuf/descriptor_pb.rb:38: warning: already initialized constant Google::Protobuf::SourceCodeInfo
../gems/protobuf-cucumber-3.10.8/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb:92: warning: previous definition of SourceCodeInfo was here

Probably this PR is the cause: protocolbuffers/protobuf#8850

I assume google/protobuf/descriptor.pb doesn't need to be required when using with google-protobuf >= 3.18.0:

require 'google/protobuf/descriptor.pb'

@film42
Copy link
Member

film42 commented Sep 17, 2021

Thanks for opening an issue. I think you're using google's ruby protobuf lib. Please open an issue here: https://github.com/protocolbuffers/protobuf

@film42 film42 closed this as completed Sep 17, 2021
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