Skip to content
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

add SVM metadata #349

Open
martinlippert opened this issue Aug 5, 2019 · 8 comments
Open

add SVM metadata #349

martinlippert opened this issue Aug 5, 2019 · 8 comments

Comments

@martinlippert
Copy link

When using lsp4j with SVM (Substrate VM from Graal, which is being used when compiling native images) you need to configure the reflective access that lsp4j does at runtime in some metadata. Would be great if lsp4j would ship that metadata out-of-the-box.

An example for that is:
https://github.com/netty/netty/tree/4.1/transport/src/main/resources/META-INF

I have a manually configured (and most likely incomplete) reflection metadata file, but I assume that lsp4j would prefer to generate that somehow from the protocol.

@svenefftinge
Copy link
Contributor

Can you share your manual version? Will make it easier to write a generator.

@martinlippert
Copy link
Author

Here is one that I used for a super simple example, but it is deeply incomplete and not fully correct in many places. Here is the more exact spec about the reflect.json in general:

https://github.com/oracle/graal/blob/master/substratevm/REFLECTION.md#manual-configuration

Does that help?

@ericdallo
Copy link
Contributor

@martinlippert I'm having issues with lsp4j to make clojure-lsp compile with graalvm, could you provide your config please?

@ericdallo
Copy link
Contributor

I'm having this error after starting the LSP server:

Jan 26, 2021 7:31:20 PM org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint request
WARNING: Unsupported request method: initialize

Process clojure-lsp stderr<1> finished

It seems it's using the GenericEndpoint class instead of RemoteEndpoint, any suggestions @svenefftinge ?

@martinlippert
Copy link
Author

@ericdallo here is the json config that I created back then to tell the GraamVM native image builder about the necessary reflection data:

reflect-config-lsp4j.json.txt

But it is quite old, so will most likely not be up-to-date with the latest lsp4j version anymore.

@ericdallo
Copy link
Contributor

Thank you very much @martinlippert, but I figured it out using graalvm java agent :D
Here is the result: https://github.com/clojure-lsp/clojure-lsp/pull/267/files#diff-c9e5f51124011a1b501edebc4681383bbf5b7a7f5c11eee3ef721dc929c56732R1

@martinlippert
Copy link
Author

Awesome, great to hear that!!!

@apupier
Copy link
Contributor

apupier commented Oct 15, 2021

I think that merging also with the Lemminx files could help to have a better coverage https://github.com/eclipse/lemminx/tree/master/org.eclipse.lemminx/src/main/resources/META-INF/native-image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants