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

"Language’s ABI is too new" error in tree-sitter #278

Closed
twhththt opened this issue Dec 5, 2022 · 5 comments
Closed

"Language’s ABI is too new" error in tree-sitter #278

twhththt opened this issue Dec 5, 2022 · 5 comments

Comments

@twhththt
Copy link

twhththt commented Dec 5, 2022

I added the following to my home-manager configuration

home.packages = with pkgs; [
  ((emacsPackagesFor emacsGit).withPackages (epkgs: [
    epkgs.tree-sitter
    epkgs.tree-sitter-langs
  ]))
];

and init.el

  (require 'tree-sitter)
  (require 'tree-sitter-langs)
  (global-tree-sitter-mode)
  (add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode)

However, when I enable tree-sitter-mode in a CPP file, I got this error

tree-sitter-load: Language’s ABI is too new: 14, (13 . 13), "/nix/store/ssqrcpzj63xjsm4z4sam42vvkh9m1gsj-emacs-tree-sitter-grammars/langs/bin/cpp.so"

Looks like some of the packages are not built with the same toolchain. Any idea on how to solve this problem?

@twhththt
Copy link
Author

twhththt commented Dec 5, 2022

I realized this could be an upstream nixpkgs issue for cpp specifically. tree-sitter is working for me in nix-mode. Should I start with checking the drv files of tree-sitter-cpp-grammar and emacs and see if they are using the same stdenv?

@twhththt
Copy link
Author

twhththt commented Dec 6, 2022

found out the reason: emacs-tree-sitter/elisp-tree-sitter#247

@twhththt twhththt closed this as completed Dec 6, 2022
@twhththt
Copy link
Author

twhththt commented Dec 6, 2022

It seems that pinning tree-sitter-cpp to use 0.19 toolchain is difficult because the generated code is checked in: tree-sitter/tree-sitter-cpp@88ad63b. The build process of tree-sitter grammars seems pretty messy in general.

@necrophcodr
Copy link

@twhththt I realize this is closed, but the issue appears to persist. Is the "solution" today to simply not use tree-sitter then?

@willbush
Copy link

@necrophcodr I ran into the same issue. After searching around I think the simplist solution
is to use Emacs 29+ and use the built in tree-sitter. Note that in Emacs 29 the
naming convention is treesit for symbols (variables and functions).

Here is the commit I made updating my config:
willbush/system@77a99fa

links I found useful:

https://git.savannah.gnu.org/cgit/emacs.git/tree/admin/notes/tree-sitter/starter-guide?h=feature/tree-sitter
https://github.com/renzmann/treesit-auto
https://www.masteringemacs.org/article/how-to-get-started-tree-sitter
https://robbmann.io/posts/emacs-treesit-auto/
https://archive.casouri.cc/note/2023/tree-sitter-in-emacs-29

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

No branches or pull requests

3 participants