-
Notifications
You must be signed in to change notification settings - Fork 323
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
Another follow up to parser library loading issue #10134
Conversation
Parser is present in both `runtime.jar` and `runner.jar` jars, leading to shared library loading issues: ``` Caused by: java.lang.UnsatisfiedLinkError: Native Library <...>/component/libenso_parser.so already loaded in another classloader at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:167) at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:139) at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2418) at java.base/java.lang.Runtime.load0(Runtime.java:852) at java.base/java.lang.System.load(System.java:2025) at org.enso.runtime/org.enso.syntax2.Parser.initializeLibraries(Parser.java:36) ... 43 common frames omitted Caused by: java.lang.UnsatisfiedLinkError: Can't load library: <...>/target/rust/debug/libenso_parser.so at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2422) ``` This change ensures that library is only loaded once.
I don't understand why this change should help with classloading.
Clearly the class is being loaded twice. With your change it is still going to be loaded twice - e.g. I don't think this fixes anything. |
The hotfix is to disable Y.doc server being started automatically. |
This was a stacktrace from before this PR. If you move loading the library to the static initializer the classloaders will match and it will not complain. I built IDE and it was happy. Having said that, the constructed native image has a problem with this change:
Making it initialize the class at runtime also won't work now because the newly added Feature itself uses Parser thus forcing the initialization at build time. I can see one way to resolve this - statically linking the |
Rendered obsolete as noted in the above comment and #10141 |
Pull Request Description
Parser is present in both
runtime.jar
andrunner.jar
jars, leading to shared library loading issues:This change ensures that library is only loaded once.
Important Notes
Follow up to #10123