From c700ff34e2a5db3a5fb5f9425464429986c341e4 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Thu, 15 Jan 2026 08:27:37 +0100 Subject: [PATCH 1/4] Add bazel 8 to ci tests --- .github/bazel_version.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/bazel_version.json b/.github/bazel_version.json index 0fcae114..599e2a0c 100644 --- a/.github/bazel_version.json +++ b/.github/bazel_version.json @@ -1,5 +1,6 @@ [ "6.5.0", - "7.7.0" + "7.7.0", + "8.5.0" ] From cab25f0bff685a3c54605e203af8ed65bdc61599 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Thu, 15 Jan 2026 11:01:12 +0100 Subject: [PATCH 2/4] Force bazel 8 to use WORKSPACE --- test/foss/yaml-cpp/init.sh | 1 + test/foss/zlib/init.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/test/foss/yaml-cpp/init.sh b/test/foss/yaml-cpp/init.sh index 6321f8dc..1fd9d21a 100755 --- a/test/foss/yaml-cpp/init.sh +++ b/test/foss/yaml-cpp/init.sh @@ -50,5 +50,6 @@ codechecker_test( #------------------------------------------------------- EOF +echo "common --enable_workspace" >> .bazelrc # Add codechecker_bazel repo to WORKSPACE cat ../../templates/WORKSPACE.template >> WORKSPACE diff --git a/test/foss/zlib/init.sh b/test/foss/zlib/init.sh index ccdb0fe5..81549403 100644 --- a/test/foss/zlib/init.sh +++ b/test/foss/zlib/init.sh @@ -50,5 +50,6 @@ codechecker_test( #------------------------------------------------------- EOF +echo "common --enable_workspace" >> .bazelrc # Add codechecker_bazel repo to WORKSPACE cat ../../templates/WORKSPACE.template >> WORKSPACE From dc97ae7218d0ecb817af36dc6981d80cd62b6069 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Fri, 16 Jan 2026 16:06:49 +0100 Subject: [PATCH 3/4] Add bazel 8 things to readme --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c55acf7d..1e6485e2 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ Prerequisites We need the following tools: - Git 2 or newer (we use 2.36) -- Bazel 6 or 7, not yet bazel 8 (we recommend version 7.7.0) +- Bazel 6, 7 or 8 (we recommend version 8.5.0) - Clang 16 or newer (we use 16), we use clang-tidy - Python 3.8 or newer (we use 3.11) - CodeChecker 6.26 or newer (we use 6.26.0) @@ -100,11 +100,11 @@ pip3 install codechecker ``` Install Bazel: -We recommend bazel 7.7.0 +We recommend bazel 8.5.0 ```bash -wget https://github.com/bazelbuild/bazel/releases/download/7.7.0/bazel-7.7.0-linux-x86_64 && \ -chmod +x bazel-7.7.0-linux-x86_64 && \ -sudo mv bazel-7.7.0-linux-x86_64 /usr/local/bin/bazel +wget https://github.com/bazelbuild/bazel/releases/download/8.5.0/bazel-8.5.0-linux-x86_64 && \ +chmod +x bazel-8.5.0-linux-x86_64 && \ +sudo mv bazel-8.5.0-linux-x86_64 /usr/local/bin/bazel ``` Or choose a suitable binary for your system from this list: https://github.com/bazelbuild/bazel/releases/tag/7.7.0 Alternatively follow the official guide at: https://bazel.build/install From 58799b02b6e7ef9b6496028c4cd36e0b58255945 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Thu, 15 Jan 2026 11:11:25 +0100 Subject: [PATCH 4/4] Conditional bazel 8 flag --- test/foss/yaml-cpp/init.sh | 8 ++++++-- test/foss/zlib/init.sh | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/test/foss/yaml-cpp/init.sh b/test/foss/yaml-cpp/init.sh index 1fd9d21a..8144d3eb 100755 --- a/test/foss/yaml-cpp/init.sh +++ b/test/foss/yaml-cpp/init.sh @@ -49,7 +49,11 @@ codechecker_test( #------------------------------------------------------- EOF - -echo "common --enable_workspace" >> .bazelrc +# Apply bazel 8 specific flag, forcing the use of WORKSPACE +VERSION=$(< "../../templates/.bazelversion") +MAJOR_VERSION=${VERSION%%.*} +if [ "$MAJOR_VERSION" -eq 8 ]; then + echo "common --enable_workspace" >> .bazelrc +fi # Add codechecker_bazel repo to WORKSPACE cat ../../templates/WORKSPACE.template >> WORKSPACE diff --git a/test/foss/zlib/init.sh b/test/foss/zlib/init.sh index 81549403..bd35bf08 100644 --- a/test/foss/zlib/init.sh +++ b/test/foss/zlib/init.sh @@ -49,7 +49,11 @@ codechecker_test( #------------------------------------------------------- EOF - -echo "common --enable_workspace" >> .bazelrc +# Apply bazel 8 specific flag, forcing the use of WORKSPACE +VERSION=$(< "../../templates/.bazelversion") +MAJOR_VERSION=${VERSION%%.*} +if [ "$MAJOR_VERSION" -eq 8 ]; then + echo "common --enable_workspace" >> .bazelrc +fi # Add codechecker_bazel repo to WORKSPACE cat ../../templates/WORKSPACE.template >> WORKSPACE