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" ] 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 diff --git a/test/foss/yaml-cpp/init.sh b/test/foss/yaml-cpp/init.sh index 6321f8dc..8144d3eb 100755 --- a/test/foss/yaml-cpp/init.sh +++ b/test/foss/yaml-cpp/init.sh @@ -49,6 +49,11 @@ codechecker_test( #------------------------------------------------------- EOF - +# 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 ccdb0fe5..bd35bf08 100644 --- a/test/foss/zlib/init.sh +++ b/test/foss/zlib/init.sh @@ -49,6 +49,11 @@ codechecker_test( #------------------------------------------------------- EOF - +# 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