-
Notifications
You must be signed in to change notification settings - Fork 145
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
Attempt to fix graalpy-install-package #259
base: master
Are you sure you want to change the base?
Conversation
@timfel -- when you get chance, could you take a look at this? I can't figure out what I need to change so that the Python module is included in the native executable. Thanks. |
graalpy-install-package/pom.xml
Outdated
<!-- native-image-resources.json specifies what resources will be added to the | ||
native executable. | ||
See also https://www.graalvm.org/latest/reference-manual/native-image/dynamic-features/Resources/ --> | ||
<buildArg>-H:ResourceConfigurationFiles=native-image-resources.json</buildArg> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A configuration file should be named resource-config.json
. Could that be a reason? If you put it in META-INF/native-image/, native-image
should pick it up, but not sure about the plugin.
I think the entire thing should be deleted and recreated with the graalpy-maven-plugin. I'll try to make time to do that. |
I've updated the example using the maven plugin. Now the native image fails because of the use of AWT. IIRC this is documented to be complicated with native image, one has to use the tracing agent and some options to get it to work. |
Many thanks @timfel. We're getting the following error on Windows 11
As you say, native image on macOS and Linux fails because of AWT. |
That's a bug we had in 24.0 on Windows. I worked around it, but it still won't work, the native image on windows fails because of AWT as well:
|
A fix could be to add this: modified graalpy-install-package/pom.xml
@@ -131,6 +131,7 @@
<arguments>
<argument>-classpath</argument>
<classpath />
+ <argument>-agentlib:native-image-agent=config-output-dir=${project.build.outputDirectory}/META-INF/native-image/awt/</argument>
<argument>${main.class}</argument>
</arguments>
</configuration> Then when you run |
Not sure what changed, but this no longer compiles using
There's no /Users/bhoran/Oracle/GraalVM/graalvm-demos/graalpy-install-package/target/classes/vfs/venv/bin/graalpy. |
I tried on Windows and Linux with OpenJDK and Graal JDK and it works on both machines. Did you run |
@bhoran I updated the README with steps to make the native image work. I tested the steps on Linux and Windows. |
I've added a profile to the POM to build a native executable, which succeeds, but the resulting binary does not run. This is mainly due to resource files, AFAICT.