Skip to content

Commit

Permalink
[bazel] use .bazelversion file (#45476)
Browse files Browse the repository at this point in the history
cleaner to write, and easier to parse

Signed-off-by: Lonnie Liu <[email protected]>
  • Loading branch information
aslonnie authored May 21, 2024
1 parent cd3d3b7 commit 7d516c2
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 10 deletions.
1 change: 0 additions & 1 deletion .bazeliskrc

This file was deleted.

1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5.4.1
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,5 @@ workflow_data/
# Auto-generated tag mapping
tag-mapping.json

.bazeliskrc

# Temporary files generated by import sorting linter.
*.isorted
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ grpc_extra_deps()

load("@bazel_skylib//lib:versions.bzl", "versions")

# Please keep this in sync with the .bazeliskrc file.
# Please keep this in sync with the .bazelversion file.
versions.check(minimum_bazel_version = "5.4.1")

# Tools to generate `compile_commands.json` to enable awesome tooling of the C language family.
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/base.gpu.py39.wanda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ froms: ["nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04"]
dockerfile: ci/docker/base.gpu.Dockerfile
srcs:
- .bazelrc
- .bazeliskrc
- .bazelversion
- ci/ci.sh
- ci/env/install-dependencies.sh
- ci/env/install-llvm-binaries.sh
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/base.gpu.wanda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ froms: ["nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04"]
dockerfile: ci/docker/base.gpu.Dockerfile
srcs:
- .bazelrc
- .bazeliskrc
- .bazelversion
- ci/ci.sh
- ci/env/install-dependencies.sh
- ci/env/install-llvm-binaries.sh
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/base.test.aarch64.wanda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ froms: ["ubuntu:focal"]
dockerfile: ci/docker/base.test.Dockerfile
srcs:
- ci/env/install-bazel.sh
- .bazeliskrc
- .bazelversion
build_args:
- BUILDKITE_BAZEL_CACHE_URL
tags:
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/base.test.py39.wanda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ froms: ["ubuntu:focal"]
dockerfile: ci/docker/base.test.Dockerfile
srcs:
- ci/env/install-bazel.sh
- .bazeliskrc
- .bazelversion
build_args:
- BUILDKITE_BAZEL_CACHE_URL
tags:
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/base.test.wanda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ froms: ["ubuntu:focal"]
dockerfile: ci/docker/base.test.Dockerfile
srcs:
- ci/env/install-bazel.sh
- .bazeliskrc
- .bazelversion
build_args:
- BUILDKITE_BAZEL_CACHE_URL
- PYTHON
Expand Down
2 changes: 1 addition & 1 deletion ci/env/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ install_bazel() {
# Only reinstall Bazel if we need to upgrade to a different version.
python="$(command -v python3 || command -v python || echo python)"
current_version="$(bazel --version | grep -o "[0-9]\+.[0-9]\+.[0-9]\+")"
new_version="$(grep 'USE_BAZEL_VERSION=' "${WORKSPACE_DIR}/.bazeliskrc" | grep -o "[0-9]\+.[0-9]\+.[0-9]\+")"
new_version="$(cat "${WORKSPACE_DIR}/.bazelversion")"
if [[ "$current_version" == "$new_version" ]]; then
echo "Bazel of the same version already exists, skipping the install"
export BAZEL_CONFIG_ONLY=1
Expand Down

0 comments on commit 7d516c2

Please sign in to comment.