Skip to content

[7.x] Revert bootstrap_runtime_toolchain_type changes #247

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

Merged
merged 1 commit into from
Dec 3, 2024
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
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module(
name = "rules_java",
version = "7.12.2",
bazel_compatibility = [">=6.2.0"],
bazel_compatibility = [">=6.4.0"],
compatibility_level = 1,
)

Expand Down
1 change: 1 addition & 0 deletions test/repo/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ java_binary(

default_java_toolchain(
name = "my_funky_toolchain",
bootclasspath = ["@bazel_tools//tools/jdk:platformclasspath"],
)
4 changes: 2 additions & 2 deletions toolchains/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ filegroup(
#
# Toolchains of this type are only consumed internally by the bootclasspath rule and should not be
# accessed from Starlark.

toolchain_type(name = "bootstrap_runtime_toolchain_type")
# TODO: migrate away from using @bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type ?
# toolchain_type(name = "bootstrap_runtime_toolchain_type")

# Points to toolchain[":runtime_toolchain_type"] (was :legacy_current_java_runtime)
java_runtime_alias(name = "current_java_runtime")
Expand Down
2 changes: 1 addition & 1 deletion toolchains/default_java_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def java_runtime_files(name, srcs):
tags = ["manual"],
)

_JAVA_BOOTSTRAP_RUNTIME_TOOLCHAIN_TYPE = Label("//toolchains:bootstrap_runtime_toolchain_type")
_JAVA_BOOTSTRAP_RUNTIME_TOOLCHAIN_TYPE = Label("@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type")

# Opt the Java bootstrap actions into path mapping:
# https://github.com/bazelbuild/bazel/commit/a239ea84832f18ee8706682145e9595e71b39680
Expand Down
4 changes: 2 additions & 2 deletions toolchains/local_java_repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def local_java_runtime(name, java_home, version, runtime_name = None, visibility
native.toolchain(
name = "bootstrap_runtime_toolchain_definition",
target_settings = [":%s_settings_alias" % name],
toolchain_type = Label("//toolchains:bootstrap_runtime_toolchain_type"),
toolchain_type = Label("@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type"),
toolchain = runtime_name,
)

Expand Down Expand Up @@ -268,7 +268,7 @@ toolchain(
toolchain(
name = "bootstrap_runtime_toolchain_definition",
target_settings = [":localjdk_setting"],
toolchain_type = "@rules_java//toolchains:bootstrap_runtime_toolchain_type",
toolchain_type = "@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type",
toolchain = ":jdk",
)
'''
Expand Down
2 changes: 1 addition & 1 deletion toolchains/remote_java_repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ toolchain(
# the same configuration, this constraint will not result in toolchain resolution failures.
exec_compatible_with = {target_compatible_with},
target_settings = [":version_or_prefix_version_setting"],
toolchain_type = "@rules_java//toolchains:bootstrap_runtime_toolchain_type",
toolchain_type = "@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type",
toolchain = "{toolchain}",
)
""".format(
Expand Down