bazel
bazel copied to clipboard
Wire up `oneversion` tool in `java_tools`
- Add a prebuilt
one_version
tool as well as sources tojava_tools
. - Avoid passing
--whitelist
toone_version
if no allowlist is configured in the toolchain as it isn't supported by the Bazel version ofoneversion
yet. - Document the
one_version
flags. - Clean up tests not updated after recent rules_java releases.
Work towards #1071
@bazel-io fork 7.2.0
To confirm, does this change take effect without a java_tools release?
To confirm, does this change take effect without a java_tools release?
It includes some changes that only take effect with a new java_tools version, but users can just update rules_java
themselves after 7.2.0. So while the changes to builtins would need to get into 7.2.0, a new rules_java release doesn't necessarily have to be cut in time.
I resolved the conflict.
@fmeum CI appears to be unhappy with this on Windows
The error is:
C:/b/6j5uj2r5/execroot/_main/_tmp/9473ac4eeda27d9bad5e0103440c98fe/root/4wfnognp/external/rules_java~~toolchains~remotejdk11_win/lib/jrt-fs.jar (Permission denied)
It's not clear to me how this PR could cause this and it didn't occur before I rebased onto master. Will try to reproduce this locally.
@fmeum Could you please take a look at the failing checks?
@meteorcloudy Do you happen to have an idea what could be causing such an error?
I have no idea.. but let me try if I can reproduce it locally
I can only confirm the permission denied error is caused by running the test_one_version
test case, if I remove that one without changing other code, the test will pass.
It looks like something was still holding a file handle to java.dll after the test was done. I have no idea what exactly, but adding bazel shutdown
to the tear_down
function seems to fix the problem.
https://github.com/bazelbuild/bazel/blob/25a9d531793e811acaa2c42fe99a1cfa578e75cd/src/test/shell/bazel/bazel_java_test.sh#L90-L92
I also noticed all those bazel_java_test
are quite slow, but not sharded..
@meteorcloudy Thanks for digging into this, I added bazel shutdown
and hope that the tests will pass.
@satyanandak CI is green
@sgowroji The merge commit broke the pipeline, I think that you need to regenerate the lockfile again.
@fmeum It's taken care internally while importing through CL.
@keertk Could we get a new release of javatools to pick up this change?
@fmeum yes sure - is there an urgency? If not, we'll get to it later this week once Bazel 7.3 is out.
@fmeum yes sure - is there an urgency? If not, we'll get to it later this week once Bazel 7.3 is out.
It's not urgent, it would just be great to get into 7.4.0.