Pass Apple Rust build tools into Bazel actions
This commit is contained in:
parent
5150faad99
commit
ddbfa47587
4 changed files with 29 additions and 3 deletions
|
|
@ -84,12 +84,20 @@ else
|
|||
fi
|
||||
|
||||
if [[ -x "$(command -v rustup)" ]]; then
|
||||
CARGO_PATH="$(dirname $(rustup which cargo)):/usr/bin"
|
||||
CARGO_PATH="$(dirname "$(rustup which cargo)"):/usr/bin"
|
||||
else
|
||||
CARGO_PATH="$(dirname $(readlink -f $(which cargo))):/usr/bin"
|
||||
CARGO_PATH="$(dirname "$(command -v cargo)"):/usr/bin"
|
||||
fi
|
||||
|
||||
PROTOC=$(readlink -f $(which protoc))
|
||||
if [[ -n "${PROTOC:-}" ]]; then
|
||||
if [[ ! -x "$PROTOC" ]]; then
|
||||
echo "error: PROTOC is set but is not executable: $PROTOC" >&2
|
||||
exit 127
|
||||
fi
|
||||
elif ! PROTOC="$(command -v protoc 2>/dev/null)"; then
|
||||
echo 'error: Unable to find protoc; pass PROTOC or include it in PATH for the Xcode Rust build phase' >&2
|
||||
exit 127
|
||||
fi
|
||||
CARGO_PATH="$(dirname $PROTOC):$CARGO_PATH"
|
||||
|
||||
# Run cargo without the various environment variables set by Xcode.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue