[ubuntu] Configure USE_BAZEL_FALLBACK_VERSION for Bazelisk (#13605)

This commit is contained in:
Bradley Smith
2026-01-30 12:04:02 +00:00
committed by GitHub
parent eb6c1eedb2
commit 1e180d61ea
+10 -2
View File
@@ -6,11 +6,19 @@
# Source the helpers for use with the script
source $HELPER_SCRIPTS/install.sh
source $HELPER_SCRIPTS/etc-environment.sh
# Install bazelisk
npm install -g @bazel/bazelisk
# run bazelisk once in order to install /usr/local/bin/bazel binary
sudo -u $SUDO_USER bazel version
# Run bazelisk once in order to install /usr/local/bin/bazel binary
bazel version
# Get the installed Bazel version from bazelisk
BAZEL_VERSION=$(bazel --version | grep "Build label:" | awk '{print $3}')
# Set USE_BAZEL_FALLBACK_VERSION so that users without .bazelversion
# get the preinstalled version instead of downloading latest
set_etc_environment_variable "USE_BAZEL_FALLBACK_VERSION" "silent:${BAZEL_VERSION}"
invoke_tests "Tools" "Bazel"