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

Revert bootstrap_runtime_toolchain_type changes #246

Closed
wants to merge 4 commits into from
Closed
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
8 changes: 4 additions & 4 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ tasks:
# Bazel 6.x
ubuntu2004_bazel6:
name: "Bazel 6.x"
bazel: 6.3.0
bazel: 6.4.0
platform: ubuntu2004
build_targets: *build_targets_bazel6
ubuntu2004_integration_bazel6:
name: "Bazel 6.x Integration"
bazel: 6.3.0
bazel: 6.4.0
platform: ubuntu2004
working_directory: "test/repo"
shell_commands:
Expand All @@ -137,11 +137,11 @@ tasks:
- "//:MyTest"
macos_bazel6:
name: "Bazel 6.x"
bazel: 6.3.0
bazel: 6.4.0
platform: macos
build_targets: *build_targets_bazel6
windows_bazel6:
name: "Bazel 6.x"
bazel: 6.3.0
bazel: 6.4.0
platform: windows
build_targets: *build_targets_bazel6
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 = "8.5.1",
bazel_compatibility = [">=6.3.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 @@ -26,4 +26,5 @@ java_test(

default_java_toolchain(
name = "my_funky_toolchain",
bootclasspath = ["@bazel_tools//tools/jdk:platformclasspath"],
)
2 changes: 2 additions & 0 deletions test/repo/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ load("@com_google_protobuf//bazel/private:proto_bazel_features.bzl", "proto_baze

proto_bazel_features(name = "proto_bazel_features")

register_toolchains("//:all")

load("@rules_java//java:repositories.bzl", "rules_java_toolchains")

rules_java_toolchains()
Expand Down
4 changes: 2 additions & 2 deletions toolchains/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,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 @@ -213,7 +213,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