Skip to content

Commit a57deca

Browse files
committed
Remove rules_scala prebuilt protoc toolchain
Using Bazel 9 with `protobuf` v34.0 automatically enables the prebuilt `protoc` toolchain from `@protobuf`. There's no need to keep using the `rules_scala` toolchain, which breaks with `protobuf` v34.0 because `rules_scala` v7.2.4 doesn't support it. See bazel-contrib/rules_scala#1820. Also contains `MODULE.bazel.lock` updates generated by the `--lockfile_mode=refresh` flag. `bazel build //...` and `bazel test //...` both succeed. However, this still causes a `protoc` rebuild, thanks to a `@grpc-java` dependency: ```txt $ bazel query 'somepath(//..., @protobuf//:protoc)' //java/com/engflow/notificationqueue/demoserver:server_java_grpc_proto @grpc-java//compiler:java_grpc_library_toolchain @protobuf//:protoc ``` `@grpc-java//compiler:java_grpc_library_toolchain` is a `java_grpc_library` target. That rule's `_protoc` attribute is hardcoded to `Label("@com_google_protobuf//:protoc")`: - https://github.com/grpc/grpc-java/blob/v1.79.0/compiler/BUILD.bazel#L44-L49 - https://github.com/grpc/grpc-java/blob/v1.79.0/java_grpc_library.bzl#L44
1 parent dc943fe commit a57deca

File tree

2 files changed

+104
-43
lines changed

2 files changed

+104
-43
lines changed

MODULE.bazel

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ http_archive(
4545
url = "https://github.com/abseil/abseil-py/archive/refs/tags/v2.1.0.tar.gz",
4646
)
4747

48-
register_toolchains("@rules_scala_protoc_toolchains//:all")
49-
5048
bazel_dep(name = "bazel_skylib", version = "1.9.0")
5149
bazel_dep(name = "engflowapis-java", version = "2025.03.14-12.58.52")
5250
bazel_dep(name = "platforms", version = "1.0.0")
@@ -167,11 +165,4 @@ scala_deps = use_extension(
167165
scala_deps.scala()
168166
scala_deps.scalatest()
169167

170-
scala_protoc = use_extension(
171-
"@rules_scala//scala/extensions:protoc.bzl",
172-
"scala_protoc",
173-
dev_dependency = True,
174-
)
175-
use_repo(scala_protoc, "rules_scala_protoc_toolchains")
176-
177168
bazel_dep(name = "rules_shell", version = "0.6.1")

0 commit comments

Comments
 (0)