You are not logged in.

#1 2024-01-31 22:25:02

MadCat_X
Member
Registered: 2009-10-08
Posts: 189

tree-sitter version confusion

I noticed this issue when tree-sitter 0.20.9 was released. Some programs (such as the latest Neovim code) now depend on some new functions available only in 0.20.9 now fail to build. Arch Linux version of the tree-sitter package reports version 0.20.10 but such version of tree-sitter does not exist. I guess that the version number comes from the Makefile variable in tree-sitter source code. That value, however, seems to be bogus and it's been like that for almost a year.

Offline

#2 2024-02-01 09:27:36

loqs
Member
Registered: 2014-03-06
Posts: 17,603

Re: tree-sitter version confusion

MadCat_X wrote:

I guess that the version number comes from the Makefile variable in tree-sitter source code.

$ pkgctl repo clone --protocol=https tree-sitter
$ cd tree-sitter/
$ makepkg -Codd
$ src/tree-sitter/
$ git describe --tags --long
v0.20.7-91-gc51896d3
$ grep -rF 0.20.10
$ grep -rF 0.20.9
.git/packed-refs:295a77cc9d131e10e0c7a71abb2803713aaa8020 refs/tags/v0.20.9
lib/Cargo.toml:version = "0.20.9"
Cargo.lock:version = "0.20.9"
Makefile:VERSION := 0.20.9
$ git checkout v0.20.9
$ grep -rF 0.20.9
.git/packed-refs:295a77cc9d131e10e0c7a71abb2803713aaa8020 refs/tags/v0.20.9
cli/npm/package.json:  "version": "0.20.9",
cli/Cargo.toml:version = "0.20.9"
lib/binding_web/package.json:  "version": "0.20.9",
Cargo.lock:version = "0.20.9"
$ grep -rF 0.20.10
cli/Cargo.toml:version = "0.20.10"
lib/binding_rust/README.md:tree-sitter = "0.20.10"
lib/Cargo.toml:version = "0.20.10"
Cargo.lock:version = "0.20.10"
Makefile:VERSION := 0.20.10
MadCat_X wrote:

That value, however, seems to be bogus and it's been like that for almost a year.

The commit that changed that is not part of 0.20.10-2 which uses commit 0e4ff0bb27edf37b76fc7d35aa768b02cf4392ad.

MadCat_X wrote:

Some programs (such as the latest Neovim code) now depend on some new functions available only in 0.20.9 now fail to build

https://github.com/neovim/neovim/issues/27242 ?  I suggest opening a bug against the tree-sitter package asking for the package to be epoch downgraded to 0.20.9.  Although even with that you have:

$ pacman -Q tree-sitter
tree-sitter 0.20.10-2
[stephen@arch /tmp]$ cat /usr/lib/pkgconfig/tree-sitter.pc
prefix=/usr
libdir=${prefix}/lib
includedir=${prefix}/include

Name: tree-sitter
Description: An incremental parsing system for programming tools
URL: https://tree-sitter.github.io/
Version: 0.20.9
Libs: -L${libdir} -ltree-sitter
Cflags: -I${includedir}
$ pacman -Q tree-sitter
tree-sitter 1:0.20.9-1
$ cat /usr/lib/pkgconfig/tree-sitter.pc
prefix=/usr
libdir=${prefix}/lib
includedir=${prefix}/include

Name: tree-sitter
Description: An incremental parsing system for programming tools
URL: https://tree-sitter.github.io/
Version: 0.20.10
Libs: -L${libdir} -ltree-sitter
Cflags: -I${includedir}

Edit:
I can not find a version check in https://github.com/neovim/neovim/blob/m … tter.cmake and if it were to use pkg_check_modules to query the pkg config then the version to check would be 0.20.10 for the 0.20.9 tree-sitter release.

Last edited by loqs (2024-02-01 09:47:36)

Offline

#3 2024-02-01 15:54:59

MadCat_X
Member
Registered: 2009-10-08
Posts: 189

Re: tree-sitter version confusion

Is it me or is the version numbering really confusing here?

Just FTR, if I adjust the tree-sitter package to target commit 98be227227af10cc7a269cb3ffb23686c0610b17, I can successfully build the latest Neovim against it. Any chance we can have a -3 of the tree-sitter package in Arch?

You are right about Neovim not actually checking the version. In any case, tree-sitter-cli seems to be up-to-date in Arch but the tree-sitter library is lagging behind upstream releases.

Offline

#4 2024-02-01 17:38:08

loqs
Member
Registered: 2014-03-06
Posts: 17,603

Re: tree-sitter version confusion

MadCat_X wrote:

Any chance we can have a -3 of the tree-sitter package in Arch?

Open a bug report against the tree-sitter package on Arch's gitlab instance.

MadCat_X wrote:

You are right about Neovim not actually checking the version.

I would ask upstream tree-sitter about https://github.com/tree-sitter/tree-sit … 02cf4392ad and how VERSION in Makefile relates to the git tag versions or version strings used elsewhere in the project.  What are projects like neovim supposed to use to find the library versions compatibility?

Offline

#5 2024-02-01 18:54:19

dogknowsnx
Member
Registered: 2021-04-12
Posts: 648

Re: tree-sitter version confusion


RI - Rest your Eyes and Self

"We are eternal, all this pain is an illusion" - Maynard James Keenan

Offline

Board footer

Powered by FluxBB