help-emacs-windows
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tree-sitter on Windows


From: Juan José García-Ripoll
Subject: Re: tree-sitter on Windows
Date: Sat, 30 Sep 2023 17:01:39 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Bare Emacs, 29.1 as downloaded by Scoop
(treesit-available-p)
=> t
(treesit-language-available-p 'python t)
=> (nil not-found ("libtree-sitter-python" "libtree-sitter-python.dll")
       "No such file or directory")

I try then to activate a language mode such as python-ts-mode Warning
(treesit): Cannot activate tree-sitter, because language grammar for
python is unavailable (not-found): (libtree-sitter-python
libtree-sitter-python.dll) No such file or directory

I then try to install using treesit-install-language-grammar and provide
as C and C++ compiler "/msys64/ucrt64/usr/bin/gcc.exe" It fails with

Warning (treesit): Error encountered when installing language grammar:
(treesit-error Command: /msys64/ucrt64/bin/gcc.exe -fPIC -c -I. parser.c
Error output: )

Next thing is I try Colin's archive of precompiled DLLs. This does not
work, it gives an "Internal Server Error" message when downloading.

Next thing I tried was using treesitter-langs from MELPA. This downloads
DLLs but they have the wrong name: e.g. python.dll. I tried renaming
them in-place, but still does not load them. I moved them to
~/.emacs.d/tree-sitter, and still does not load. In all cases from d),
there is no meaningful error message

(treesit-language-available-p 'python t)
=> (nil not-found ("libtree-sitter-python" "libtree-sitter-python.dll")
       "No such file or directory")

The only solution I have been able to find is to rebuild the libraries
as described in my previous email.

Juanjo

Eli Zaretskii <eliz@gnu.org> writes:
>> From: Juan José García-Ripoll
>>  <juanjose.garciaripoll@gmail.com>
>> Date: Sat, 30 Sep 2023 11:23:44 +0200
>> 
>> I am having a hard time installing tree-sitter DLL's in Windows. I have
>> installed the treesitter language pack (I believe from MELPA IIRC),
>> which downloads plenty of dlls, but they do not have the prefix
>> "libtree-" and then Emacs cannot find them. I tried renaming them at
>> their location in the package, but that also does not work. I tried
>> copying them to the ~/.emacs.d/tree-sitter and also does not work. I
>> tried modifying exec-path, and that also does not work... It is quite
>> disappointing. How am I supposed to do this?
>
> Please tell all the details.  Take one of these DLLs and describe all
> the steps, including:
>
>   . the name of the DLL and the language it supports
>   . in what directory did you install it
>   . how did you try to use it in Emacs
>   . what exactly was the error message displayed by Emacs
>   . what does "M-: (treesit-available-p) RET" report in Emacs
>
> The correct names of the DLLs, under which Emacs will look these
> libraries on Windows are libtree-sitter-LANG.dll, where LANG is the
> language.  For example, if you try using the java-ts-mode.el package
> for the Java language, you need to have the libtree-sitter-java.dll
> where Emacs on MS-Windows looks for DLLs.
>
>

-- 
Juan José García Ripoll
http://juanjose.garciaripoll.com
http://quinfog.hbar.es




reply via email to

[Prev in Thread] Current Thread [Next in Thread]