Use the default C++ toolchain for RBE instead of rbe_autoconfig JGit is a pure-Java project and schedules no C++ compile actions, so the RBE C++ toolchain is never invoked; it only has to exist to satisfy analysis-time resolution of @bazel_tools//tools/cpp:toolchain_type (used by ijar/zipper in the Java rules). Drop the @rbe_autoconfig crosstool_top and extra_toolchains flags and rely on Bazel's built-in autodetected C++ toolchain, which resolves on the Linux CI host and is never run. The RBE execution container is still pinned explicitly: a minimal platform in tools/remote/BUILD names the container via the container-image exec property, which is what actually selects it, not the C++ toolchain. This also updates the container from ubuntu2204 to the current gcr.io/bazel-public/ubuntu2404 image, matching Gerrit. Bumping the image is now a one-line digest edit rather than regenerating configs with rbe_configs_gen. This removes the dependency on the rbe_autoconfig module, and the bazel-toolchains / rbe_configs_gen tooling behind it, entirely. Change-Id: Icf4c40cf83a8451263fef03d18eb58b937b3e796 Signed-off-by: David Ostrovsky <david@ostrovsky.org>
diff --git a/MODULE.bazel b/MODULE.bazel index 843d08e..c873b13 100644 --- a/MODULE.bazel +++ b/MODULE.bazel
@@ -1,17 +1,12 @@ module(name = "jgit") bazel_dep(name = "bazel_features", version = "1.42.1") +bazel_dep(name = "platforms", version = "1.1.0") bazel_dep(name = "rules_android", version = "0.7.1") bazel_dep(name = "rules_go", version = "0.60.0") bazel_dep(name = "rules_java", version = "9.3.0") bazel_dep(name = "rules_jvm_external", version = "6.10") bazel_dep(name = "rules_shell", version = "0.6.1") -bazel_dep(name = "rbe_autoconfig") -git_override( - module_name = "rbe_autoconfig", - commit = "71f39817c028949bd6d25f1806502bcd33028d14", - remote = "https://github.com/davido/rbe_autoconfig.git", -) register_toolchains("//tools:error_prone_warnings_toolchain_java17_definition")
diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index da5f702..7d473fc 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock
@@ -100,7 +100,8 @@ "https://bcr.bazel.build/modules/platforms/0.0.8/MODULE.bazel": "9f142c03e348f6d263719f5074b21ef3adf0b139ee4c5133e2aa35664da9eb2d", "https://bcr.bazel.build/modules/platforms/0.0.9/MODULE.bazel": "4a87a60c927b56ddd67db50c89acaa62f4ce2a1d2149ccb63ffd871d5ce29ebc", "https://bcr.bazel.build/modules/platforms/1.0.0/MODULE.bazel": "f05feb42b48f1b3c225e4ccf351f367be0371411a803198ec34a389fb22aa580", - "https://bcr.bazel.build/modules/platforms/1.0.0/source.json": "f4ff1fd412e0246fd38c82328eb209130ead81d62dcd5a9e40910f867f733d96", + "https://bcr.bazel.build/modules/platforms/1.1.0/MODULE.bazel": "1c0c09f5bdcf4b3f924720d2478a3711cb39f4977019ca5988685e5b7e18b3d2", + "https://bcr.bazel.build/modules/platforms/1.1.0/source.json": "fcf351c47596c939140ab0d333dfdd08ed1ea6ce33c2fe70c12493a301cf1344", "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel": "a5a29bb89544f9b97edce05642fac225a808b5b7be74038ea3640fae2f8e66a7", "https://bcr.bazel.build/modules/protobuf/23.1/MODULE.bazel": "88b393b3eb4101d18129e5db51847cd40a5517a53e81216144a8c32dfeeca52a", "https://bcr.bazel.build/modules/protobuf/24.4/MODULE.bazel": "7bc7ce5f2abf36b3b7b7c8218d3acdebb9426aeb35c2257c96445756f970eb12",
diff --git a/tools/remote-bazelrc b/tools/remote-bazelrc index 39797b8..b5654f9 100644 --- a/tools/remote-bazelrc +++ b/tools/remote-bazelrc
@@ -30,11 +30,9 @@ # Set several flags related to specifying the platform, toolchain and java # properties. -build:remote --crosstool_top=@rbe_autoconfig//cc:toolchain -build:remote --extra_toolchains=@rbe_autoconfig//config:cc-toolchain -build:remote --extra_execution_platforms=@rbe_autoconfig//config:platform -build:remote --host_platform=@rbe_autoconfig//config:platform -build:remote --platforms=@rbe_autoconfig//config:platform +build:remote --extra_execution_platforms=//tools/remote:platform +build:remote --host_platform=//tools/remote:platform +build:remote --platforms=//tools/remote:platform # Set various strategies so that all actions execute remotely. Mixing remote # and local execution will lead to errors unless the toolchain and remote
diff --git a/tools/remote/BUILD b/tools/remote/BUILD new file mode 100644 index 0000000..f891215 --- /dev/null +++ b/tools/remote/BUILD
@@ -0,0 +1,17 @@ +# RBE execution platform. Names the container Bazel actions run in on the +# remote executor. JGit is pure Java and schedules no C++ actions, so the +# default (autodetected) cc toolchain satisfies analysis-time resolution +# and is never invoked; only this platform, naming the container image, +# is needed -- there is no generated CROSSTOOL to maintain. +platform( + name = "platform", + constraint_values = [ + "@platforms//cpu:x86_64", + "@platforms//os:linux", + ], + exec_properties = { + "OSFamily": "Linux", + "container-image": "docker://gcr.io/bazel-public/ubuntu2404@sha256:57bbaa84bec679736c53dcd1d326e8f835b3b9ce3e36c12a3c12a07eb59177d3", + }, + visibility = ["//visibility:public"], +)