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

ci: update to GraalVM 23 #922

Merged
merged 5 commits into from
Jul 26, 2023
Merged

Conversation

kkriske
Copy link
Contributor

@kkriske kkriske commented Jun 15, 2023

GraalVM 23.0.0 has been released.
This updates the CI to this version. This release should include oracle/graal#5932 which enables the native-exported flow on unix and darwin systems.

The org.graalvm.sdk:graal-sdk dependency in the pom is still set to 22.3.2, the latest release is compiled with java 17 so that would force anyone using native-image to use at least a java 17 jdk.
Going forward, GraalVM releases will follow the latest LTR releases from java, so the next version (23.1.0) will likely require java 21.

This is still a draft as the CI will keep failing because the graalvm/setup-graalvm action does not support the latest release yet: graalvm/setup-graalvm#45

@kkriske
Copy link
Contributor Author

kkriske commented Jun 16, 2023

@gotson the linked GraalVM issue that should fix the native-exported flow on linux and macos does not work in the way I thought it works. It only works if you use System.loadLibrary. In order to do so, I added an additional last resort that uses this call, however it still seems to fail on MacOS and I am unsure why.

Edit: I did figure out why MacOS fails, see the linked GraalVM issue. The libraries for MacOS are packaged as a .jnilib file. This seems legacy from pre java 7 (https://bugs.openjdk.org/browse/JDK-7134701). The default naming now seems to be .dylib. Is it at all an option to change the libraries to the .dylib extension and remove the .jnilib name handling?

@kkriske
Copy link
Contributor Author

kkriske commented Jul 15, 2023

@gotson Friendly reminder of the existence of this draft, to request your input on the previous comment.
If it's ok to rename the macos libraries I can move forward with this, otherwise it'll require either a temp workaround to rename the libary when unpacking them or this will have to wait until oracle/graal#6823 is merged and included in, hopefully, the next GraalVM release in september.

@gotson
Copy link
Collaborator

gotson commented Jul 17, 2023

Thanks for the reminder, I'll try to have a look this week.

@gotson gotson self-assigned this Jul 17, 2023
@gotson
Copy link
Collaborator

gotson commented Jul 18, 2023

the latest release is compiled with java 17 so that would force anyone using native-image to use at least a java 17 jdk.
Going forward, GraalVM releases will follow the latest LTR releases from java, so the next version (23.1.0) will likely require java 21.

I am not familiar with GraalVM, what would be the impact of that ? My understanding is that it would impact projects using sqlite-jdbc, and wanting to compile to native, would be forced to used JDK17 (and later 21). The only downside i can think of is if the project compiles with an older JDK (like 8), but not with JDK17. If that's the case, i think that's a relatively small downside.

Edit: I did figure out why MacOS fails, see the linked GraalVM issue. The libraries for MacOS are packaged as a .jnilib file. This seems legacy from pre java 7 (https://bugs.openjdk.org/browse/JDK-7134701). The default naming now seems to be .dylib. Is it at all an option to change the libraries to the .dylib extension and remove the .jnilib name handling?

Thanks for the analysis. We should ditch .jnilib altogether, and use .dylib instead. That would better be done in a separate PR though, if you're up for the task?

@gotson gotson removed their assignment Jul 18, 2023
@kkriske
Copy link
Contributor Author

kkriske commented Jul 19, 2023

what would be the impact of that

I think your understanding is correct. A project using sqlite-jdbc that's compiling to java 8 wouldn't be a problem, because that project should at no point load the java classes compiled to JDK 11/17/21/.. The JDK version requirement is only enforced when actually using native-image.
And actually it won't really have an impact anymore, as for now the graal-sdk artefact will be compatible with JDK 11 (starting from the next 23.0.1 minor) so that doesn't change anything to the current compilation levels. It shouldn't be any problem staying on older graal-sdk versions either as the API should be stable.
The only time issues can arrise is if a new GraalVM version contains a breaking API change. Other than that, the minimal supported GraalVM version is dictated by whatever graal-sdk API calls and GraalVM features are actually used.

Thanks for the analysis. We should ditch .jnilib altogether, and use .dylib instead. That would better be done in a separate PR though, if you're up for the task?

I can look into that. My experience with makefiles is limitted, but it does seem like a fairly trivial change to do.


With those things cleared up, if we stay on graal-sdk:22.3.2 for now, combined with the library extension rename, the checks should be all green.

@gotson
Copy link
Collaborator

gotson commented Jul 19, 2023

I can look into that. My experience with makefiles is limitted, but it does seem like a fairly trivial change to do.

I thought you already knew that's why I offered. Else I can take care of it, it shouldn't be too hard, mostly search and replace, and remove custom logic.

@kkriske
Copy link
Contributor Author

kkriske commented Jul 20, 2023

I've created #939 for the jnilib -> dylib rename and cherrypicked the changed onto this PR so I can actually validate it works for this PR.

@gotson
Copy link
Collaborator

gotson commented Jul 24, 2023

I've created #939 for the jnilib -> dylib rename and cherrypicked the changed onto this PR so I can actually validate it works for this PR.

merged, you can this rebase on master

@kkriske kkriske marked this pull request as ready for review July 24, 2023 20:41
@kkriske
Copy link
Contributor Author

kkriske commented Jul 24, 2023

merged, you can this rebase on master

Rebased & marked as ready for review.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@gotson gotson merged commit 840ce0e into xerial:master Jul 26, 2023
24 checks passed
@gotson gotson changed the title update to GraalVM 23.0.0 ci: update to GraalVM 23 Jul 26, 2023
@gotson
Copy link
Collaborator

gotson commented Jul 26, 2023

thanks @kkriske !

@kkriske kkriske deleted the update-to-graalvm-23.0.0 branch August 8, 2023 10:05
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.

2 participants