tikv / grpc-rs

The gRPC library for Rust built on C Core library and futures
Apache License 2.0
1.81k stars 253 forks source link

Q: Could not find `protoc` installation when using grpcio=0.12.0 with prost-build=0.11 #599

Closed CherishCai closed 2 years ago

CherishCai commented 2 years ago

Using grpcio=0.11.0 with prost-build=0.10 is OK. What changes brought about? I'm not familiar with it, so I come here for advice.


使用 grpcio=0.11.0 和 prost-build=0.10 是可以的。是哪些改变带来的吗?因为不够熟悉所以来请教下。

error: failed to run custom build command for `nacos-sdk v0.2.0 (/home/runner/work/nacos-sdk-rust/nacos-sdk-rust)`

Caused by:
  process didn't exit successfully: `/home/runner/work/nacos-sdk-rust/nacos-sdk-rust/target/debug/build/nacos-sdk-6ee186b292a91bad/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at 'Could not find `protoc` installation and this build crate cannot proceed without
      this knowledge. If `protoc` is installed and this crate had trouble finding
      it, you can set the `PROTOC` environment variable with the specific path to your
      installed `protoc` binary.If you're on debian, try `apt-get install protobuf3-compiler` or download it from https://github.com/protocolbuffers/protobuf/releases

  For more information: https://docs.rs/prost-build/#sourcing-protoc
  ', /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/prost-build-0.11.2/src/lib.rs:1295:10
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
Error: Process completed with exit code 101.
image

relate https://github.com/nacos-group/nacos-sdk-rust/pull/57

BusyJay commented 2 years ago

It's introduced by prost. Check https://github.com/tokio-rs/prost/pull/657 and its related issues/PRs.

In short, they choose to use user-provided protoc to address the supply chain attack concern.

BusyJay commented 2 years ago

To solve the problem, you need to do either of following:

CherishCai commented 2 years ago

Thanks for your positive reply and suggestions. 感谢大佬 。