Pass Apple Rust build tools into Bazel actions
Some checks failed
Build Rust / Cargo Test (push) Successful in 4m5s
Build Site / Next.js Build (push) Failing after 6s
Lint Governance / BEP Metadata (push) Successful in 1s

This commit is contained in:
Conrad Kramer 2026-06-07 10:45:30 -07:00
parent 5150faad99
commit ddbfa47587
4 changed files with 29 additions and 3 deletions

View file

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