2022-05-12 06:20:59 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Bazel STRONGLY disapproves of linking dynamically to a Python interpreter.
|
|
|
|
# But ... that's exactly what we want to do.
|
|
|
|
# So this script exists to find a 'compliant' Python install and use that.
|
|
|
|
|
2024-05-14 04:31:23 +00:00
|
|
|
PYTHONREV="3.12"
|
2022-05-12 06:20:59 +00:00
|
|
|
CMD="python${PYTHONREV}"
|
|
|
|
|
|
|
|
if [ -x "$(command -v "$CMD")" ]; then
|
|
|
|
exec "$(which "$CMD")" "$@"
|
|
|
|
else
|
|
|
|
case "$(uname)" in
|
|
|
|
Darwin)
|
|
|
|
# FIXME: What if it isn't there?
|
|
|
|
exec /opt/homebrew/bin/"$CMD" "$@"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
echo "Error: Unable to find a viable Python executable" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|