-
Notifications
You must be signed in to change notification settings - Fork 11
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
Protobuf import path issue #75
Comments
Seems the change is here: https://protobuf.dev/news/2023-04-20/ |
@chiperific can you provide more context on how you reproduced those warnings? This project uses |
Here's a repo that shows how the warnings appeared in https://github.com/chiperific/authzed-protobuf-check I played with reverting Locally, when I install |
Thanks for the repro! I created a new Rails application, imported the latest
This is going to require some research, as EDIT: I couldn't find a quick way to address this.
The solution I proposed was to vendor the |
Ruby protobuf generator changes described in https://protobuf.dev/news/2023-04-20/ means the generated code is a bit more strict about dependencies and type definitions. This fixes an error reported in runtime, for example, when using in a Rails application ``` Warning: Protobuf detected an import path issue while loading generated file /usr/local/rvm/gems/ruby-3.1.4/gems/authzed-0.7.0/lib/authzed/api/v1/core_pb.rb Each proto file must use a consistent fully-qualified name. This will become an error in the next major version. ``` Inspecting the TypeError exception with a debugger revealed: #<Google::Protobuf::TypeError: Unable to build file to DescriptorPool: Depends on file 'validate/validate.proto', but it has not been loaded> `protoc-gen-validate` does not offer ruby templates for protoc, so for `authzed-rb` the workaround has been to generate an empty stub to satisfy the import, but that does not work anymore with the new generated Ruby code. This commit uses buf to generate the Ruby code for validate/validate.proto and satisfy the missing dependency in the generated authzed API code
Ruby protobuf generator changes described in https://protobuf.dev/news/2023-04-20/ means the generated code is a bit more strict about dependencies and type definitions. This fixes an error reported in runtime, for example, when using in a Rails application ``` Warning: Protobuf detected an import path issue while loading generated file /usr/local/rvm/gems/ruby-3.1.4/gems/authzed-0.7.0/lib/authzed/api/v1/core_pb.rb Each proto file must use a consistent fully-qualified name. This will become an error in the next major version. ``` Inspecting the TypeError exception with a debugger revealed: #<Google::Protobuf::TypeError: Unable to build file to DescriptorPool: Depends on file 'validate/validate.proto', but it has not been loaded> `protoc-gen-validate` does not offer ruby templates for protoc, so for `authzed-rb` the workaround has been to generate an empty stub to satisfy the import, but that does not work anymore with the new generated Ruby code. This commit uses buf to generate the Ruby code for validate/validate.proto and satisfy the missing dependency in the generated authzed API code
@chiperific this should be fixed in https://github.com/authzed/authzed-rb/releases/tag/v0.7.1 |
Can confirm that 0.7.1 has no protobuf errors. Thanks so much! |
Dependencies:
The text was updated successfully, but these errors were encountered: