While refactoring during migration from tower-grpc to tonic, I started getting strange compiler issues around codegen that weren't about new function signatures being incorrect due to new async types.
After a careful effort of picking apart all my codegen, I narrowed the issue to the generation of models/proto/organization.proto.
When I comment out the import for credential.proto, the compiler errors stop. But uncommented, I get these type related errors for types that are defined in the credential package.
error[E0412]: cannot find type `VcsCredCreateRequest` in module `super`
--> /Users/telant/src/orbitalci/target/debug/build/orbital_headers-33f24b51d23a648e/out/organization.rs:190:53
|
190 | request: impl tonic::IntoRequest<super::VcsCredCreateRequest>,
| ^^^^^^^^^^^^^^^^^^^^ not found in `super`
help: possible candidate is found in another module, you can import it into scope
|
152 | use crate::credential::VcsCredCreateRequest;
[...]
|```
It seems that the cause is generated server + client code in the `organization` package that should only be in the `credential` package. The compiler error is because none of the message types from `credential` generate.
My workaround was to break the proto rpc definitions into another proto file, so that I could import all the message types but none of the service rpc definitions. This is inconvenient, but is usable for now.
Related to #227
While refactoring during migration from
tower-grpc
totonic
, I started getting strange compiler issues around codegen that weren't about new function signatures being incorrect due to new async types.After a careful effort of picking apart all my codegen, I narrowed the issue to the generation of
models/proto/organization.proto
.When I comment out the import for
credential.proto
, the compiler errors stop. But uncommented, I get these type related errors for types that are defined in thecredential
package.https://github.com/level11consulting/orbitalci/blob/85f1d2e938c2d404c7ea133b2e4e3002324cac22/models/protos/organization.proto#L5