From 5387fd9c1bad5f6bc81f0c68216025c601b0c2b4 Mon Sep 17 00:00:00 2001 From: dneto Date: Tue, 11 Aug 2026 13:53:51 -0400 Subject: [PATCH] Migrate to Bazel 8.7.0 --- .bazelversion | 2 +- WORKSPACE | 1 - WORKSPACE.bzlmod | 0 kokoro/macos-clang-release-bazel/build.sh | 10 +++++----- kokoro/scripts/linux/build-docker.sh | 2 +- kokoro/scripts/linux/build.sh | 9 ++++++++- 6 files changed, 15 insertions(+), 9 deletions(-) delete mode 100644 WORKSPACE create mode 100644 WORKSPACE.bzlmod diff --git a/.bazelversion b/.bazelversion index ba7f754..df5119e 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -7.4.0 +8.7.0 diff --git a/WORKSPACE b/WORKSPACE deleted file mode 100644 index 08d6561..0000000 --- a/WORKSPACE +++ /dev/null @@ -1 +0,0 @@ -workspace(name = "effcee") diff --git a/WORKSPACE.bzlmod b/WORKSPACE.bzlmod new file mode 100644 index 0000000..e69de29 diff --git a/kokoro/macos-clang-release-bazel/build.sh b/kokoro/macos-clang-release-bazel/build.sh index 0fabd2f..037609a 100644 --- a/kokoro/macos-clang-release-bazel/build.sh +++ b/kokoro/macos-clang-release-bazel/build.sh @@ -32,15 +32,15 @@ git config --global --add safe.directory $SRC cd $SRC /usr/bin/python3 utils/git-sync-deps -# Get bazel 7.4.0 +BAZELVER=8.7.0 gcloud config set auth/disable_credentials True -gcloud storage cp gs://bazel/7.4.0/release/bazel-7.4.0-darwin-x86_64 . -chmod +x bazel-7.4.0-darwin-x86_64 +gcloud storage cp gs://bazel/$BAZELVER/release/bazel-$BAZELVER-darwin-x86_64 . +chmod +x bazel-$BAZELVER-darwin-x86_64 echo $(date): Build everything... -./bazel-7.4.0-darwin-x86_64 build --cxxopt=-std=c++17 :all +./bazel-$BAZELVER-darwin-x86_64 build --cxxopt=-std=c++17 :all echo $(date): Build completed. echo $(date): Starting bazel test... -./bazel-7.4.0-darwin-x86_64 test --cxxopt=-std=c++17 :all +./bazel-$BAZELVER-darwin-x86_64 test --cxxopt=-std=c++17 :all echo $(date): Bazel test completed. diff --git a/kokoro/scripts/linux/build-docker.sh b/kokoro/scripts/linux/build-docker.sh index fda8e34..89a5a97 100755 --- a/kokoro/scripts/linux/build-docker.sh +++ b/kokoro/scripts/linux/build-docker.sh @@ -101,7 +101,7 @@ if [ $TOOL = "cmake" ]; then ctest --output-on-failure --timeout 300 echo $(date): ctest completed. elif [ $TOOL = "bazel" ]; then - using bazel-7.4.0 + using bazel-8.7.0 echo $(date): Build everything... bazel build --cxxopt=-std=c++17 :all diff --git a/kokoro/scripts/linux/build.sh b/kokoro/scripts/linux/build.sh index 3608e59..9d53dce 100644 --- a/kokoro/scripts/linux/build.sh +++ b/kokoro/scripts/linux/build.sh @@ -35,6 +35,13 @@ function chown_dir() { fi } +# Set up a volume mapping for kokoro artifacts only if the corresponding +# env var exists. The env var will not exist when manally testing this script. +ARTIFACTS_MAPPING= +if [ -n "${KOKORO_ARTIFACTS_DIR}" ]; then + ARTIFACTS_MAPPING="--volume ${KOKORO_ARTIFACTS_DIR}:${KOKORO_ARTIFACTS_DIR}" +fi + set +e # Allow build failures @@ -42,7 +49,7 @@ set +e docker run --rm -i \ --privileged \ --volume "${ROOT_DIR}:${ROOT_DIR}" \ - --volume "${KOKORO_ARTIFACTS_DIR}:${KOKORO_ARTIFACTS_DIR}" \ + $ARTIFACTS_MAPPING \ --workdir "${ROOT_DIR}" \ --env SCRIPT_DIR=${SCRIPT_DIR} \ --env ROOT_DIR=${ROOT_DIR} \