eclipse-openj9 / openj9

Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.
Other
3.29k stars 722 forks source link

mac jdk23 Semeru failing to compile - unknown enum constant Feature.UNNAMED_CLASSES #19994

Open pshipton opened 3 months ago

pshipton commented 3 months ago

The Semeru xmac build is failing to compile, either from the 0.47 branches or the latest. (boot JDK Temurin 21.0.4) https://hyc-runtimes-jenkins.swg-devops.com/job/build-scripts/job/jobs/job/jdk23/job/jdk23-mac-x64-openj9/4 https://hyc-runtimes-jenkins.swg-devops.com/job/build-scripts/job/jobs/job/jdk23/job/jdk23-mac-x64-openj9/10

22:20:53  Compiling up to 17 files for BUILD_JAVAC_SERVER
22:20:55  warning: unknown enum constant Feature.UNNAMED_CLASSES
22:20:55  error: warnings found and -Werror specified
22:20:55  1 error
22:20:55  1 warning
22:20:55  make[3]: *** [/Users/jenkins/workspace/build-scripts/jobs/jdk23/jdk23-mac-x64-openj9/workspace/build/src/build/macosx-x86_64-server-release/buildtools/interim_langtools_modules/java.compiler.interim/_the.BUILD_java.compiler.interim_batch] Error 1

The open build is working. (boot JDK Semeru 21.0.1) https://openj9-jenkins.osuosl.org/job/Build_JDK23_x86-64_mac_Nightly/7/ https://openj9-jenkins.osuosl.org/job/Build_JDK23_x86-64_mac_Release/2/

Other than the boot JDK, I'm not sure what's different.

jdk.internal.javac.PreviewFeature.Featue.UNNAMED_CLASSES exists in jdk21 (and jdk22), but not in jdk23. Removed via https://github.com/ibmruntimes/openj9-openjdk-jdk23/commit/c3f769f9144

I found the following which may be related. https://github.com/search?q=repo%3Aibmruntimes%2Fopenj9-openjdk-jdk23%20UNNAMED_CLASSES&type=code

pshipton commented 3 months ago

@keithc-ca any ideas what's going on?

keithc-ca commented 3 months ago

I'll have a look.

keithc-ca commented 3 months ago

I see the same symptoms on xlinux using a temurin jdk21 as the boot jdk.

keithc-ca commented 3 months ago

I think the problem is due to references to PreviewFeature.Feature.UNNAMED_CLASSES in the bootjdk but absent in the interim compiler via the patch (--patch-module java.base=$(BUILDTOOLS_OUTPUTDIR)/gensrc/java.base.interim in CompileInterimLangtools.gmk). We can either use Java 22 (temurin or openj9) for the bootjdk or patch PreviewFeature.java to allow continued use of Java 21 (temurin) for the bootjdk. My preference is the former unless https://github.com/eclipse-openj9/openj9/issues/19694 will not be addressed soon enough.

keithc-ca commented 3 months ago

Changes linked above address this. Those changes should be reverted once the minimum bootjdks are updated to remove Java 21.

pshipton commented 3 months ago

I've merged the changes. Keeping this open in the next milestone plan as a reminder to revert.