From 4c98ec37bbdb0f157eef561756c7126757d2a0a0 Mon Sep 17 00:00:00 2001 From: John Cormie Date: Fri, 15 May 2026 17:40:37 -0700 Subject: [PATCH] Centralize the officially supported bazel version Add .bazelversion files so that workflows and contributors can automatically use the same supported/tested version of bazel. `examples/.bazelversion` could have been a symlink but decided against this to avoid causing problems on Windows. --- .bazelversion | 1 + .github/workflows/testing.yml | 2 -- COMPILING.md | 16 ++++++++++++++++ examples/.bazelversion | 1 + 4 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 .bazelversion create mode 100644 examples/.bazelversion diff --git a/.bazelversion b/.bazelversion new file mode 100644 index 00000000000..df5119ec64e --- /dev/null +++ b/.bazelversion @@ -0,0 +1 @@ +8.7.0 diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 8793cfb82fe..09faf080739 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -80,8 +80,6 @@ jobs: strategy: matrix: bzlmod: [true, false] - env: - USE_BAZEL_VERSION: 8.7.0 steps: - uses: actions/checkout@v4 diff --git a/COMPILING.md b/COMPILING.md index b7df1319beb..e39ee252972 100644 --- a/COMPILING.md +++ b/COMPILING.md @@ -150,3 +150,19 @@ $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses # Add 'export ANDROID_HOME=$HOME/Android/Sdk' to your .bashrc or equivalent ``` + +Building with Bazel +=================== + +grpc-java can also be built using [Bazel](https://bazel.build/). + +First [install bazelisk](https://github.com/bazelbuild/bazelisk#installation) +(unlike Gradle, Bazel's wrapper isn't checked-in to the grpc-java repository). + +To build the grpc-java library: +``` +$ bazelisk build //... +``` + +You cannot run the tests from Bazel at this time. + diff --git a/examples/.bazelversion b/examples/.bazelversion new file mode 100644 index 00000000000..df5119ec64e --- /dev/null +++ b/examples/.bazelversion @@ -0,0 +1 @@ +8.7.0