unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Treesit says grammar is unavailable when it
@ 2023-03-10  9:24 mprodrigues
  2023-03-10 12:32 ` Eli Zaretskii
  0 siblings, 1 reply; 12+ messages in thread
From: mprodrigues @ 2023-03-10  9:24 UTC (permalink / raw)
  To: Emacs devel

Hello,

I've been trying to test the new tree-sitter modes, but I'm having some
difficulties and would like to debug this. I have tried 
dockerfile-ts-mode,
python-ts-mode and yaml-ts-mode, of these only dockerfile worked, for
the other two I get:

Warning (treesit): Cannot activate tree-sitter, because language grammar
for python is unavailable (not-found): (libtree-sitter-python 
libtree-sitter-python.so)
No such file or directory

but I have yaml and python's grammar under ~/.emacs.d/tree-sitter
I tried compiling the grammars myself and use emacs's own
treesit-install-language-grammar to no avail. How can I debug this?

My emacs version is 30.0.50

Best regards,
Mateus Rodrigues



^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: Treesit says grammar is unavailable when it
@ 2023-12-04 12:43 Gernot Kieseritzky
  2023-12-13  3:33 ` Yuan Fu
  0 siblings, 1 reply; 12+ messages in thread
From: Gernot Kieseritzky @ 2023-12-04 12:43 UTC (permalink / raw)
  To: emacs-devel

Hello!

> Warning (treesit): Cannot activate tree-sitter, because language grammar
> for python is unavailable (not-found): (libtree-sitter-python libtree-sitter-python.so)
> No such file or directory

I had the same error when using "libtree-sitter-yaml.so" and, finally,
had some time for a deeper investigation. I tried the Emacs built-in
debugger (M-x debug-on-entry treesit_load_language) but I found the
error only occurs inside the C function "treesit-available-p". Since
this error occurred directly when Emacs loads the shared library
resting inside of my ".emacs.d/tree-sitter/" directory I resorted to
debugging the dynamic linker by starting Emacs with

$ LD_DEBUG=1; emacs 2> linker.log

and then just proceeded to activate "yaml-ts-mode". Then I hit this:

listdc++.so.6: error: version lookup error: version 'GLIBCXX_3.4.29'
not found (required by ~/.emacs.d/tree-sitter/libtree-sitter-yaml.so)

Turns out the yaml module is using C++ for its scanner component (see
https://github.com/ikatyang/tree-sitter-yaml) unlike all the other
plugins I am using (C, C++, JS and TS). But I compiled this module on
my own -- on the same machine -- so how can my system's C++ standard
library suddenly turn incompatible??

Well, it turns out I am using Alex Murray's Emacs snap package on my
Ubuntu 22.04 system being based on the "core20" snap base package
(i.e. it is based on Ubuntu 20). So this Emacs snap provides an older
set of build essentials including an incompatible C++ standard
library. So as a workaround I would need to cross-compile this module
using an Ubuntu 20 compatible environment. But the best solution is
probably to ask Alex Murray to add all available tree sitter parsers
in his snap.

Best regards,
Gernot Kieseritzky



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-12-27  6:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-10  9:24 Treesit says grammar is unavailable when it mprodrigues
2023-03-10 12:32 ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2023-12-04 12:43 Gernot Kieseritzky
2023-12-13  3:33 ` Yuan Fu
2023-12-13 12:00   ` Eli Zaretskii
2023-12-14  8:14     ` Yuan Fu
2023-12-14  8:27       ` Eli Zaretskii
2023-12-15  2:43         ` Madhu
2023-12-15  9:00           ` Eli Zaretskii
2023-12-17  6:31         ` Yuan Fu
2023-12-17  8:32           ` Eli Zaretskii
2023-12-27  6:41             ` Yuan Fu

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).