For $DAYJOB, we're writing a number of microservices in Golang, using gRPC and Protobuf.
Although I like Golang, I also like the look of Rust, and I want to try out making a Rust version of our microservices. For now, I'm using the article Building gRPC Services in Go and Rust | by Kevin Hoffman | Medium as a basis for what I'm doing (since I don't yet understand the moving parts enough to figure it out from scratch).
I've adapted the source code from there so that the build.rs
file points to my own .proto file, but it won't compile because of an import line:
import "google/api/annotations.proto";
That .proto file is pulled in from a vendored repo located at https://github.com/googleapis/googleapis, which I added to my Cargo.toml
file:
[build-dependencies]
protoc-rust-grpc = "0.2.1"
googleapis = { git = "https://github.com/googleapis/googleapis.git" }
Unfortunately, Cargo doesn't like it:
$ cargo build
Updating git repository *****googleapis/googleapis.git
error: failed to load source for a dependency on `googleapis`
Caused by:
Unable to update *****googleapis/googleapis.git
Caused by:
Could not find Cargo.toml in /Users/steve/.cargo/git/checkouts/googleapis-a7f621c154b81d93/62273f2
Is there any way to work around a repository not having a Cargo.toml
file? Am I trying something that is likely to never work, or is there another way for me to resolve this (other than simply copying the necessary files straight into my project, which would work but feels inelegant)?
Help is much appreciated, and I apologise in advance if I'm asking a dumb question for my first one!
(Note: had to edit the URLs because I'm new here!)