Skip to content

Commit 3e51c0a

Browse files
committed
fix: bzlmod users don't need to register toolchain
The toolchains_protoc MODULE file registers the protoc toolchain itself.
1 parent f467eb3 commit 3e51c0a

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

.github/workflows/release_prep.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,9 @@ bazel_dep(name = "toolchains_protoc", version = "${TAG:1}")
2727
# Optional: choose a version of protoc rather than the latest.
2828
protoc = use_extension("@toolchains_protoc//protoc:extensions.bzl", "protoc")
2929
protoc.toolchain(
30-
# Creates a repository to satisfy well-known-types dependencies such as
31-
# deps=["@com_google_protobuf//:any_proto"]
32-
google_protobuf = "com_google_protobuf",
3330
# Pin to any version of protoc
3431
version = "v26.0",
3532
)
36-
use_repo(protoc, "com_google_protobuf", "toolchains_protoc_hub")
37-
38-
register_toolchains("@toolchains_protoc_hub//:all")
3933
\`\`\`
4034
4135
## Using WORKSPACE

examples/.bazelrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ common --host_platform=//tools:no_cgo_host_platform
77
common --@aspect_rules_ts//ts:skipLibCheck=always
88
common --@aspect_rules_ts//ts:default_to_tsc_transpiler
99

10+
common --java_runtime_version=remotejdk_11
11+
1012
# Ensure that we don't accidentally build protobuf or gRPC
1113
common --per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT
1214
common --host_per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT

examples/MODULE.bazel

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ protoc.toolchain(
3737
# Demonstrate overriding the default version
3838
version = "v28.0",
3939
)
40-
use_repo(protoc, "com_google_protobuf", "toolchains_protoc_hub")
41-
42-
register_toolchains("@toolchains_protoc_hub//:all")
40+
use_repo(protoc, "com_google_protobuf")
4341

4442
# NB: the `:all` here is critical, because `proto_lang_toolchain` expands into two targets:
4543
# - proto_lang_toolchain rule [name]

0 commit comments

Comments
 (0)