Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 922146 - app-editors/neovim-9999: tree-sitter parser enhancements (possible change to dev-libs/tree-sitter install location?)
Summary: app-editors/neovim-9999: tree-sitter parser enhancements (possible change to ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Brahmajit Das
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2024-01-15 02:18 UTC by Vadim A. Misbakh-Soloviov (mva)
Modified: 2024-07-05 11:03 UTC (History)
9 users (show)

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


Attachments
fix finding luajit in live (0001-app-editors-neovim-fix-finding-luajit-in-live.patch,1.09 KB, patch)
2024-01-16 06:06 UTC, Brahmajit Das
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vadim A. Misbakh-Soloviov (mva) gentoo-dev 2024-01-15 02:18:54 UTC
Hi!

I've found that Neovim upstream force-enabled treesitter for some filetypes. For example, it was enabled for lua on Jan 1: https://github.com/neovim/neovim/commit/f69658bc3.


Also, there are also `vimdoc` and `query` parsers enabled (and as nvim buildsystem also fetches `c` and `vim` parsers, it is possible they'll enable that parsers too in near time)

But:

1) we don't have `lua`, `vim` and `vimdoc` parsers (grammatics) in gentoo repo (but I already made ebuilds for them localy and will push them in near time)

2) neovim searches for them in another path, and by another names than we install them:
- we install them as `/usr/$libdir/libtree-sitter-$name.so` (like `/usr/lib64/libtree-sitter-json.so`),
- and nvim searches them as `/usr/$libdir/nvim/parser/$name.so` (like `/usr/lib64/nvim/parser/lua.so`)

As `vimdoc`, `lua` and `query` parsers are mandatory now (otherwise even `nvim --clean` throws an error on startup when opening lua file), we'll anyway need to do something, as it will definitely trigger on next release (0.10, I guess) and make nvim unusable for users.

At first, I had thoughts about a following ways to fix that:

- add some code to neovim-9990 ebuild, with creating `/usr/$libdir/nvim/parsers` (as it doesn't exist by default with our installations), and `ln -s` tree-sitter parsers there with correct (for nvim) names (and also make nvim depend on all the parsers that upstream force-enabled)
// although, that looks dirty, imho

- add new package like `nvim-tree-sitter-parsers-rt` and create corresponding symlinks there, and make nvim depend on it instead.
And in that case, should we depend (and make symlinks) on all parsers (grammars) we have packaged, or all installed, or, again, only the ones currently force-enabled on upstream and keep an eye on upcoming force-enablements?
                       

Then @sam suggested to speak to upstream first, and ask if they can add additional search paths.

I'm pretty sceptic about they answer, but I asked them on GH (will add a link in "See Also"), so let's see.

Also @sam suggest to add additional path (probably, with symlinks to original libs), like /usr/$libdir/tree-sitter.
And, as I found later, this is exactly the way alpine does (will also add a link to "See also").

And if we'll go this way, I think we wouldn't need to do anything at upstream, but just symlink `/usr/${libdir}/tree-sitter` to `/usr/${libdir}/nvim/parser` and be happy.

Reproducible: Always
Comment 1 Vadim A. Misbakh-Soloviov (mva) gentoo-dev 2024-01-15 02:23:22 UTC
Well, BZ don't acccept alpine packages liks to See also, so here it is: https://pkgs.alpinelinux.org/contents?branch=edge&name=tree%2dsitter%2dlua&arch=x86_64&repo=community
Comment 2 Brahmajit Das 2024-01-16 06:06:26 UTC
Created attachment 882375 [details, diff]
fix finding luajit in live

@Vadim we have seen this issue before, @Sam had helped me fix this but I'm not sure how this commit got lost/reverted. Can you please try out this patch and see if the live ebuild is buildable.
Comment 3 Brahmajit Das 2024-01-16 06:07:39 UTC
(In reply to listout from comment #2)
> Created attachment 882375 [details, diff] [details, diff]
> fix finding luajit in live
> 
> @Vadim we have seen this issue before, @Sam had helped me fix this but I'm
> not sure how this commit got lost/reverted. Can you please try out this
> patch and see if the live ebuild is buildable.

Please ignore this commit I meant to comment in bug#922138
Comment 4 WGH 2024-05-21 15:46:35 UTC
I think this problem affects neovim-0.10.0 now (unstable, but still), not just the -9999 package.
Comment 5 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(+)
Comment 6 WGH 2024-06-14 02:07:24 UTC
Hey, isn't neovim ebuild supposed to be updated to depend on those new packages?  Because right now it still ends up broken after emerge.
Comment 7 Larry the Git Cow gentoo-dev 2024-07-05 11:03:01 UTC
The bug has been closed via the following commit(s):

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

commit fbe4bc7b9dc970271127a5f167c95da78e32e282
Author:     Vadim Misbakh-Soloviov <mva@gentoo.org>
AuthorDate: 2024-02-21 17:59:50 +0000
Commit:     Arthur Zamarin <arthurzam@gentoo.org>
CommitDate: 2024-07-05 10:55:37 +0000

    tree-sitter-grammar.eclass: extended packaging
    
    1) put grammar library to additional well-known path
    2) also put queries
    
    See-Also: https://pkgs.alpinelinux.org/contents?branch=edge&name=tree%2dsitter%2dlua&arch=x86_64&repo=community
    See-Also: https://pkgs.alpinelinux.org/contents?branch=edge&name=tree%2dsitter%2dcss&arch=x86_64&repo=community
    
    Refer: https://github.com/gentoo/gentoo/pull/35475
    Closes: https://bugs.gentoo.org/933833
    Closes: https://bugs.gentoo.org/922146
    Signed-off-by: Vadim Misbakh-Soloviov <mva@gentoo.org>
    Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/37122
    Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>

 eclass/tree-sitter-grammar.eclass | 13 +++++++++++++
 1 file changed, 13 insertions(+)