Skip to content
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

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

Closed
CherishCai opened this issue Nov 13, 2022 · 3 comments

Comments

@CherishCai
Copy link

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 nacos-group/nacos-sdk-rust#57

@BusyJay
Copy link
Member

BusyJay commented Nov 14, 2022

It's introduced by prost. Check tokio-rs/prost#657 and its related issues/PRs.

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

@BusyJay
Copy link
Member

BusyJay commented Nov 14, 2022

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

  • pregenerate all the source code and add them into version control. That's also how grpcio-proto removes the requirement of protoc.
  • install protoc in every computer you want to generate code in compile time.

@CherishCai
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants