Skip to content

Commit d3f3408

Browse files
comiusrules_java Copybara
authored andcommitted
Make C++ toolchain explicitly not mandatory
Fixes: #305 PiperOrigin-RevId: 775703888 Change-Id: I709ccc8f29a09470aa3c4653ce9e1c413fafbbe4
1 parent 3daed1a commit d3f3408

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

java/bazel/rules/bazel_java_binary.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ def make_binary_rule(implementation, *, doc, attrs, executable = False, test = F
317317
test = test,
318318
fragments = ["cpp", "java"],
319319
provides = [JavaInfo],
320-
toolchains = [semantics.JAVA_TOOLCHAIN] + use_cc_toolchain() + (
320+
toolchains = [semantics.JAVA_TOOLCHAIN] + use_cc_toolchain(mandatory = False) + (
321321
[semantics.JAVA_RUNTIME_TOOLCHAIN] if executable or test else []
322322
) + (
323323
[_LAUNCHER_MAKER_TOOLCHAIN] if bazel_features.rules._has_launcher_maker_toolchain else []
@@ -331,7 +331,7 @@ def make_binary_rule(implementation, *, doc, attrs, executable = False, test = F
331331
"unstrippeddeployjar": "%{name}_deploy.jar.unstripped",
332332
},
333333
exec_groups = {
334-
"cpp_link": exec_group(toolchains = use_cc_toolchain()),
334+
"cpp_link": exec_group(toolchains = use_cc_toolchain(mandatory = False)),
335335
},
336336
subrules = [android_lint_subrule],
337337
)

0 commit comments

Comments
 (0)