alexmurray / emacs-snap

GNU Emacs in a snap
https://snapcraft.io/emacs
71 stars 13 forks source link

Update tree-sitter for compatibility with newer tree-sitter grammars #89

Closed fmqa closed 1 week ago

fmqa commented 2 weeks ago

As detailed in https://github.com/tree-sitter/tree-sitter/issues/3296 – tree-sitter >=0.22.4 has introduced an ABI break that renders tree-sitter grammars depending on tree-sitter >=0.22.4 incompatible with Emacsen linked against an older tree-sitter version.

As the Emacs snap uses tree-sitter v0.20.9, the result is that most grammars that use the newer ABI do not work OOTB when installing with M-x treesit-install-language-grammar. Notably, this affects tree-sitter-go, which depends on the newer ABI since https://github.com/tree-sitter/tree-sitter-go/commit/174bc4405b312fde1c5d78468fccf0ad27e41617 and no longer works on the Emacs snap OOTB.

On #emacs and on the tree-sitter issue board, the general consensus is that distributors should rebuild all consumers of tree-sitter for new versions. I think that may be worth considering for the Emacs snap, especially given that a) most grammars have switched to the new ABI and b) a newer tree-sitter is necessary to make use of them.

fmqa commented 2 weeks ago

Note that other Emacs distributions e.g. flatpak have already done the same: https://github.com/fejfighter/pgtk-emacs-flatpak/commit/0fe14996e742562f86d28d6d8865618cdb6ab6ae