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

Add GraalVM for JDK 21 support. #1236

Merged
merged 10 commits into from
Nov 29, 2023
Merged

Conversation

kkriske
Copy link
Contributor

@kkriske kkriske commented Nov 11, 2023

  • no longer register HomeFinderFeature post JDK 21
  • no longer link against fdlibm on Windows and Linux post JDK 21
  • link against extnet and mswsock on Windows post JDK 21
  • add --add-exports flag required for the GluonFeature internal API usage

Issue

Builds against GraalVM for JDK 21 run into some issues:

  • The HomeFinderFeature is no longer available by default since it's part of polyglot, and polyglot has been split off to separate maven artifacts. The feature is also automatically registered in a native-image.properties file in the META-INF of that dependency so it should not be required to register it manually.

Windows specific issues:

  • the nio library now depends on mswsock, so that needs to be added to the linker
  • the fdlibm library is no longer part of the JDK so it should be removed from the linker, not sure since what exact JDK version
  • the extnet library is now used on Windows in the WindowsSocketOptions class, so it needs to be added to the linker

Linux specific issues:

  • the fdlibm library is no longer part of the JDK so it should be removed from the linker, not sure since what exact JDK version

Other:

  • fdlibm should probably be removed from the remaining targets as well, but I have no way to verify that.

Progress

- no longer register HomeFinderFeature post JDK 21
- no longer link against fdlibm on Windows post JDK 21
- link against extnet and mswsock on Windows post JDK 21
- no longer link against fdlibm on Linux post JDK 21
- add required --add-exports for GluonFeature
Copy link
Contributor

@jperedadnr jperedadnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left some comments.
Tested successfully (with some changes) on Mac with Gluon's GraalVM 22.1.0.1-Final and the official GraalVM 21+35.1 (using also #1234)

In any case, note that the official GraalVM 21 builds will still fail building native images for mobile targets (more changes are required on Substrate, but also probably on the GraalVM builds)

@jperedadnr
Copy link
Contributor

@kkriske please fix conflicts (and do the refactoring if needed)

# Conflicts:
#	src/main/java/com/gluonhq/substrate/model/InternalProjectConfiguration.java
Copy link
Contributor

@jperedadnr jperedadnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@jperedadnr jperedadnr merged commit c58c5ab into gluonhq:master Nov 29, 2023
3 checks passed
@kkriske kkriske deleted the graalvm-21-support branch December 20, 2023 19:47
@credmond
Copy link

I've left some comments.
Tested successfully (with some changes) on Mac with Gluon's GraalVM 22.1.0.1-Final and the official GraalVM 21+35.1 (using also #1234)

In any case, note that the official GraalVM 21 builds will still fail building native images for mobile targets (more changes are required on Substrate, but also probably on the GraalVM builds)

Hey...could you tell me if Gluon is planning on a new official Gluon GraalVM build anytime soon?

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

Successfully merging this pull request may close these issues.

4 participants