0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 01:21:03 +01:00
mongodb/evergreen/bazel_scons_diff.sh
Zack Winter aedbc3ffae SERVER-89241 Create Bazel-SCons Diff Tool (#21020)
GitOrigin-RevId: 1f940d0d50694faf17a6a8ae511c1fe2b6012efc
2024-04-30 03:35:01 +00:00

49 lines
1.3 KiB
Bash

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null 2>&1 && pwd)"
. "$DIR/prelude.sh"
cd src
set -o errexit
set -o verbose
ARCH=$(uname -m)
if [[ "$ARCH" == "arm64" || "$ARCH" == "aarch64" ]]; then
ARCH="arm64"
elif [[ "$ARCH" == "ppc64le" || "$ARCH" == "ppc64" || "$ARCH" == "ppc" || "$ARCH" == "ppcle" ]]; then
ARCH="ppc64le"
elif [[ "$ARCH" == "s390x" || "$ARCH" == "s390" ]]; then
ARCH="s390x"
else
ARCH="amd64"
fi
bazel_binary=$TMPDIR/bazelisk
if [[ $ARCH == "ppc64le" ]] || [[ $ARCH == "s390x" ]]; then
bazel_binary=$TMPDIR/bazel
fi
extra_args="--extra_args \""
extra_args="$extra_args ${compile_flags}"
extra_args="$extra_args --evergreen-tmp-dir=${TMPDIR}"
extra_args="$extra_args\""
activate_venv
if [[ -z "${bazel_scons_diff_targets}" ]]; then
echo "Skipping diff run since bazel_scons_diff_targets was not set"
exit 0
fi
# Set the JAVA_HOME directories for ppc64le and s390x since their bazel binaries are not compiled with a built-in JDK.
if [[ $ARCH == "ppc64le" ]]; then
export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-11.0.4.11-2.el8.ppc64le"
elif [[ $ARCH == "s390x" ]]; then
export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-11.0.11.0.9-0.el8_3.s390x"
fi
eval ${compile_env} $python ./buildscripts/bazel_scons_diff.py \
--bazel_binary ${bazel_binary} \
${extra_args} \
${bazel_scons_diff_targets}
exit $?