Closed devpikachu closed 1 year ago
Ah, I just saw this issue. This should be a simple fix.
Actually, I'm a bit confused as to how this is happening. From reading the GH Actions docs it seems like appending to $GITHUB_PATH
should just add a directory, not wipe out any that already exist. Can you point me to workflow you're using that's having this issue?
Hey @autarch ! Thanks for replying. Of course, see below:
I wrote some tests to check for this. AFAICT it's not overwriting the $PATH
. See https://github.com/houseabsolute/actions-rust-cross/actions/runs/4399492494/jobs/7704067598#step:7:10
Oh wait, I see what's happening. The problem is that builds for non-native architectures are run inside a Docker container. That container doesn't have protoc in it.
There's a number of ways to solve this but I think the simplest is to add pre-build hooks for cross that install protoc -https://github.com/cross-rs/cross#pre-build-hook
You might find my ubi
project handy for this.
I'm going to close this since it's not a bug with the action. But on the plus side, it got me to write some tests for it, which is great!
I just realized ubi
won't work with the protobuf project, since it ships more than just a binary in its releases.
@autarch Thank you so much for looking into this and for providing this very valuable insight. It makes perfect sense why it doesn't work and it totally slipped my mind checking for the fact that it runs inside a docker container.
I will go about adding pre-build hooks as linked above.
Trying to use this action in my pipeline, and currently, the action overwrites
GITHUB_PATH
, thus making other installed tools unusable, such asprotoc
in my case.https://github.com/houseabsolute/actions-rust-cross/blob/9a602122c2f4df61140216897231df93c0922a22/action.yml#LL29C12-L29C60