Skip to content

Commit 660891e

Browse files
sunjayBhatiawrowe
andauthored
ci: force install/link bazelisk package in macos dependency setup (envoyproxy#10357)
Latest mac os images have bazel pre-installed so force install bazelisk and link with overwrite to allow install to succeed Risk Level: Low Testing: N/A Docs Changes: N/A Release Notes: N/A Co-authored-by: Sunjay Bhatia <[email protected]> Co-authored-by: William A Rowe Jr <[email protected]> Signed-off-by: Sunjay Bhatia <[email protected]> Signed-off-by: William A Rowe Jr <[email protected]>
1 parent f9dd0d2 commit 660891e

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

ci/mac_ci_setup.sh

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22

33
# Installs the dependencies required for a macOS build via homebrew.
44
# Tools are not upgraded to new versions.
5-
6-
# Setup bazelbuild tap
7-
brew tap bazelbuild/tap
5+
# See:
6+
# https://github.com/actions/virtual-environments/blob/master/images/macos/macos-10.15-Readme.md for
7+
# a list of pre-installed tools in the macOS image.
88

99
function is_installed {
1010
brew ls --versions "$1" >/dev/null
1111
}
1212

1313
function install {
1414
echo "Installing $1"
15-
if ! brew install "$1"
16-
then
15+
if ! brew install "$1"; then
1716
echo "Failed to install $1"
1817
exit 1
1918
fi
@@ -24,7 +23,7 @@ if ! brew update; then
2423
exit 1
2524
fi
2625

27-
DEPS="automake bazelbuild/tap/bazelisk cmake coreutils go libtool wget ninja"
26+
DEPS="automake cmake coreutils go libtool wget ninja"
2827
for DEP in ${DEPS}
2928
do
3029
is_installed "${DEP}" || install "${DEP}"
@@ -35,3 +34,12 @@ if [ -n "$CIRCLECI" ]; then
3534
# convert https://github.com to ssh://[email protected], which jgit does not support.
3635
mv ~/.gitconfig ~/.gitconfig_save
3736
fi
37+
38+
# Required as bazel and a foreign bazelisk are installed in the latest macos vm image, we have
39+
# to unlink/overwrite them to install bazelisk
40+
echo "Installing bazelbuild/tap/bazelisk"
41+
brew install --force bazelbuild/tap/bazelisk
42+
if ! brew link --overwrite bazelbuild/tap/bazelisk; then
43+
echo "Failed to install and link bazelbuild/tap/bazelisk"
44+
exit 1
45+
fi

0 commit comments

Comments
 (0)