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

Wire up oneversion tool in java_tools #22246

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fmeum
Copy link
Collaborator

@fmeum fmeum commented May 6, 2024

  • Add a prebuilt one_version tool as well as sources to java_tools.
  • Avoid passing --whitelist to one_version if no allowlist is configured in the toolchain as it isn't supported by the Bazel version of oneversion yet.
  • Document the one_version flags.
  • Clean up tests not updated after recent rules_java releases.

Work towards #1071

@fmeum fmeum requested a review from lberki as a code owner May 6, 2024 12:02
@fmeum fmeum requested review from cushon and removed request for lberki May 6, 2024 12:02
@github-actions github-actions bot added team-Rules-Java Issues for Java rules awaiting-review PR is awaiting review from an assigned reviewer labels May 6, 2024
@fmeum fmeum force-pushed the one-version branch 2 times, most recently from 2a15505 to 1e8ff63 Compare May 6, 2024 13:41
@cushon cushon requested a review from hvadehra May 28, 2024 18:19
@fmeum
Copy link
Collaborator Author

fmeum commented May 28, 2024

@bazel-io fork 7.2.0

@keertk keertk 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 May 28, 2024
@Wyverald
Copy link
Member

To confirm, does this change take effect without a java_tools release?

@fmeum
Copy link
Collaborator Author

fmeum commented May 29, 2024

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.

@fmeum
Copy link
Collaborator Author

fmeum commented May 29, 2024

I resolved the conflict.

* Adds a prebuilt `one_version` tool as well as sources to `java_tools`.
* Avoids passing `--whitelist` to `one_version` if no allowlist is configured in the toolchain, which isn't supported by the Bazel version of `oneversion` yet.
* Documents the `one_version` flags.
* Clean up tests not updated after recent rules_java releases.
@hvadehra
Copy link
Member

@fmeum CI appears to be unhappy with this on Windows

@fmeum
Copy link
Collaborator Author

fmeum commented May 29, 2024

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.

@satyanandak
Copy link

@fmeum Could you please take a look at the failing checks?

@fmeum
Copy link
Collaborator Author

fmeum commented May 30, 2024

@meteorcloudy Do you happen to have an idea what could be causing such an error?

@meteorcloudy
Copy link
Member

I have no idea.. but let me try if I can reproduce it locally

@meteorcloudy
Copy link
Member

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.

function tear_down() {
rm -rf "$(bazel info bazel-bin)/java"
}

@meteorcloudy
Copy link
Member

meteorcloudy commented May 31, 2024

I also noticed all those bazel_java_test are quite slow, but not sharded..

@fmeum
Copy link
Collaborator Author

fmeum commented May 31, 2024

@meteorcloudy Thanks for digging into this, I added bazel shutdown and hope that the tests will pass.

@fmeum
Copy link
Collaborator Author

fmeum commented May 31, 2024

@satyanandak CI is green

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally team-Rules-Java Issues for Java rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants