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

Build fails on JDK 22-ea #67

Closed
SethTisue opened this issue Oct 26, 2023 · 7 comments
Closed

Build fails on JDK 22-ea #67

SethTisue opened this issue Oct 26, 2023 · 7 comments
Assignees
Labels

Comments

@SethTisue
Copy link

this came up over at scala/community-build#1698

the error log is at https://scala-ci.typesafe.com/job/scala-2.13.x-jdk22-integrate-community-build/5/artifact/logs/americium-build.log

[americium] [error] /home/jenkins/workspace/scala-2.13.x-jdk22-integrate-community-build/target-0.9.20/project-builds/americium-dbbf5c572137f8fb5006389b9d69366e6ca04763/src/main/java/com/sageserpent/americium/java/TrialsScaffolding.java:314:1: cannot find symbol
[americium] [error]   symbol:   method builder()
[americium] [error]   location: class com.sageserpent.americium.java.TrialsScaffolding.OptionalLimits
[americium] [error] OptionalLimits.builder
[americium] [error] /home/jenkins/workspace/scala-2.13.x-jdk22-integrate-community-build/target-0.9.20/project-builds/americium-dbbf5c572137f8fb5006389b9d69366e6ca04763/src/main/java/com/sageserpent/americium/java/TrialsScaffolding.java:343:1: cannot find symbol
[americium] [error]   symbol:   method builder()
[americium] [error]   location: class com.sageserpent.americium.java.TrialsScaffolding.OptionalLimits
[americium] [error] builder

obviously it's early to be worrying about JDK 22, but reporting regardless :-)

@sageserpent-open
Copy link
Owner

Thanks for reporting, @SethTisue . I’ll take a look…

@sageserpent-open
Copy link
Owner

WIP on branch issue-62-community-build-jdk-22.

First off, I noticed that the community build americium.conf has some workaround flags defined (scala/community-build@b275882) - the Scala versions have been bumped to 2.13.12 and 3.3.1 as of Git commit SHA: d229de7.

@sageserpent-open
Copy link
Owner

After some faffing around getting SBT to play with JDK 22, the reported problem is reproduced locally:

Screenshot 2023-10-27 at 11 48 17

@sageserpent-open
Copy link
Owner

sageserpent-open commented Oct 27, 2023

Something is awry with Lombok code generation...

The problem isn't due to the -source or -target Java compiler options being set to "22" as opposed to "1.9". As of commit 44363e5, the old Java source and target settings were reinstated, but SBT was run inside IntelliJ using IntelliJ to control the choice of JDK.

Running SBT under JDK 20, all is fine and Lombok generates the necessary builder method.
Running SBT under the early-access JDK 22, Lombok fails to generate the builder method.

I did wonder whether the SBT version upgrade from 1.8.3 to 1.9.7 might have had a bearing, but if so, this has been a problem since 1.9.0-RC1. Given the build is successful under JDK 20, I'm inclined to keep the hypothesis simple and blame either Lombok itself running within JDK 22 or something about the interaction between SBT and Lombok that doesn't play well with JDK 22...

@sageserpent-open
Copy link
Owner

sageserpent-open commented Oct 27, 2023

Rather than fight the unholy trinity of SBT, Lombok and JDK 22, having noticed that the class exhibiting the missing symbol was deprecated, I've avoided the issue by removing it a little earlier than I'd envisioned as of Git SHA e9c114f.

@sageserpent-open
Copy link
Owner

@SethTisue I've fast-forwarded the master branch to e9c114f; this builds cleanly with SBT under JDK 22, although for now it continues to target JDK 19 for the compiled outputs.

I did however locally modify build.sbt to target JDK 22 for the compiled outputs, and this also built cleanly, passing the tests, so in theory the community build should be OK for Americium.

I'm not sure whether you manually edit the .conf files or run a job to pick up the latest changes, but either way, it's there for you to wave your magic wand over. 😄

I have some general code cleanup to do engendered by this work, so I'll leave this ticket open for a while and won't do a release just yet.

If there are further issues with the community build, let me know on this ticket...

@SethTisue
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants