-
Notifications
You must be signed in to change notification settings - Fork 35
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
Does not work on darwin/arm64 #22
Comments
I think it's possible that with what's in this PR you might have more luck. |
I have the same issue unfortunately, even with the PR.
|
I got it, the tree-sitter submodule just needs to be bumped to the latest version, the current one is two years out of date |
This doesn't get me much further unfortunately, getting the root works, getting its type doesn't:
|
@mbrdl Some months back I worked with someone to get java-tree-sitter working for them on macos. Looking through some of the logs, I think they were using arm64 which I guess implies Apple Silicon. I've got a fork of java-tree-sitter with some branches [1] that contain some of the related work from that occasion. I don't know if it will help in your case, but FWIW, this branch (containing a shell script to avoid using gradle) was what I was informed worked for them. (The script mentions x86-64 and linux, but that was just for my own testing as I don't have access to macos/arm64 -- if The discussions took place at the tree-sitter discord server (the invite link should be at the top of GH discussions for the tree-sitter repository) starting around 2023-03-13 and extending to about the end of 2023-03-20, if you're interested in taking a look at the details -- this will require some combing through unrelated conversations though. (It's been a while and I don't regularly work with Java so I don't recall clearly ATM what was done (^^; ) Anyway, I don't know if any of that will help, but FWIW. Good luck with whatever path you choose. [1] The following branches might be worth looking at:
[2] Note that the branch does not contain the second fix mentioned in #18:
|
Thanks for your efforts, but their issue looks unrelated unfortunately. Building works fine for me. |
Ah I see. Out of curiosity, do all the tests pass for you? |
Oh, maybe I got something mixed up. Building the lib with
But the jitpack version should work, no? |
I've not used the jitpack version and I don't know whether it works with macos + arm64. Based on other reports at this repository it wouldn't surprise me if it didn't, but this is just a guess. I tried manually fetching the jar of the most recent version listed at jitpack.io here and looked inside. (For reference, this is what I downloaded.) I didn't see any shared library, just
I wouldn't be surprised if one needs to arrange for the necessary "native" bits some other way. May be the instructions in the README:
imply that one must do some building to get things working. FWIW, the branches I mentioned before have various changes in them including (but not limited to) things like modifying the gradle version and tweaking |
Right, I've built the shared library. It works in principle, as I'm able to parse a program and get its root node. I'm unable to get the root node's type, however. |
Curious indeed. If getting the root node's type is not working, I wonder if there is something wrong with the dynamic library. The error output from here vaguely reminds me of some things that were tried to get things working here. I don't know if it's really relevant, but tweaking Dong the aforementioned was important in our case because as-is the java-tree-sitter repository content wasn't working on multiple operating system setups (it wasn't just macos). Once I got it working for Linux x86_64, there was a more solid basis from which to proceed. However, ultimately I found that trying to get appropriate diagnostic information out of the gradle build process to be on the opaque and frustrating side -- that's what motivated the shell script approach. With a shell script, the details of the whole procecss were much more apparent and individual commands and their output could be more readily tweaked and examined. So things we ended up doing at one point or another included:
|
FYI, I forked and added functionalities for java-tree-sitter. It works on MacOS ARM64 and Linux ARM64 and AMD64 |
@juli1 Thanks for mentioning your results and fork. I looked over some of the commits and see some of the additions you mentioned along with fixes. |
On a side note, does anyone know if there have been attempts to hook up to tree-sitter via the relevant parts of Panama like may be this? May be there will be enough in JDK 21 (2023-09) to allow movement away from use of JNI. |
Easy workaround is to change variable cpp to True in build.py Seems to work. |
On a side note, tree-sitter-ng might be a potential alternative depending on one's use case. |
I am trying to use the project for Darwin/ARM64. The problem I am facing is that the program crashes. I am trying to use tree-sitter-python. I am using the configuration directives from the README file.
The program I am using is the following
At the instruction
Node root = tree.getRootNode();
, the program crashes. This is the stack traceFYI, I am using the JVM amazoncorretto17
The text was updated successfully, but these errors were encountered: