cosmos-rust: Proto-build fails for SDK 0.46
The cosmos-sdk repo since v0.46.0 no longer includes a third_party/proto folder. Instead, it uses a buf.yml config file to define dependencies. However, proto-build does not support this; executing cargo run now results in the following error:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: "protoc failed: gogoproto/gogo.proto: File not found.\ngoogle/protobuf/any.proto:35:1: Import \"gogoproto/gogo.proto\" was not found or had errors.\ngoogle/api/annotations.proto: File not found.\ncosmos_proto/cosmos.proto: File not found.\ncosmos/auth/v1beta1/auth.proto:4:1: Import \"cosmos_proto/cosmos.proto\" was not found or had errors.\ncosmos/auth/v1beta1/auth.proto:5:1: Import \"gogoproto/gogo.proto\" was not found or had errors.\ncosmos/auth/v1beta1/auth.proto:6:1: Import \"google/protobuf/any.proto\" was not found or had errors.\ncosmos/auth/v1beta1/auth.proto:21:3: \"google.protobuf.Any\" is not defined.\ncosmos/auth/v1beta1/query.proto:5:1: Import \"gogoproto/gogo.proto\" was not found or had errors.\ncosmos/auth/v1beta1/query.proto:6:1: Import \"google/protobuf/any.proto\" was not found or had errors.\ncosmos/auth/v1beta1/query.proto:7:1: Import \"google/api/annotations.proto\" was not found or had errors.\ncosmos/auth/v1beta1/query.proto:8:1: Import \"cosmos/auth/v1beta1/auth.proto\" was not found or had errors.\ncosmos/auth/v1beta1/query.proto:9:1: Import \"cosmos_proto/cosmos.proto\" was not found or had errors.\ncosmos/auth/v1beta1/query.proto:86:12: \"google.protobuf.Any\" is not defined.\ncosmos/auth/v1beta1/query.proto:104:3: \"google.protobuf.Any\" is not defined.\ncosmos/auth/v1beta1/query.proto:113:3: \"Params\" is not defined.\ncosmos/auth/v1beta1/query.proto:125:12: \"google.protobuf.Any\" is not defined.\ncosmos/auth/v1beta1/query.proto:135:3: \"google.protobuf.Any\" is not defined.\n" }', proto-build/src/main.rs:254:10
Apparently, it cannot locate the gogoproto dependency.
I do not know a good solution to this. Any suggestion?
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 3
- Comments: 18 (15 by maintainers)
Looking at @apollo-sturdy’s branch it seems like
protoc-gen-prostis probably the best way forward to me if upstream Cosmos SDK has switched to usingbuf.I can try to put together a PR for that unless someone else is particularly interested.
I can also merge #289 to unblock people until we have fully working automation again, at least if the test failures were fixed.
So I got it to work for
wasmd>= 0.29.0 by generating the files via buf with the help of this repo: https://github.com/neoeinstein/protoc-gen-prostMy changes can be found here: https://github.com/apollodao/cosmos-rust/tree/dev/generate-via-buf I will open a PR for this.
Unfourtunately it seems there are manual changes needed to
cosmrsto support cosmos-sdk 0.46. Since I don’t need it and am not familiar with the codebase I will leave these changes to someone else. I did however test generating the protos for cosmos-sdk 0.46.10 via buf and it works. I also included a buf yaml config file in my fork for those who want to make the changes needed tocosmrs.