Closed balbert3 closed 11 months ago
Thanks for reporting this issue - is there a particular grammar you are trying to install where you see this?
Can you provide any more details on how to reproduce it?
Thanks. This was an issue for every grammar I tried e.g. the python grammar (https://github.com/tree-sitter/tree-sitter-python).
I just now installed gcc using apt in the base system and the error no longer occurs. I'm not sure if this is the correct solution because it seems that the snap packages its own version of gcc that perhaps should be used instead. A different error occurs btw when using treesit-install-language-grammar if git is not provided by the base system, although git does not seem to be packaged by the snap, so perhaps this is the expected behavior.
In general the emacs snap needs to use it's own libc and gcc to compile tree-sitter modules since they get loaded by emacs and hence need to be compatible with the toolchain that emacs itself was compiled with.
However I don't think you should have to install gcc yourself as this defeats the purpose of shipping our own gcc with the snap - so I think perhaps there is some missing include path or somesuch that is needed here.
Regarding git, that seems a bit different - in general, I don't think most users would expect emacs to use it's own git client instead of the host installed one... so for now I think that may have to stay as a 'known' issue.
I'll see if I can reproduce the general issue reported here though and try and fix that - out of interest, what distro are you running this on?
Great thanks again. This is an issue on Debian 12 and I've also reproduced it on Ubuntu 23.04.
I have managed to reproduce this and have come up with a fix in https://github.com/alexmurray/emacs-snap/commit/2d069d911ecaf519e9e5fd87e94ac64afedeae4e and have tested this locally against Ubuntu 18.04, 22.04 and 23.04.
I have also triggered new builds of the snap containing this fix which should be available in the next few hours - if you could please refresh to this new version and let me know if it fixes this issue for you as well that would be great.
Yes your updated snap fixes the issue for me (tested on Debian 12).
Excellent thanks for letting me know. I'll close this issue then.
Running treesit-install-language-grammar gives the error:
This is with
on