Hi Laurent,
Thanks for looking at this. Only recently I updated my plugins and everything
broke because of this tree-sitter stuff.
On Sat, Feb 07, 2026 at 11:20:26AM +0100, Laurent Cheylus wrote:
> proposal to import a new port textproc/tree-sitter-cli: CLI tool (written in Rust) allows to develop, test, and use Tree-sitter grammars.
> Homepage: https://github.com/tree-sitter/tree-sitter/tree/master/crates/cli
>
> Tool part not built in textproc/tree-sitter port (build/install only TS lib and include).
Following the instructions at
https://github.com/nvim-treesitter/nvim-treesitter?tab=readme-ov-file#installation
I made this minimal init.lua that is enough to exercise the new port:
```
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
local plugins = {
{
-- Incremental parsing
"nvim-treesitter/nvim-treesitter",
lazy = false,
build = ":TSUpdate",
},
}
require("lazy").setup(plugins, lazy_opts)
require'nvim-treesitter'.install { "c", "cpp", "css", "lua", "markdown", "markdown_inline", "toml", "python", "rust", "vimdoc" }
```
and in a fresh user account, with no pre-existing ~/.local/share/nvim, when
invoking `nvim` I get linker errors when it tries to build the grammars:
```
[nvim-treesitter/install/lua] error: Error during "tree-sitter build": ^[[31mError:^[[0m Failed to compile parser
Caused by:
Parser compilation failed.
Stdout:
Stderr: ld: error: undefined symbol: calloc
>>> referenced by scanner.c
>>> /tmp/scanner-87df48.o:(tree_sitter_lua_external_scanner_create)
ld: error: undefined symbol: free
>>> referenced by scanner.c
>>> /tmp/scanner-87df48.o:(tree_sitter_lua_external_scanner_destroy)
ld: error: undefined symbol: iswspace
>>> referenced by scanner.c
>>> /tmp/scanner-87df48.o:(tree_sitter_lua_external_scanner_scan)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
[nvim-treesitter/install/css] error: Error during "tree-sitter build": ^[[31mError:^[[0m Failed to compile parser
etc...
```
Quite impressive that we've managed to not have libc linked :)
Can you reproduce?
Nothing suggesting any problems in :checkhealth.
Other questions/comments:
- in textproc/tree-sitter/Makefile, there's an XXX saying that the cli tool
should be a new port. Are others in agreement that this is still what we
want, or is it better a SUBPACKAGE? Obviously not every arch has Rust and it
might add bloat to the dependency tree for things that need tree-sitter but
not tree-sitter-cli.
- I notice that the tree-sitter-cli port uses a newer version of the source
code than our in-tree tree-sitter port. Is that going to cause problems? Is
it causing the above linkage problems? If these have to be in-sync, maybe
that's an argument for using a SUBPACKAGE?
- It would be nice to get the tests working, but I think the shell completions
can wait.
Cheers
--
Best Regards
Edd Barrett
https://www.theunixzoo.co.uk
No comments:
Post a Comment