Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 935631

Summary: tree-sitter.eclass: installed queries collides with other packages
Product: Gentoo Linux Reporter: Agostino Sarubbo <ago>
Component: EclassesAssignee: Matthew Smith <matthew>
Status: CONFIRMED ---    
Severity: normal CC: arthurzam, brahmajit.xyz, matthew, mva, sam, vim
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log

Description Agostino Sarubbo gentoo-dev 2024-07-06 06:45:38 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: dev-libs/tree-sitter-typescript-0.20.6 collides with other packages.
Discovered on: amd64 (internal ref: tinderbox_musl)
System: MUSL-SYSTEM (https://wiki.gentoo.org/wiki/Project:Tinderbox/Common_Issues_Helper#MUSL)

Info about the issue:
https://wiki.gentoo.org/wiki/Project:Tinderbox/Common_Issues_Helper#QA0021
Comment 1 Agostino Sarubbo gentoo-dev 2024-07-06 06:45:39 UTC
Created attachment 897133 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2024-07-06 06:45:40 UTC
Error(s) that match a know pattern:


 * Detected file collision(s):
Comment 3 Matthew Smith gentoo-dev 2024-07-07 06:34:49 UTC
Queries are being installed straight into /usr/share/tree-sitter/queries with no per-language prefix or subdirectory.

Where does NeoVim look?
Comment 4 Matthew Smith gentoo-dev 2024-07-07 06:36:06 UTC
*** Bug 935633 has been marked as a duplicate of this bug. ***
Comment 5 Matthew Smith gentoo-dev 2024-07-07 06:36:27 UTC
*** Bug 935632 has been marked as a duplicate of this bug. ***
Comment 6 Larry the Git Cow gentoo-dev 2024-07-07 06:45:13 UTC
The bug has been referenced in the following commit(s):

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

commit cd426afc7f32ac84206f4156fc8ed0d20bd79246
Author:     Matthew Smith <matthew@gentoo.org>
AuthorDate: 2024-07-07 06:42:17 +0000
Commit:     Matthew Smith <matthew@gentoo.org>
CommitDate: 2024-07-07 06:45:07 +0000

    Revert "tree-sitter-grammar.eclass: extended packaging"
    
    This reverts commit fbe4bc7b9dc970271127a5f167c95da78e32e282.
    
    The previous change does not install the NeoVim symlinks correctly as they
    point to /usr/lib/tree-sitter/liblang.so instead of /usr/lib/liblang.so.
    
    Also the query files are not installed in per-package directories and have
    common names (e.g. highlight.scm) which is causing file collisions.
    
    To be fixed in a follow up commit which will introduce
    tree-sitter-grammar-r1.eclass, so that ebuilds can be rev-bumped so that
    users can rebuild and get the changes.
    
    Bug: https://bugs.gentoo.org/935631
    Bug: https://bugs.gentoo.org/935641
    Signed-off-by: Matthew Smith <matthew@gentoo.org>

 eclass/tree-sitter-grammar.eclass | 13 -------------
 1 file changed, 13 deletions(-)
Comment 7 Matthew Smith gentoo-dev 2024-07-07 08:04:00 UTC
> Where does NeoVim look?

Their documentation[0] says it's runtimepath/lang/queries/highlights.scm, so I think that means we just need to make a new directory.

It also looks like NeoVim installs some query files itself (I can see one for C and Vimscript) and our installed files will take precedence over these. Is this what we want, or do we need to have an eclass variable to prevent the query files from being installed in some cases?

[0]: https://github.com/neovim/neovim/blob/6a886a2511bbfd24a4d6ecc3f3a75f08a6df9de9/runtime/doc/treesitter.txt#L216-L222