[DO NOT MERGE] Initial script to build a working Graal binary, Windows #159
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.py
show 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.