msys2/MINGW-packages

libtree-sitter-0.24.4-1 and tree-sitter-0.24.4-1 breaks emacs

Closed this issue · 7 comments

Description / Steps to reproduce the issue

reproduce:

  1. update msys2 to latest, {lib}tree-sitter 0.24.4-1 and emacs 29.4-2 included
  2. open emacs
  3. emacs says
The following tree-sitter grammars are/were missing:
c
cpp
...

Install missing grammars? (y or n)

I can confirm the grammars are installed under %appdata%\.emacs.d\tree-sitter. Re-installation doesn't help.
7. Uninstall libtree-sitter, downgrade tree-sitter to 0.24.3-2 and emacs to 29.4-1, and emacs works again.

Appendix:

I believe emacs was rebuilt, but something still went wrong.
130eacb

Appendix:

I run strace, and no tree-sitter relevant dll is loaded.

Expected behavior

Emacs Works.

Actual behavior

Emacs prompt

The following tree-sitter grammars are/were missing:
...

and syntax highlighting doesn't work.

Verification

Windows Version

MINGW64_NT-10.0-26100

MINGW environments affected

  • MINGW64
  • MINGW32
  • UCRT64
  • CLANG64
  • CLANGARM64

Are you willing to submit a PR?

I'll try if you find out the problem.

I can reproduce the issue also on Emacs 31.0.50.
It seems to be related to the dll file name of tree-sitter, on 0.24.4, it becomes "libtree-sitter-0.24.dll".
But the valid dll file name used by Emacs is: '(tree-sitter "libtree-sitter.dll" "libtree-sitter-0.dll"), so that Emacs will fail to load the dll by "w32_delayed_load (Qtree_sitter)".

The workaround is to create a symbolic link file for the dll file "libtree-sitter.dll" or rename the original file.

that's emacs issue that it doesn't expect names with soversion that is created by cmake... but anyway I can add cp workaround to libtree-sitter if needed

rename the original file.

I don't recommend to do that because it can break emacs installation after another update and rebuild

But the valid dll file name used by Emacs is: '(tree-sitter "libtree-sitter.dll" "libtree-sitter-0.dll"), so that Emacs will fail to load the dll by "w32_delayed_load (Qtree_sitter)".

can you share a emacs code that defines these names, please?

I found it: https://github.com/emacs-mirror/emacs/blob/a7400cb8810373b6d39347a5e0e1ac7152d3abd1/lisp/term/w32-win.el#L315. please, who can contact Emacs maintainers, let them know that API version is provided 🙏

I've opened #22513 which will fix this issue. can you download artifact from github actions after build is finished, please?

Emacs from artifact no longer breaks.

I'm not sure if the fix is temporary or permanent, so I'll let you decide when to close the issue.