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

Support for building with OpenJDK 21 #28326

Merged
merged 1 commit into from
Sep 23, 2023

Conversation

linghengqian
Copy link
Member

@linghengqian linghengqian commented Aug 31, 2023

Fixes #28293 .

Changes proposed in this pull request:

  • Support for building with OpenJDK 21.
  • Due to JEP 451, JDK21's CI has thousands more lines of warnings. Reference JDK 21 - Dynamic Loading of Agent (byte-buddy-agent-1.14.4.jar) mockito/mockito#3037 .
  • Since GraalVM Updater is deprecated in GraalVM CE 23.1.0 For JDK 21, the shardingsphere-infra-expr-espresso submodule will not be reusable, there are some temporary processing at Refactor shardingsphere-infra-expr to expose the use of Row Value Expressions SPI #28340 . Looking to the future, it is impossible for us to introduce the GPL LICENSE Espresso ontology into ShardingSphere. This module will be deleted or maintained by a third party in the foreseeable future.
  • The javac in GraalVM CE 23.1.0 For JDK21 may has bugs. An error occurred when the ShardingSphere Proxy Native was migrated to GraalVM CE 23.1.0 For JDK21 build. The build of ShardingSphere Proxy Native will continue using GraalVM 23.0.1 For JDK17.
========================================================================================================================
GraalVM Native Image: Generating 'apache-shardingsphere-proxy-native' (executable)...
========================================================================================================================
[1/8] Initializing...                                                                                   (12.0s @ 0.41GB)
Java version: 21+35, vendor version: GraalVM CE 21+35.1
Graal compiler: optimization level: 2, target machine: x86-64-v3
C compiler: gcc (linux, x86_64, 11.4.0)
Garbage collector: Serial GC (max heap size: 80% of RAM)
2 user-specific feature(s):
- com.oracle.svm.polyglot.groovy.GroovyIndyInterfaceFeature
- com.oracle.svm.thirdparty.gson.GsonFeature
------------------------------------------------------------------------------------------------------------------------
Build resources:
- 9.57GB of memory (75.6% of 12.67GB system memory, determined at start)
- 6 thread(s) (100.0% of 6 available processor(s), determined at start)
[2/8] Performing analysis...  []                                                                        (69.2s @ 2.78GB)
27,510 reachable types   (76.6% of   35,901 total)
45,905 reachable fields  (52.2% of   87,956 total)
140,093 reachable methods (55.7% of  251,477 total)
8,227 types,   300 fields, and 6,865 methods registered for reflection

Error: java.util.concurrent.ExecutionException: java.lang.ClassCastException: class jdk.vm.ci.meta.NullConstant cannot be cast to class org.graalvm.compiler.core.common.type.TypedConstant (jdk.vm.ci.meta.NullConstant is in module jdk.internal.vm.ci of loader 'bootstrap'; org.graalvm.compiler.core.common.type.TypedConstant is in module jdk.internal.vm.compiler of loader 'platform')
------------------------------------------------------------------------------------------------------------------------
11.9s (14.3% of total time) in 55 GCs | Peak RSS: 6.23GB | CPU load: 5.30
========================================================================================================================
Finished generating 'apache-shardingsphere-proxy-native' in 1m 21s.
com.oracle.svm.driver.NativeImage$NativeImageError
at org.graalvm.nativeimage.driver/com.oracle.svm.driver.NativeImage.showError(NativeImage.java:2336)
at org.graalvm.nativeimage.driver/com.oracle.svm.driver.NativeImage.build(NativeImage.java:1919)
at org.graalvm.nativeimage.driver/com.oracle.svm.driver.NativeImage.performBuild(NativeImage.java:1878)
at org.graalvm.nativeimage.driver/com.oracle.svm.driver.NativeImage.main(NativeImage.java:1852)
at java.base@21/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)

Before committing this PR, I'm sure that I have checked the following options:

  • My code follows the code of conduct of this project.
  • I have self-reviewed the commit code.
  • I have (or in comment I request) added corresponding labels for the pull request.
  • I have passed maven check locally : ./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e.
  • I have made corresponding changes to the documentation.
  • I have added corresponding unit tests for my changes.

pom.xml Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ShardingSphere fails to build on OpenJDK 21 EA
2 participants