-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Set java_runtime on java_toolchains. #12333
Conversation
Toolchains that don't have java_runtime in a remote repository (toolchain_hostjdk8, legacy_toolchain, ...) were removed. They are better defined using java_toolchain_default, next to the rules defining local JDK.
Downstream tests in https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/1721 |
@@ -648,7 +656,7 @@ JAVA_VERSIONS = ("11",) | |||
name = "create_java_tools_build_java" + java_version, | |||
srcs = ["//tools/jdk:BUILD.java_tools"], | |||
outs = ["remote_java_tools_java" + java_version + "/BUILD"], | |||
cmd = "sed 's/JAVA_LANGUAGE_LEVEL/" + java_version + "/g' $< > $@", | |||
cmd = "sed 's/JAVA_LANGUAGE_LEVEL/" + java_version + "/g; s/PLATFORM/" + _PLATFORM + "/g' $< > $@", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My read of this is that only the remote JDK that matches the host platform will be generated. Is this the intended use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the comment.
Exactly. This is the default setting that always works. In case you want to
compile using local JDK, the right place to define java_toolchain is in
local_java_repository or in WORKSPACE file.
On Thu 22. Oct 2020 at 20:36, katre ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/BUILD
<#12333 (comment)>:
> @@ -648,7 +656,7 @@ JAVA_VERSIONS = ("11",)
name = "create_java_tools_build_java" + java_version,
srcs = ["//tools/jdk:BUILD.java_tools"],
outs = ["remote_java_tools_java" + java_version + "/BUILD"],
- cmd = "sed 's/JAVA_LANGUAGE_LEVEL/" + java_version + "/g' $< > $@",
+ cmd = "sed 's/JAVA_LANGUAGE_LEVEL/" + java_version + "/g; s/PLATFORM/" + _PLATFORM + "/g' $< > $@",
My read of this is that only the remote JDK that matches the host platform
will be generated. Is this the intended use?
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#12333 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANWREBVR4GHXBX673ODDVLSMB3SLANCNFSM4S3F66MA>
.
--
Ivo List | Software Engineer | ilist@google.com |
|
That makes sense to me, but it's worth calling out the behavior in a comment. |
*** Reason for rollback *** Setting java_runtime attribute on java_toolchain before bazel is released doesn't work, because @remote_java_tools_linux_for_testing (and others) are loaded with old bazel release. *** Original change description *** Set java_runtime on java_toolchains. Toolchains that don't have java_runtime in a remote repository (toolchain_hostjdk8, legacy_toolchain, ...) were removed. They are better defined using java_toolchain_default, next to the rules defining local JDK. Closes #12333. PiperOrigin-RevId: 339218931
Toolchains that don't have java_runtime in a remote repository (toolchain_hostjdk8, legacy_toolchain, ...) were removed. They are better defined using java_toolchain_default, next to the rules defining local JDK.