Skip to content

Commit 680567d

Browse files
authored
comment about toolchain registration with :all
FIX @shs96c
1 parent 17e78a3 commit 680567d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

examples/MODULE.bazel

+7
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ use_repo(protoc, "com_google_protobuf", "toolchains_protoc_hub")
2525

2626
register_toolchains("@toolchains_protoc_hub//:all")
2727

28+
# NB: the `:all` here is critical, because `proto_lang_toolchain` expands into two targets:
29+
# - proto_lang_toolchain rule [name]
30+
# - toolchain rule [name]_toolchain
31+
# and the second one is valid for registration.
32+
# Attempting to register a proto_lang_toolchain rule as a toolchain gives a baffling error like
33+
# Misconfigured toolchains: //tools:protoc_java_toolchain is declared as a toolchain but has inappropriate dependencies.
34+
# Declared toolchains should be created with the 'toolchain' rule and should not have dependencies that themselves require toolchains.
2835
register_toolchains("//tools/toolchains:all")
2936

3037
####### PYTHON ##########

0 commit comments

Comments
 (0)