Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: switch md5 cmd name based on existence #124293

Merged
merged 1 commit into from
May 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions tools/claim_output_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@ if [ ! -z "${BAZEL_OUTPUT_BASE-}" ]; then
return
fi

if [ -d "${HOME}/.cache/bazel/_bazel_${USER}" ]; then
if which md5 > /dev/null; then
SUFFIX="$(pwd | md5 | head -c6)"
else
SUFFIX="$(pwd | md5sum | head -c6)"
fi

if [ -d "${HOME}/.cache/bazel/_bazel_${USER}" ]; then
OUTPUT_ROOT="${HOME}/.cache/bazel/_bazel_${USER}"
elif [ -d "/private/var/tmp/_bazel_${USER}" ]; then
SUFFIX="$(pwd | md5 | head -c6)"
OUTPUT_ROOT="/private/var/tmp/_bazel_${USER}"
else
# the known places for output_bases don't exist so just let bazel figure it out.
Expand Down
Loading