Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 933833 - >=app-editors/neovim-0.10.0: treesitter parsers not installed (throws errors when opening lua file, using :help)
Summary: >=app-editors/neovim-0.10.0: treesitter parsers not installed (throws errors ...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Brahmajit Das
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2024-06-08 16:32 UTC by Nikhil Patil
Modified: 2024-06-26 21:05 UTC (History)
8 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nikhil Patil 2024-06-08 16:32:46 UTC
It seems upstream neovim 0.10+ is building and installing treesitter parsers for lua and vimdoc (among others), as a part of neovim.

However the gentoo ebuild does not build or install these parsers. I think this is because the build step for these parsers is separate from that of neovim, requiring separate cmake & ninja steps in the .deps directory.

(BTW the neovim source directory includes a top-level Makefile that calls cmake and ninja appropriately for both the .deps and the main neovim build, so following upstream's build instructions works just fine.)

Because treesitter parsers are not installed, the lua filetype plugin attempts to load them, even with an empty RC file

$ nvim -u NORC a.lua

Error detected while processing BufNewFile Autocommands for "*":
Error executing lua callback: /usr/share/nvim/runtime/filetype.lua:35: Error executing lua: /usr/share/nvim/runtime/filetype.lua:36: BufNewFile Autocommands for "*"..FileType Autocommands for "*"..functio
n <SNR>1_LoadFTPlugin[20]..script /usr/share/nvim/runtime/ftplugin/lua.lua: Vim(runtime):E5113: Error while calling lua chunk: /usr/share/nvim/runtime/lua/vim/treesitter/language.lua:107: no parser for 'l
ua' language, see :help treesitter-parsers


Similarly :help throws errors attempting to load vimdoc treesitter parsers:
$ nvim -u NORC
:help

Error detected while processing BufReadPost Autocommands for "*":
Error executing lua callback: /usr/share/nvim/runtime/filetype.lua:35: Error executing lua: /usr/shar
e/nvim/runtime/filetype.lua:36: BufReadPost Autocommands for "*"..FileType Autocommands for "*"..func
tion <SNR>1_LoadFTPlugin[20]..script /usr/share/nvim/runtime/ftplugin/help.lua: Vim(runtime):E5113: E
rror while calling lua chunk: /usr/share/nvim/runtime/lua/vim/treesitter/language.lua:107: no parser 
for 'vimdoc' language, see :help treesitter-parsers
Comment 1 Brahmajit Das 2024-06-09 20:51:19 UTC
Okay, I've digged into this a bit. There are these CMake flags[0] that installs the tree sitter grammar, USE_BUNDLED_TS_PARSERS to be specific. So basically in upstream they have USE_BUNDLED set to ON and hence neovim installs the required .so files while doing "make install". To reproduce this bug with upstream you can just do
> make CMAKE_BUILD_TYPE=RelWithDebInfo USE_BUNDLED=OFF
which will not install the treesitter grammars.

We already have a PR[1] adding the required grammar's to ::gentoo but it's taking some work. I checked how other distributions install neovim, and most of them have separate grammars and -DUSE_BUNDLED=OFF. So we have to wait for the PR[1] being merged.

I've added Vadim (author of the PR) in the CC list for better visibility.

[0]: https://github.com/neovim/neovim/blob/b6c1ce8a9545575f8b1ea75e29a4ee9f018e3276/contrib/local.mk.example#L44
[1]: https://github.com/gentoo/gentoo/pull/35461
Comment 2 Brahmajit Das 2024-06-09 20:54:03 UTC
Or we can do it like Void linux
> cmake -S cmake.deps -B .deps -G Ninja -DUSE_BUNDLED=OFF -DUSE_BUNDLED_TS_PARSERS=ON
That will install the required grammars that are needed by default.
Comment 3 Brahmajit Das 2024-06-09 20:58:00 UTC
I tried playing around with -DUSE_BUNDLED=ON and -DUSE_BUNDLED_TS_PARSERS=ON by adding them to the mycmakeargs of the 0.10.0 ebuild, but got " One or more CMake variables were not used by the project", maybe I'm doing something wrong
Comment 4 Larry the Git Cow gentoo-dev 2024-06-11 16:53:37 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=55731833cf4323b969e5d43af3bf67d2724d5241

commit 55731833cf4323b969e5d43af3bf67d2724d5241
Author:     Brahmajit Das <brahmajit.xyz@gmail.com>
AuthorDate: 2024-06-10 08:07:11 +0000
Commit:     Matthew Smith <matthew@gentoo.org>
CommitDate: 2024-06-11 16:53:19 +0000

    dev-libs/tree-sitter-query: new package, add 0.4.0
    
    Closes: https://bugs.gentoo.org/933833
    Closes: https://bugs.gentoo.org/922146
    Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
    Signed-off-by: Matthew Smith <matthew@gentoo.org>

 dev-libs/tree-sitter-query/Manifest                |  1 +
 dev-libs/tree-sitter-query/metadata.xml            | 23 ++++++++++++++++++++++
 .../tree-sitter-query-0.4.0.ebuild                 | 16 +++++++++++++++
 3 files changed, 40 insertions(+)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9ab7692f8fc59be6260d493296763a437d3d0e3d

commit 9ab7692f8fc59be6260d493296763a437d3d0e3d
Author:     Brahmajit Das <brahmajit.xyz@gmail.com>
AuthorDate: 2024-06-10 08:05:20 +0000
Commit:     Matthew Smith <matthew@gentoo.org>
CommitDate: 2024-06-11 16:53:18 +0000

    dev-libs/tree-sitter-vimdoc: new package, add 3.0.0
    
    Closes: https://bugs.gentoo.org/933833
    Closes: https://bugs.gentoo.org/922146
    Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
    Signed-off-by: Matthew Smith <matthew@gentoo.org>

 dev-libs/tree-sitter-vimdoc/Manifest               |  1 +
 dev-libs/tree-sitter-vimdoc/metadata.xml           | 23 ++++++++++++++++++++++
 .../tree-sitter-vimdoc-3.0.0.ebuild                | 16 +++++++++++++++
 3 files changed, 40 insertions(+)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75c4d054a9042e4befc8fda41142045a0527b57c

commit 75c4d054a9042e4befc8fda41142045a0527b57c
Author:     Brahmajit Das <brahmajit.xyz@gmail.com>
AuthorDate: 2024-06-10 08:02:01 +0000
Commit:     Matthew Smith <matthew@gentoo.org>
CommitDate: 2024-06-11 16:53:18 +0000

    dev-libs/tree-sitter-vim: new package, add 0.4.0
    
    Closes: https://bugs.gentoo.org/933833
    Closes: https://bugs.gentoo.org/922146
    Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
    Signed-off-by: Matthew Smith <matthew@gentoo.org>

 dev-libs/tree-sitter-vim/Manifest                  |  1 +
 dev-libs/tree-sitter-vim/metadata.xml              | 23 ++++++++++++++++++++++
 .../tree-sitter-vim/tree-sitter-vim-0.4.0.ebuild   | 16 +++++++++++++++
 3 files changed, 40 insertions(+)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7bb981c09c2752290d66fc0fd898abcfb1e674a8

commit 7bb981c09c2752290d66fc0fd898abcfb1e674a8
Author:     Brahmajit Das <brahmajit.xyz@gmail.com>
AuthorDate: 2024-06-10 11:32:32 +0000
Commit:     Matthew Smith <matthew@gentoo.org>
CommitDate: 2024-06-11 16:53:18 +0000

    dev-libs/tree-sitter-markdown-inline: new package, add 0.2.3
    
    Closes: https://bugs.gentoo.org/933833
    Closes: https://bugs.gentoo.org/922146
    Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
    Signed-off-by: Matthew Smith <matthew@gentoo.org>

 dev-libs/tree-sitter-markdown-inline/Manifest      |  1 +
 dev-libs/tree-sitter-markdown-inline/metadata.xml  | 23 ++++++++++++++++++++
 .../tree-sitter-markdown-inline-0.2.3.ebuild       | 25 ++++++++++++++++++++++
 3 files changed, 49 insertions(+)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ed5b89e81ababa6e32112c55187c6244014cdebf

commit ed5b89e81ababa6e32112c55187c6244014cdebf
Author:     Brahmajit Das <brahmajit.xyz@gmail.com>
AuthorDate: 2024-06-10 07:57:23 +0000
Commit:     Matthew Smith <matthew@gentoo.org>
CommitDate: 2024-06-11 16:53:18 +0000

    dev-libs/tree-sitter-markdown: new package, add 0.2.3
    
    Closes: https://bugs.gentoo.org/933833
    Closes: https://bugs.gentoo.org/922146
    Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
    Signed-off-by: Matthew Smith <matthew@gentoo.org>

 dev-libs/tree-sitter-markdown/Manifest             |  1 +
 dev-libs/tree-sitter-markdown/metadata.xml         | 23 ++++++++++++++++++++++
 .../tree-sitter-markdown-0.2.3.ebuild              | 17 ++++++++++++++++
 3 files changed, 41 insertions(+)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b083d6b4b3427940f408b03ed37fd76909e1fce3

commit b083d6b4b3427940f408b03ed37fd76909e1fce3
Author:     Brahmajit Das <brahmajit.xyz@gmail.com>
AuthorDate: 2024-06-09 22:00:04 +0000
Commit:     Matthew Smith <matthew@gentoo.org>
CommitDate: 2024-06-11 16:52:09 +0000

    dev-libs/tree-sitter-lua: new package, add 0.1.0
    
    Closes: https://bugs.gentoo.org/933833
    Closes: https://bugs.gentoo.org/922146
    Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
    Signed-off-by: Matthew Smith <matthew@gentoo.org>

 dev-libs/tree-sitter-lua/Manifest                  |  1 +
 dev-libs/tree-sitter-lua/metadata.xml              | 23 ++++++++++++++++++++++
 .../tree-sitter-lua/tree-sitter-lua-0.1.0.ebuild   | 16 +++++++++++++++
 3 files changed, 40 insertions(+)