arduino / setup-protoc

GitHub Action to setup the protoc compiler for protocol buffers
GNU General Public License v3.0
134 stars 58 forks source link

Unable to find protoc installation for some architectures #98

Closed shashitnak closed 6 months ago

shashitnak commented 6 months ago

Describe the problem

Even after running the this action, our project isn't able to find the protoc installation. Getting the error below

error: failed to run custom build command for `async-graphql-extension-apollo-tracing v3.2.14`

Caused by:
  process didn't exit successfully: `/target/release/build/async-graphql-extension-apollo-tracing-717675847b3f881b/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=proto/agents.proto
  cargo:rerun-if-changed=proto/reports.proto
  cargo:rerun-if-changed=.

  --- stderr
  thread 'main' panicked at /cargo/registry/src/index.crates.io-6f17d22bba15001f/prost-build-0.12.3/src/lib.rs:1521:10:
  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 protobuf-compiler` or download it from https://github.com/protocolbuffers/protobuf/releases

  For more information: https://docs.rs/prost-build/#sourcing-protoc

  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 123.

More information about the build is present here https://github.com/tailcallhq/tailcall/actions/runs/8242720704/job/22542201296?pr=1380

If fails for the following targets

To reproduce

  1. Install protoc using this github action
  2. Build https://github.com/tailcallhq/tailcall/tree/apollo-integration

Expected behavior

Build should succeed because protoc should be installed by the action but the build fails because it is unable to find the installation

'arduino/setup-protoc' version

v26.0-rc3

Additional context

No response

Issue checklist

alessio-perugini commented 6 months ago

@shashitnak The problem seems to be that you're using a container to do cross-build for: linux-x64-musl, linux-arm64-gnu, linux-arm64-musl, linux-ia32-gnu, and win32-ia32-gnu. It seems that you have 2 problems:

  1. Related to the missing protoc
  2. For win build without cross-compilation, I see other errors not related to protoc.

Unfortunately, I can give you some hints only for the first point. When using GithubActions the setup-protoc (and similar actions) install the tool in the base os. If you're using an action that runs a container, all the tools you have installed in the base OS aren't available in the container. In your case, the cargo-action you're using for cross-compiling, under the hood uses the cross-rs which seems to perform the compilation in a container.

If you can mount the protoc binary in the cross-rs container you should solve the problem.