unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Yuan Fu <casouri@gmail.com>
To: Gernot Kieseritzky <gernotk@gmail.com>, emacs-devel@gnu.org
Subject: Re: Treesit says grammar is unavailable when it
Date: Tue, 12 Dec 2023 19:33:19 -0800	[thread overview]
Message-ID: <1b24fc47-f792-415c-ac59-fcf3a2f5eeb9@gmail.com> (raw)
In-Reply-To: <CAFAbsyv=dM+NgSMfzXQFrg8nojWbkEavxKVpEeFgXDu1FvmZRg@mail.gmail.com>



On 12/4/23 4:43 AM, Gernot Kieseritzky wrote:
> 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

Thanks for sharing this! Eli, this sort of thing might be good reasons 
to also print the error message from ldopen, rather than simply saying 
not found?

Yuan



  reply	other threads:[~2023-12-13  3:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-04 12:43 Treesit says grammar is unavailable when it Gernot Kieseritzky
2023-12-13  3:33 ` Yuan Fu [this message]
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
  -- strict thread matches above, loose matches on Subject: below --
2023-03-10  9:24 mprodrigues
2023-03-10 12:32 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1b24fc47-f792-415c-ac59-fcf3a2f5eeb9@gmail.com \
    --to=casouri@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=gernotk@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).