[DO NOT MERGE] Initial script to build a working Graal binary, Windows#159
Draft
GavinRay97 wants to merge 1 commit intoHumbleUI:mainfrom
Draft
[DO NOT MERGE] Initial script to build a working Graal binary, Windows#159GavinRay97 wants to merge 1 commit intoHumbleUI:mainfrom
GavinRay97 wants to merge 1 commit intoHumbleUI:mainfrom
Conversation
Collaborator
|
This is fantastic! I’ll take a look soon and see if I can run on/adopt it to macOS. Being able to run from native image is a very desirable property! |
b4a6c73 to
bada613
Compare
Collaborator
|
The exception you see is probably due to reflection in App::makeWindow. Removed in 2a02339 |
Author
|
Ohh, 🤦 yeah that makes complete sense. |
c4ee4a9 to
5bdc87b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I deleted most of the example stuff just to get this working without building Skija locally since the dependency/build mgmt is done through Python scripts instead of Gradle/Maven (felt easier lol)
So don't merge this -- but the changes to
native_image.pyshow a working (for me) path towards building a Windows binary. You could build a shared/static lib with@CEntrypoint()and consume the Java app from C/C++ too.I am able to implement and test this for Linux as well, but I cannot test for Darwin unfortunately, as I don't own an Apple computer.
The Graal configuration needed for JNI and resources (the shared lib) to work can be distributed by putting them in the
.jar, under:META-INF/native-image/<group-id>/<artifact-id>, so I've done that here with the output of the tracing agent:Note there are some rough spots yet. Specifically:
I'm no Graal expert, just someone who has used it a bit. Can try to figure out more about this, but I think it may be because it never encounters the direct constructor invocation so doesn't include it in the compiled binary?
Not really sure.