-
Notifications
You must be signed in to change notification settings - Fork 69
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
on remote JDKs
#133
Conversation
11e73be
to
f34c8c6
Compare
CC @tjgq @UebelAndre |
toolchains/jdk_build_file.bzl
Outdated
# Provide the 'java` binary explicitly so that the correct path is used by | ||
# Bazel even when the host platform differs from the execution platform. | ||
java = glob(["bin/java.exe", "bin/java"])[0], |
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.
Should we also:
- Document that
java_runtime.java
should (must?) be explicitly set, otherwise the default will be a guess based on the host platform? - Update the TODO in
JavaRuntime.java
accordingly?
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.
(Whoops, I just noticed that this is not the main Bazel repo, but the comments still apply outside of this PR)
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.
- Document that
java_runtime.java
should (must?) be explicitly set, otherwise the default will be a guess based on the host platform?- Update the TODO in
JavaRuntime.java
accordingly?
Documenting it as recommended sounds good to me.
I wonder if there's a path to making it mandatory and removing the logic for inferring it, but I'm not sure what the cleanup for that would look like.
If the `java` attribute on `java_runtime` isn't set, Bazel guesses it based on the host platform, which can be different from the execution platform. https://github.com/bazelbuild/bazel/blob/04a05677e4714434ec196c45a4ccbd8e0ef2f0ff/src/main/java/com/google/devtools/build/lib/rules/java/JavaRuntime.java#L46 Work towards bazelbuild/bazel#19587
If the
java
attribute onjava_runtime
isn't set, Bazel guesses it based on the host platform, which can be different from the execution platform.https://github.com/bazelbuild/bazel/blob/04a05677e4714434ec196c45a4ccbd8e0ef2f0ff/src/main/java/com/google/devtools/build/lib/rules/java/JavaRuntime.java#L46
Work towards bazelbuild/bazel#19587