Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.4.0] Use Label in @bazel_tools//tools/jdk macros #19675

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions tools/jdk/default_java_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,19 @@ DEFAULT_JAVACOPTS = [
# jdk.compiler module, and jvm_opts
_BASE_TOOLCHAIN_CONFIGURATION = dict(
forcibly_disable_header_compilation = False,
genclass = ["@remote_java_tools//:GenClass"],
header_compiler = ["@remote_java_tools//:TurbineDirect"],
header_compiler_direct = ["@remote_java_tools//:TurbineDirect"],
ijar = ["@bazel_tools//tools/jdk:ijar"],
javabuilder = ["@remote_java_tools//:JavaBuilder"],
genclass = [Label("@remote_java_tools//:GenClass")],
header_compiler = [Label("@remote_java_tools//:TurbineDirect")],
header_compiler_direct = [Label("@remote_java_tools//:TurbineDirect")],
ijar = [Label("//tools/jdk:ijar")],
javabuilder = [Label("@remote_java_tools//:JavaBuilder")],
javac_supports_workers = True,
jacocorunner = "@remote_java_tools//:jacoco_coverage_runner_filegroup",
jacocorunner = Label("@remote_java_tools//:jacoco_coverage_runner_filegroup"),
jvm_opts = BASE_JDK9_JVM_OPTS,
misc = DEFAULT_JAVACOPTS,
singlejar = ["@bazel_tools//tools/jdk:singlejar"],
singlejar = [Label("//tools/jdk:singlejar")],
# Code to enumerate target JVM boot classpath uses host JVM. Because
# java_runtime-s are involved, its implementation is in @bazel_tools.
bootclasspath = ["@bazel_tools//tools/jdk:platformclasspath"],
bootclasspath = [Label("//tools/jdk:platformclasspath")],
source_version = "8",
target_version = "8",
reduced_classpath_incompatible_processors = [
Expand All @@ -95,7 +95,7 @@ DEFAULT_TOOLCHAIN_CONFIGURATION = dict(
# Turbine is not a worker and parallel GC is faster for short-lived programs.
"-XX:+UseParallelGC",
],
java_runtime = "@bazel_tools//tools/jdk:remote_jdk11",
java_runtime = Label("//tools/jdk:remote_jdk11"),
)

# The 'vanilla' toolchain is an unsupported alternative to the default.
Expand All @@ -112,7 +112,7 @@ DEFAULT_TOOLCHAIN_CONFIGURATION = dict(
# However it does allow using a wider range of `--host_javabase`s, including
# versions newer than the current JDK.
VANILLA_TOOLCHAIN_CONFIGURATION = dict(
javabuilder = ["@remote_java_tools//:VanillaJavaBuilder"],
javabuilder = [Label("@remote_java_tools//:VanillaJavaBuilder")],
jvm_opts = [],
)

Expand All @@ -130,9 +130,9 @@ PREBUILT_TOOLCHAIN_CONFIGURATION = dict(
# Turbine is not a worker and parallel GC is faster for short-lived programs.
"-XX:+UseParallelGC",
],
ijar = ["@bazel_tools//tools/jdk:ijar_prebuilt_binary"],
singlejar = ["@bazel_tools//tools/jdk:prebuilt_singlejar"],
java_runtime = "@bazel_tools//tools/jdk:remote_jdk11",
ijar = [Label("//tools/jdk:ijar_prebuilt_binary")],
singlejar = [Label("//tools/jdk:prebuilt_singlejar")],
java_runtime = Label("//tools/jdk:remote_jdk11"),
)

# The new toolchain is using all the tools from sources.
Expand All @@ -145,9 +145,9 @@ NONPREBUILT_TOOLCHAIN_CONFIGURATION = dict(
# Turbine is not a worker and parallel GC is faster for short-lived programs.
"-XX:+UseParallelGC",
],
ijar = ["@remote_java_tools//:ijar_cc_binary"],
singlejar = ["@remote_java_tools//:singlejar_cc_bin"],
java_runtime = "@bazel_tools//tools/jdk:remote_jdk11",
ijar = [Label("@remote_java_tools//:ijar_cc_binary")],
singlejar = [Label("@remote_java_tools//:singlejar_cc_bin")],
java_runtime = Label("//tools/jdk:remote_jdk11"),
)

def default_java_toolchain(name, configuration = DEFAULT_TOOLCHAIN_CONFIGURATION, toolchain_definition = True, **kwargs):
Expand All @@ -168,7 +168,7 @@ def default_java_toolchain(name, configuration = DEFAULT_TOOLCHAIN_CONFIGURATION
)
native.toolchain(
name = name + "_definition",
toolchain_type = "@bazel_tools//tools/jdk:toolchain_type",
toolchain_type = Label("//tools/jdk:toolchain_type"),
target_settings = [name + "_version_setting"],
toolchain = name,
)
Expand All @@ -183,8 +183,8 @@ def java_runtime_files(name, srcs):
for src in srcs:
native.genrule(
name = "gen_%s" % src,
srcs = ["@bazel_tools//tools/jdk:current_java_runtime"],
toolchains = ["@bazel_tools//tools/jdk:current_java_runtime"],
srcs = [Label("//tools/jdk:current_java_runtime")],
toolchains = [Label("//tools/jdk:current_java_runtime")],
cmd = "cp $(JAVABASE)/%s $@" % src,
outs = [src],
)
Expand Down
2 changes: 1 addition & 1 deletion tools/jdk/local_java_repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def local_java_runtime(name, java_home, version, runtime_name = None, visibility
native.toolchain(
name = "runtime_toolchain_definition",
target_settings = [":%s_settings_alias" % name],
toolchain_type = "@bazel_tools//tools/jdk:runtime_toolchain_type",
toolchain_type = Label("@bazel_tools//tools/jdk:runtime_toolchain_type"),
toolchain = runtime_name,
)

Expand Down