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

ci: use bazelisk in macCI and build_image #7739

Merged
merged 2 commits into from
Jul 30, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.28.0
8 changes: 0 additions & 8 deletions ci/build_container/build_container_centos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ yum install -y devtoolset-7-gcc devtoolset-7-gcc-c++ devtoolset-7-binutils java-
ln -s /usr/bin/cmake3 /usr/bin/cmake
ln -s /usr/bin/ninja-build /usr/bin/ninja

BAZEL_VERSION="$(curl -s https://api.github.com/repos/bazelbuild/bazel/releases/latest |
python -c "import json, sys; print json.load(sys.stdin)['tag_name']")"
BAZEL_INSTALLER="bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh"
curl -OL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/${BAZEL_INSTALLER}"
chmod u+x "./${BAZEL_INSTALLER}"
"./${BAZEL_INSTALLER}"
rm "./${BAZEL_INSTALLER}"

# SLES 11 has older glibc than CentOS 7, so pre-built binary for it works on CentOS 7
LLVM_VERSION=8.0.0
LLVM_RELEASE="clang+llvm-${LLVM_VERSION}-x86_64-linux-sles11.3"
Expand Down
21 changes: 15 additions & 6 deletions ci/build_container/build_container_common.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
#!/bin/bash -e

# buildifier
VERSION=0.25.0
SHA256=6e6aea35b2ea2b4951163f686dfbfe47b49c840c56b873b3a7afe60939772fc1
curl --location --output /usr/local/bin/buildifier https://github.com/bazelbuild/buildtools/releases/download/"$VERSION"/buildifier \
&& echo "$SHA256" '/usr/local/bin/buildifier' | sha256sum --check \
&& chmod +x /usr/local/bin/buildifier
if [[ "$(uname -m)" == "x86_64" ]]; then
# buildifier
VERSION=0.28.0
SHA256=3d474be62f8e18190546881daf3c6337d857bf371faf23f508e9b456b0244267
curl --location --output /usr/local/bin/buildifier https://github.com/bazelbuild/buildtools/releases/download/"$VERSION"/buildifier \
&& echo "$SHA256" '/usr/local/bin/buildifier' | sha256sum --check \
&& chmod +x /usr/local/bin/buildifier

# bazelisk
VERSION=0.0.8
SHA256=5fced4fec06bf24beb631837fa9497b6698f34041463d9188610dfa7b91f4f8d
curl --location --output /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/v${VERSION}/bazelisk-linux-amd64 \
&& echo "$SHA256" '/usr/local/bin/bazel' | sha256sum --check \
lizan marked this conversation as resolved.
Show resolved Hide resolved
&& chmod +x /usr/local/bin/bazel
fi
8 changes: 1 addition & 7 deletions ci/build_container/build_container_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ case $ARCH in
ldconfig
;;
'x86_64' )
wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main"
apt-get update
apt-get install -y clang-8 clang-format-8 clang-tidy-8 lld-8 libc++-8-dev libc++abi-8-dev
Expand All @@ -49,12 +49,6 @@ case $ARCH in
-o /usr/local/bin/bazel
chmod +x /usr/local/bin/bazel
;;
'x86_64' )
echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list
curl https://bazel.build/bazel-release.pub.gpg | apt-key add -
apt-get update
apt-get install -y bazel
;;
esac
apt-get install -y aspell
rm -rf /var/lib/apt/lists/*
Expand Down
3 changes: 1 addition & 2 deletions ci/mac_ci_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

# Setup bazelbuild tap
brew tap bazelbuild/tap
brew tap-pin bazelbuild/tap

function is_installed {
brew ls --versions "$1" >/dev/null
Expand All @@ -25,7 +24,7 @@ if ! brew update; then
exit 1
fi

DEPS="automake bazelbuild/tap/bazel cmake coreutils go libtool wget ninja"
DEPS="automake bazelbuild/tap/bazelisk cmake coreutils go libtool wget ninja"
for DEP in ${DEPS}
do
is_installed "${DEP}" || install "${DEP}"
Expand Down