Skip to content

Commit

Permalink
Reference platformclasspath in @bazel_tools
Browse files Browse the repository at this point in the history
The `platformclasspath` rule in `@rules_java` always requires a
bootstrap Java runtime toolchain to be registered, but whether the
commonly used toolchain macros in `@bazel_tools` register this
toolchain depends on the version of Bazel that is running the build
and the version of `rules_java` it bundles as `@rules_java_builtin`.

In order to support all Bazel versions, reference the
`platformclasspath` in `@bazel_tools`, which in turn references the
corresponding target in `@rules_java_builtin`, which may or may not be
the current version of this code.
  • Loading branch information
fmeum committed Aug 10, 2023
1 parent 1213a73 commit 54e89da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion toolchains/default_java_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ _BASE_TOOLCHAIN_CONFIGURATION = dict(
singlejar = [Label("//toolchains:singlejar")],
# Code to enumerate target JVM boot classpath uses host JVM. Because
# java_runtime-s are involved, its implementation is in @bazel_tools.
bootclasspath = [Label("//toolchains:platformclasspath")],
bootclasspath = [Label("@bazel_tools//tools/jdk:platformclasspath")],
source_version = "8",
target_version = "8",
reduced_classpath_incompatible_processors = [
Expand Down

0 comments on commit 54e89da

Please sign in to comment.