-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[native-image] VMError$HostedError from JNIRegistrationSupport.makeShimDLL on Windows after adding circe-yaml and SnakeYAML #4659
Comments
Just to make sure: AWT code was reachable before or did one of the new yaml dependencies make it reachable? If the latter is the case, I'd look into why AWT code is now reachable. For a yaml parser, I don't really see a need for AWT. |
From what I know and understand about Bleep, circe-yaml and SnakeYAML, there is no relation to AWT. These are command line application and parsing libraries, that shouldn't touch AWT or do any kind of GUI stuff. Could you explain to me why you're asking about AWT code? What does this have to do with AWT? There are all command line application and parsing libraries we're talking about after all. |
You mentioned that Bleep compiles just fine before adding the new dependency. Do you see an awt.dll generated when the build succeeds? If not, the new dependency must somehow make AWT code reachable. |
Here are the verbose logs from "before" my changes. They look very similar to "after". The only place where AWT is mentioned is Unfortunatelly I can't test this locally on my computer since I don't have Windows, I can only run it on GitHub Actions. Where should the oyvindberg/bleep#149
|
An earlier windows build does not generate an
I grepped and found this in snakeyaml source code here, quoted below
This may be a likely culprit for the AWT dependency |
Wow, a parsing library depending on AWT... I guess I should have already learned to expect the unexpected 😸 I did try googling for GraalVM issues related to SnakeYAML, but to no success. Is AWT not supposed to work on GraalVM on Windows (#2545 is still open)? Can we turn the build failure into a potential (hopefully not happening) runtime failure? |
You could run with something like
AWT on Windows works, but it requires appropriate NI configuration, which the tracing agent can help you generate. I wouldn't try and turn it into a run-time failure, I would probably file a ticket against SnakeYAML or try to avoid it to be honest. The additional AWT classes are bloating the size of your Native Image executables and the dependency on Could you please rebuild your app with a proper Native Image configuration in place? If that doesn't fix the reported issue, please re-open the ticket. |
I can maybe congigure the SnakeYAML library so that the code that invokes AWT won't get executed. But the code will technically still be reachable, right? How can I trick native-image to think AWT is not reachable? |
You could try and initialize SnakeYAML or some specific classes of it at build-time, but I'm not sure how well that'll work. |
we fixed this by using a redesigned version of snakeyaml which is called snakeyaml-engine thanks for your prompt, detailed and useful feedback here :) |
Great, you are welcome! |
Describe the issue
Bleep is a Scala project which compiles with native-image just fine. But when I add the library
circe-yaml
(which transitively brings insnakeyaml
), it starts failing on Windows (it keeps working on Linux and macOS).The error is
Steps to reproduce the issue
Please include both build steps as well as run steps
https://github.com/sideeffffect/bleep/tree/yaml
git clone --branch yaml https://github.com/sideeffffect/bleep.git
sbt --client "bleep-cli/assembly"
(link)mkdir dist && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" && native-image --native-image-info --verbose --enable-url-protocols=https -jar bleep-*.jar dist/bleep-windows
(link)Describe GraalVM and your environment:
link
More details
Related PR: oyvindberg/bleep#148
Logs: https://github.com/oyvindberg/bleep/runs/6970916881?check_suite_focus=true#step%3A7%3A202=
The text was updated successfully, but these errors were encountered: