Hi,
I'm working on bazel-integration-testing library and encountered an issue while trying to get it to support bazel >= 0.21.
This release, IINM, introduces the fetching of the remotejdk if no javabase/host_javabase is given explicitly.
I need my tests to be sandboxed so the bazel in the test can't download the remotejdk by itself.
What I'd like is to find the current java runtime and current java toolchain from my starlark rule, add the runtime as data dependency (probably not needed since happens implicitly) and pass their location/label to the test so that the test-runner can tell the test-bazel to use them.
I've taken a look at ctx.attr._java_runtime[java_common.JavaRuntimeInfo].java_home which returns "external/local_jdk" but:
1. I'm not sure that's what I need.
2. I need to trim the "external" part (java_home_runfiles_path is similar in returning "../local_jdk").
3. Not sure why local_jdk is returned and not the remotejdk. I have no javabase defined in my user folder or the repository's root.
4. When I run "java -version" on the local_jdk in the runfiles I get java8 while the test fails with "Unrecognized VM option 'CompactStrings" which means the jvm is 9 or above.
If anyone has insights about the above I'd really appreciate it,
Ittai