Problem in version 6.5.0: no such target '@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type'
When upgrading from 6.4.0 to 6.5.0 I noticed this failure:
ERROR: <snip>/external/remotejdk11_linux_toolchain_config_repo/BUILD.bazel:27:10: no such target
'@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type':
target 'bootstrap_runtime_toolchain_type' not declared in package 'tools/jdk' defined by
<snip>/external/bazel_tools/tools/jdk/BUILD (Tip: use `query "@bazel_tools//tools/jdk:*"` to see all the targets in that package)
and referenced by '@remotejdk11_linux_toolchain_config_repo//:bootstrap_runtime_toolchain'
ERROR: <snip>/external/bazel_tools/src/tools/launcher/BUILD:9:14: While resolving toolchains for target @bazel_tools//src/tools/launcher:launcher:
invalid registered toolchain '@remotejdk11_linux_toolchain_config_repo//:bootstrap_runtime_toolchain':
Analysis failed
Ping! The issue persists in 6.5.1 too
https://github.com/bazelbuild/rules_java/pull/113 is the only commit that looks sus. @fmeum FYI in case it's something obvious.
rules_java 6.5.0 requires Bazel 6.4.0 (not yet released) or a recent rolling release.
Sorry about the breakage. With the benefit of hindsight, 6.5.0 should have been released as 7.0.0 but we didn't foresee this. I'm going to leave this open to make it easier to find for anyone else that runs into this. This should become a non-issue with Bazel 7.0
cc @keertk : we should probably bump the rules_java major version next time we make a release.
Do you know what is the resolution for this? I have the same issue but I don't understand how to solve it 😅 I use the latest version of the rules_java and my bazel version is bazel 7.1.1. Do you need to specify a toolchain or something to avoid this error?
@spaghettifunk Are you loading rules_java at the very top of your WORKSPACE? It's possible that some other dep pulls in an older version.
That worked indeed 😄 Thank you very much for the help!