Skip to content

Commit

Permalink
Remove go installation.
Browse files Browse the repository at this point in the history
Signed-off-by: Lonnie Liu <lonnie@anyscale.com>
  • Loading branch information
aslonnie committed Jun 13, 2023
1 parent c4d6211 commit 4e733bb
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
38 changes: 14 additions & 24 deletions ci/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -339,16 +339,6 @@ install_cython_examples() {
)
}

install_go() {
local gimme_url="https://raw.githubusercontent.com/travis-ci/gimme/master/gimme"
suppress_xtrace eval "$(curl -f -s -L "${gimme_url}" | GIMME_GO_VERSION=1.18.3 bash)"

if [ -z "${GOPATH-}" ]; then
GOPATH="${GOPATH:-${HOME}/go_dir}"
export GOPATH
fi
}

_bazel_build_before_install() {
local target
if [ "${OSTYPE}" = msys ]; then
Expand Down Expand Up @@ -543,17 +533,22 @@ lint_annotations() {
}

lint_bazel() {
# Run buildifier without affecting external environment variables
(
mkdir -p -- "${GOPATH}"
export PATH="${GOPATH}/bin:${GOROOT}/bin:${PATH}"
if [[ ! "${OSTYPE}" =~ ^linux ]]; then
echo "Bazel lint not supported on non-linux systems."
exit 1
fi
if [[ "$(uname -m)" != "x86_64" ]]; then
echo "Bazel lint only supported on x86_64."
exit 1
fi

# Build buildifier
go install github.com/bazelbuild/buildtools/buildifier@latest
LINT_BAZEL_TMP="$(mktemp -d)"
curl -sl "https://github.com/bazelbuild/buildtools/releases/download/v6.1.2/buildifier-linux-amd64" \
-o "${LINT_BAZEL_TMP}/buildifier"
chmod +x "${LINT_BAZEL_TMP}/buildifier"
BUILDIFIER="${LINT_BAZEL_TMP}/buildifier" "${ROOT_DIR}/lint/bazel-format.sh"

# Now run buildifier
"${ROOT_DIR}"/lint/bazel-format.sh
)
rm -rf "${LINT_BAZEL_TMP}" # Clean up
}

lint_bazel_pytest() {
Expand Down Expand Up @@ -655,7 +650,6 @@ _lint() {
}

lint() {
install_go
# Checkout a clean copy of the repo to avoid seeing changes that have been made to the current one
(
WORKSPACE_DIR="$(TMPDIR="${WORKSPACE_DIR}/.." mktemp -d)"
Expand Down Expand Up @@ -764,10 +758,6 @@ build() {
install_cython_examples
fi

if [ "${LINT-}" = 1 ]; then
install_go
fi

if [[ "${NEED_WHEELS}" == "true" ]]; then
build_wheels_and_jars
fi
Expand Down
22 changes: 16 additions & 6 deletions ci/lint/bazel-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

# Before running this script, please make sure golang is installed
# and buildifier is also installed. The example is showed in .travis.yml.
set -e
set -eo pipefail

ROOT_DIR=$(cd "$(dirname "$0")/$(dirname "$(test -L "$0" && readlink "$0" || echo "/")")"; pwd)
BUILDIFIER="${BUILDIFIER:-buildifier}"

function usage()
{
Expand Down Expand Up @@ -43,8 +44,17 @@ while [ $# -gt 0 ]; do
shift
done

pushd "$ROOT_DIR"/../..
BAZEL_FILES=(bazel/BUILD bazel/ray.bzl BUILD.bazel java/BUILD.bazel \
cpp/BUILD.bazel cpp/example/BUILD.bazel WORKSPACE)
buildifier -mode=$RUN_TYPE -diff_command="diff -u" "${BAZEL_FILES[@]}"
popd
BAZEL_FILES=(
bazel/BUILD
bazel/ray.bzl
BUILD.bazel
java/BUILD.bazel
cpp/BUILD.bazel
cpp/example/BUILD.bazel
WORKSPACE
)

(
cd "$ROOT_DIR"/../..
"${BUILDIFIER}" -mode=$RUN_TYPE -diff_command="diff -u" "${BAZEL_FILES[@]}"
)

0 comments on commit 4e733bb

Please sign in to comment.