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

Add toolchain type for Java bootstrap runtime #18841

Closed
wants to merge 1 commit into from

Conversation

fmeum
Copy link
Collaborator

@fmeum fmeum commented Jul 5, 2023

The bootclasspath rule in rules_java will soon use this toolchain type instead of the regular Java runtime toolchain type, which naturally carries a constraint on the target platform.

Also adds more detailed explanations of the now three Java toolchain types.

Work towards #17085
Work towards #18265
Work towards bazelbuild/rules_java#64
Split off from #18262

The `bootclasspath` rule in `rules_java` will soon use this toolchain
type instead of the regular Java runtime toolchain type, which naturally
carries a constraint on the target platform.

Also adds more detailed explanations of the now three Java toolchain
types.
@github-actions github-actions bot added awaiting-review PR is awaiting review from an assigned reviewer team-Rules-Java Issues for Java rules labels Jul 5, 2023
@fmeum fmeum changed the title Add toolchain type or Java bootstrap runtime Add toolchain type for Java bootstrap runtime Jul 5, 2023
@fmeum fmeum requested a review from hvadehra July 5, 2023 08:35
@hvadehra hvadehra added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels Jul 5, 2023
@copybara-service copybara-service bot closed this in 8715e9a Jul 5, 2023
@github-actions github-actions bot removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Jul 5, 2023
@fmeum fmeum deleted the 17085-tools branch July 6, 2023 12:55
@fmeum
Copy link
Collaborator Author

fmeum commented Aug 8, 2023

@bazel-io flag

@bazel-io bazel-io added the potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone label Aug 8, 2023
@iancha1992
Copy link
Member

@bazel-io fork 6.4.0

@bazel-io bazel-io removed the potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone label Aug 8, 2023
iancha1992 pushed a commit to iancha1992/bazel that referenced this pull request Aug 8, 2023
The `bootclasspath` rule in `rules_java` will soon use this toolchain type instead of the regular Java runtime toolchain type, which naturally carries a constraint on the target platform.

Also adds more detailed explanations of the now three Java toolchain types.

Work towards bazelbuild#17085
Work towards bazelbuild#18265
Work towards bazelbuild/rules_java#64
Split off from bazelbuild#18262

Closes bazelbuild#18841.

PiperOrigin-RevId: 545756139
Change-Id: Ib9dd7a1c20c32315375722d6a023a89859daea9c
@iancha1992
Copy link
Member

iancha1992 commented Aug 8, 2023

@fmeum @hvadehra
Looks like we may need another small commit before cherry-picking this to release-6.4.0 because in the BEGINNING of the "tools/jdk/BUILD.tools" file, we have:

In the master branch:

package(default_visibility = ["//visibility:public"])
load("@rules_python//python:defs.bzl", "py_binary", "py_test")
exports_files([
    "BUILD.java_tools",
    "java_stub_template.txt",
])

In the release-6.4.0 branch:

load(
    "@bazel_tools//tools/jdk:default_java_toolchain.bzl",
    "DEFAULT_TOOLCHAIN_CONFIGURATION",
    "PREBUILT_TOOLCHAIN_CONFIGURATION",
    "VANILLA_TOOLCHAIN_CONFIGURATION",
    "bootclasspath",
    "default_java_toolchain",
    "java_runtime_files",
)
load(
    "//tools/jdk:java_toolchain_alias.bzl",
    "java_host_runtime_alias",
    "java_runtime_alias",
    "java_runtime_version_alias",
    "java_toolchain_alias",
)
load("//tools/python:private/defs.bzl", "py_binary", "py_test")

package(default_visibility = ["//visibility:public"])

The difference is causing the merge conflicts. Can you please take a look and let me know which PR or commit I need? Thanks.

cc: @bazelbuild/triage

@fmeum
Copy link
Collaborator Author

fmeum commented Aug 9, 2023

@iancha1992 That commit is very large and can't be cherry-picked, but it also isn't really needed: You can replace

# Used to distinguish toolchains used for Java development, ie the JavaToolchainProvider.
toolchain_type(name = "toolchain_type")

# Used to distinguish toolchains used for Java execution, ie the JavaRuntimeInfo.
toolchain_type(name = "runtime_toolchain_type")

with the lines added in this PR and keep everything before and after as is. If that doesn't work, I can try to submit a PR.

iancha1992 pushed a commit to iancha1992/bazel that referenced this pull request Aug 9, 2023
The `bootclasspath` rule in `rules_java` will soon use this toolchain type instead of the regular Java runtime toolchain type, which naturally carries a constraint on the target platform.

Also adds more detailed explanations of the now three Java toolchain types.

Work towards bazelbuild#17085
Work towards bazelbuild#18265
Work towards bazelbuild/rules_java#64
Split off from bazelbuild#18262

Closes bazelbuild#18841.

PiperOrigin-RevId: 545756139
Change-Id: Ib9dd7a1c20c32315375722d6a023a89859daea9c
@iancha1992
Copy link
Member

@iancha1992 That commit is very large and can't be cherry-picked, but it also isn't really needed: You can replace

# Used to distinguish toolchains used for Java development, ie the JavaToolchainProvider.
toolchain_type(name = "toolchain_type")

# Used to distinguish toolchains used for Java execution, ie the JavaRuntimeInfo.
toolchain_type(name = "runtime_toolchain_type")

with the lines added in this PR and keep everything before and after as is. If that doesn't work, I can try to submit a PR.

@fmeum actually could you submit a PR please?

@fmeum
Copy link
Collaborator Author

fmeum commented Aug 10, 2023

@iancha1992 Sure: #19220

fmeum added a commit to fmeum/bazel that referenced this pull request Aug 10, 2023
The `bootclasspath` rule in `rules_java` will soon use this toolchain type instead of the regular Java runtime toolchain type, which naturally carries a constraint on the target platform.

Also adds more detailed explanations of the now three Java toolchain types.

Work towards bazelbuild#17085
Work towards bazelbuild#18265
Work towards bazelbuild/rules_java#64
Split off from bazelbuild#18262

Closes bazelbuild#18841.

PiperOrigin-RevId: 545756139
Change-Id: Ib9dd7a1c20c32315375722d6a023a89859daea9c
iancha1992 pushed a commit that referenced this pull request Aug 14, 2023
The `bootclasspath` rule in `rules_java` will soon use this toolchain
type instead of the regular Java runtime toolchain type, which naturally
carries a constraint on the target platform.

Also adds more detailed explanations of the now three Java toolchain
types.

Work towards #17085 Work
towards #18265 Work towards
bazelbuild/rules_java#64 Split off from
#18262

Closes #18841.

PiperOrigin-RevId: 545756139
Change-Id: Ib9dd7a1c20c32315375722d6a023a89859daea9c

Fixes #19201
@iancha1992
Copy link
Member

The changes in this PR have been included in Bazel 6.4.0 RC1. Please test out the release candidate and report any issues as soon as possible. If you're using Bazelisk, you can point to the latest RC by setting USE_BAZEL_VERSION=last_rc.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Rules-Java Issues for Java rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants