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

Feature/graal support #256

Merged
merged 29 commits into from
Aug 13, 2021
Merged

Feature/graal support #256

merged 29 commits into from
Aug 13, 2021

Conversation

piiertho
Copy link
Member

@piiertho piiertho commented Jul 28, 2021

This adds GraalVM native image support.
This adds to Gradle plugin option to generate GraalVM native image.
This adds command line argument --java-vm-type.
This adds godot kotlin specific project configuration file godot_kotlin_configuration.json.

Currently platforms supported are Windown, Linux and MacOS, on AMD64 hosts.

Warning: Reloading is not possible with native-image, as it would require to reload JVM.

@piiertho piiertho self-assigned this Jul 28, 2021
@piiertho piiertho force-pushed the feature/graal-support branch from f89a3de to f8f1d0a Compare July 28, 2021 16:45
src/jni/jvm.h Outdated
@@ -10,24 +10,32 @@ namespace jni {

class Jvm {
public:
enum Type {
HOTSPOT,
GRAAL,
Copy link
Member

Choose a reason for hiding this comment

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

I think it's confusing to use Graal for native images as you could also use Graal as a regular JVM, which in this case would fit in the Hotspot value.
Maybe JVM, NATIVE, and ART ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of NATIVE, maybe something more specific - NATIVE_IMAGE.

Copy link
Member Author

Choose a reason for hiding this comment

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

JVM, NATIVE_IMAGE and ART, is everyone ok with this ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would even opt for GRAAL_NATIVE_IMAGE to be very specific. IMO NATIVE_IMAGE is a bit generic

docs/src/doc/user-guide/exporting.md Show resolved Hide resolved
harness/bunnymark/build.gradle.kts Outdated Show resolved Hide resolved
docs/src/doc/user-guide/advanced/graal-vm-native-image.md Outdated Show resolved Hide resolved
harness/tests/.gitignore Show resolved Hide resolved
harness/bunnymark/.gitignore Show resolved Hide resolved
src/gd_kotlin.cpp Outdated Show resolved Hide resolved
src/gd_kotlin.cpp Outdated Show resolved Hide resolved
@chippmann
Copy link
Contributor

I would also add your statement Warning: Reloading is not possible with native-image, as it would require to reload JVM. to the docs

@chippmann chippmann mentioned this pull request Jul 29, 2021
@piiertho piiertho requested review from chippmann and CedNaru July 31, 2021 08:46
@piiertho piiertho requested a review from chippmann August 6, 2021 15:01
Copy link
Contributor

@chippmann chippmann left a comment

Choose a reason for hiding this comment

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

One last comment, but that's nitpicking so up to you if you want to do it as well.
Awesome work! At one point it maybe would make sense to write a little section in the knowledge base regarding the usage of graalvm native image for contributors but that's not very important now.

!!! warning
GraalVM native image is a advanced feature and requires a lot of work to support. Especially if you rely on many third party libraries.

In order to build for graalvm, follow `GraalVM native-image` section in advanced user guide.
Copy link
Contributor

Choose a reason for hiding this comment

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

One tiny thing: I would link the corresponding page here: GraalVM native image

@piiertho piiertho force-pushed the feature/graal-support branch from 01ecc1c to d6548f0 Compare August 9, 2021 12:11
@piiertho piiertho merged commit 2f431c0 into master Aug 13, 2021
@piiertho piiertho deleted the feature/graal-support branch August 13, 2021 08:35
@chippmann chippmann mentioned this pull request Sep 8, 2021
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