-
Notifications
You must be signed in to change notification settings - Fork 18
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
Fix build for JDK 22+ #823
Conversation
The dependency changes work around the Gradle issue identified in eisop#806. The flag changes prepare for new javac warnings. With this PR, my build with JDK 22 worked. My build with JDK 23 initially got far enough for me to encounter the new warnings but then started failing with the kind of weirdly nondeterministic Gradle errors we've seen before: ``` BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 67 ```
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.
Thanks for tracking down the dependency errors @cpovirk!
I don't quite see the connection to JDK-8225377 you make in 806.
Shouldn't there be a separate javac issue if we manage to crash javac?
I've added #825 to run on JDK 22, 23-ea, and 24-ea.
On JDK 22 I see one jtreg failure and filed #826 for it. Otherwise, JDK 22 seems to work.
I tried a few things I found online to run gradle with one version of the JDK and the compiler with a newer version, but all my attempts failed.
If you know how to get gradle working on JDK 23 and JDK 24, I would appreciate a pointer.
As #825 seem to already successfully build, I'm not sure this PR actually changes anything for JDK 22. |
The reason that I cite JDK-8225377 is that the stack trace runs through As for the fact that the javac problem is a crash: Good point, thanks. I have started talking to @cushon about that. He agrees that the compiler shouldn't crash. Now we have to figure out what it should do instead (error, warning, RE: JDK 22 behavior: Strange, I am definitely seeing problems with 22 consistently. Even with the current head of #825 (d88cb01), I can reproduce the problem with Temurin ("OpenJDK22U-jdk_x64_linux_hotspot_22.0.2_9.tar.gz," which exactly matches the CI value), both with For Gradle setup, I have no hands-on knowledge. It seems in principle that the approach should look similar to this approach for testing under different versions, but I don't know if it works out that easily in practice. |
Ah: The CI sets |
...and in theory, that also answers your question about how to use a different JDK's compiler :) |
@cpovirk Thanks for your comments! I also added a new test that compiles with JDK 21 and then runs on the multiple other JDKs. This tests that the released EISOP CF, which is built with JDK 21, can execute on the different other JDKS. Any comments here or on #825 would be welcome! I'll merge #825 first and then we'll see that this PR fixes the JDK 22 failures. |
This won't build until after that PR, but I haven't rebased onto it yet.
@wmdietl there is one job still failling, looks like reltaed to permission on forked PR. Maybe something like this is needed in the CI.yml.
|
@cpovirk Thanks again for these fixes! Java 22 works now and 23/24 seem to start off well.
The warning seems correct, but I'm wondering why it doesn't show up on earlier JDKs. In a separate PR, I'll try to fix the setup to see this warning also on earlier JDKs, unless you know of why this only shows up on Java 23/24. |
I guess the assumption is that external PRs should not get write access to the repository, which makes sense. |
In earlier JDKs, I do get the Error Prone warning when having an invalid link, but not when missing the |
@Ao-senXiong Can you prepare a separate PR that disables the dependency submission job when in a fork? Or see what the benefit of that job is at all? |
|
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.
Thanks! This fixes the builds on JDK 22+!
The dependency changes work around the Gradle issue identified in
#806.
The flag changes prepare for new javac warnings.
With this PR, my build with JDK 22 worked. My build with JDK 23
initially got far enough for me to encounter the new warnings but then
started failing with the kind of weirdly nondeterministic Gradle errors
we've seen before: