I'm working on a Rust project that requires `protoc`, the Protobuf compiler, and I'm trying to set it up in my GitHub Actions workflow. Here's what I have:
```yaml
build-test-deploy:
runs-on: ubuntu-latest
...
- name: Install protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Test
run: |
which protoc
export PROTOC=/usr/bin/protoc
```
Under the `env` section, I also set:
```yaml
env:
AWS_REGION: "us-east-2"
...
PROTOC: "/usr/bin/protoc"
```
The command `which protoc` returns the correct path: `/usr/bin/protoc`. Despite this, the build is failing with the error:
```
Error: Custom { kind: NotFound, error: "Could not find `protoc`. If `protoc` is installed, try setting the `PROTOC` environment variable to the path of the `protoc` binary. To install it on Debian, run `apt-get install protobuf-compiler`. It is also available at https://github.com/protocolbuffers/protobuf/releases For more information: https://docs.rs/prost-build/#sourcing-protoc" }
```
I'm feeling a bit stuck here and looking for any advice or tips!
2 Answers
You might want to check out the `arduino/setup-protoc` GitHub Action. It's specifically made for setting up `protoc`, and it could simplify your workflow. I've heard mixed results, but it's worth a shot!
Have you tried adding `/usr/bin` to the runner's PATH? Sometimes, even if `protoc` is installed, the build process may not have access to its location. You could also try explicitly calling the path to `protoc` in your build steps if that’s an option for you.
Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically