Fix Bazel 4 support (#10438)
* Downgrade a presubmit to Bazel 4.0.0 to reproduce failure
* Add explicit dependency on more recent platforms package
* Upgrade to Bazel 4.2.2, the oldest supported version
diff --git a/WORKSPACE b/WORKSPACE
index 20e7415..b50f2ae 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -25,6 +25,14 @@
],
)
+# Bazel platform rules.
+http_archive(
+ name = "platforms",
+ sha256 = "a879ea428c6d56ab0ec18224f976515948822451473a80d06c2e50af0bbe5121",
+ strip_prefix = "platforms-da5541f26b7de1dc8e04c075c99df5351742a4a2",
+ urls = ["https://github.com/bazelbuild/platforms/archive/da5541f26b7de1dc8e04c075c99df5351742a4a2.zip"], # 2022-05-27
+)
+
# Load common dependencies.
load("//:protobuf_deps.bzl", "PROTOBUF_MAVEN_ARTIFACTS", "protobuf_deps")
protobuf_deps()
diff --git a/kokoro/linux/benchmark/run.sh b/kokoro/linux/benchmark/run.sh
index 4a4ddb9..960f9d5 100755
--- a/kokoro/linux/benchmark/run.sh
+++ b/kokoro/linux/benchmark/run.sh
@@ -1,7 +1,7 @@
#!/bin/bash
#
-# Install Bazel 4.0.0.
-use_bazel.sh 4.0.0
+# Install Bazel 4.2.2.
+use_bazel.sh 4.2.2
# Change to repo root
cd $(dirname $0)/../../..
diff --git a/kokoro/linux/java_linkage_monitor/build.sh b/kokoro/linux/java_linkage_monitor/build.sh
index fd1c5c7..7d4d7b7 100755
--- a/kokoro/linux/java_linkage_monitor/build.sh
+++ b/kokoro/linux/java_linkage_monitor/build.sh
@@ -6,7 +6,7 @@
# This script selects a specific Dockerfile (for building a Docker image) and
# a script to run inside that image.
-use_bazel.sh 5.1.1
+use_bazel.sh 4.2.2
# Change to repo root
cd $(dirname $0)/../../..