emacs-tree-sitter / elisp-tree-sitter

Emacs Lisp bindings for tree-sitter
https://emacs-tree-sitter.github.io
MIT License
815 stars 73 forks source link

Invalid version syntax: ‘emacs-tree-sitter@0.18.0 #250

Open mmuggli opened 1 year ago

mmuggli commented 1 year ago

I'm on CentOS 7.9.2009 and the prebuilt binaries result in a libc compatibility error, so I did:

(setq tsc-dyn-get-from `(:compilation))

Then installed from melpa using package-list-packages. I was then able to use tree-sitter-hl-mode in this session. On quitting and restarting emacs, I got a debug stack trace when running (global-tree-sitter-mode) in my init file. It produced the message "Invalid version syntax: ‘emacs-tree-sitter@0.18.0"

Somewhere in the call stack, I found this: (version< "0.18.0" "emacs-tree-sitter@0.18.0")

I was able to work around this as follows: I found "emacs-tree-sitter@0.18.0 in ~/.emacs.d/elpa/tsc-20220212.1632/DYN-VERSION I changed it to "0.18.0", then rebuilt

~/.emacs.d/elpa/tsc-20220212.1632$ cargo build ~/.emacs.d/elpa/tsc-20220212.1632$ cargo build --release

(I'm guessing tsc only uses the release mode, but these are the actual steps I took that worked, so for completeness, I included the debug build step that I did as well).

It appears there is a format mismatch between DYN-VERSION and tsc.el:27: (defconst tsc--dyn-version "0.18.0"

sogaiu commented 1 year ago

May be this is related?

meedstrom commented 2 months ago

If you're still getting the error, it may be on account of Doom Emacs pinning the release version.

Made a PR there https://github.com/doomemacs/doomemacs/pull/7842

(Pinning is supposed to prevent this kind of problem, but I suppose it can't pin Cargo, which is why Guix/Nix makes more sense than Straight.el for packages that rely on external utilities.)