sageserpent-open / americium

Generation of test case data for Scala and Java, in the spirit of QuickCheck. When your test fails, it gives you a minimised failing test case and a way of reproducing the failure immediately.
MIT License
15 stars 1 forks source link

Build fails on JDK 22-ea #67

Closed SethTisue closed 10 months ago

SethTisue commented 10 months ago

this came up over at https://github.com/scala/community-build/issues/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 commented 10 months ago

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

sageserpent-open commented 10 months ago

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

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

sageserpent-open commented 10 months ago

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 commented 10 months ago

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 44363e57a28541e9283b368579fcc82a70ff627d, 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 commented 10 months ago

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 e9c114fa8f2c5e53c7a9da799e60f2c9c611dfce.

sageserpent-open commented 10 months ago

@SethTisue I've fast-forwarded the master branch to e9c114fa8f2c5e53c7a9da799e60f2c9c611dfce; 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. :smile:

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 commented 10 months ago

after https://github.com/scala/community-build/commit/8ec83f1022fb8ec5e60d414fda4ab47801571e66 americium is green at https://scala-ci.typesafe.com/job/scala-2.13.x-jdk22-integrate-community-build/10/consoleFull 👍