Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to install tree-sitter-cli on windows #7020

Open
pedrohgmacedo opened this issue Aug 28, 2024 · 3 comments
Open

Failed to install tree-sitter-cli on windows #7020

pedrohgmacedo opened this issue Aug 28, 2024 · 3 comments

Comments

@pedrohgmacedo
Copy link

debug log:

[DEBUG Wed Aug 28 01:10:42 2024] ...are/nvim-data/lazy/mason.nvim/lua/mason-core/process.lua:162: Spawned with pid 25436
[DEBUG Wed Aug 28 01:10:42 2024] ...are/nvim-data/lazy/mason.nvim/lua/mason-core/process.lua:148: Job pid=32804 exited with exit_code=0, signal=0
[DEBUG Wed Aug 28 01:10:42 2024] ...azy/mason.nvim/lua/mason-core/installer/managers/std.lua:235: std: unpack "tree-sitter-windows-x64.exe.gz"
[DEBUG Wed Aug 28 01:10:42 2024] ...azy/mason.nvim/lua/mason-core/installer/managers/std.lua:165: std: gunzip "tree-sitter-windows-x64.exe.gz"
[DEBUG Wed Aug 28 01:10:42 2024] ...azy/mason.nvim/lua/mason-core/installer/managers/std.lua:53: std: gunzip_unix "tree-sitter-windows-x64.exe.gz"
[DEBUG Wed Aug 28 01:10:42 2024] ...share/nvim-data/lazy/mason.nvim/lua/mason-core/spawn.lua:82: "gzip" is not executable
[DEBUG Wed Aug 28 01:10:42 2024] ...azy/mason.nvim/lua/mason-core/installer/managers/std.lua:17: std: unpack_7z "tree-sitter-windows-x64.exe.gz"
[DEBUG Wed Aug 28 01:10:42 2024] ...are/nvim-data/lazy/mason.nvim/lua/mason-core/process.lua:116: Spawning cmd="7z", spawn_opts={
  args = { "x", "-y", "-r", "tree-sitter-windows-x64.exe.gz" },
  cwd = "C:/Users/pedro/.local/share/nvim-data\\mason\\staging\\tree-sitter-cli\\."
}
[DEBUG Wed Aug 28 01:10:42 2024] ...are/nvim-data/lazy/mason.nvim/lua/mason-core/process.lua:162: Spawned with pid 34412
[DEBUG Wed Aug 28 01:10:42 2024] ...are/nvim-data/lazy/mason.nvim/lua/mason-core/process.lua:148: Job pid=34412 exited with exit_code=0, signal=0
[DEBUG Wed Aug 28 01:10:42 2024] ...al/share/nvim-data/lazy/mason.nvim/lua/mason-core/fs.lua:59: fs: unlink C:/Users/pedro/.local/share/nvim-data\mason\staging\tree-sitter-cli\.\tree-sitter-windows-x64.exe.gz
[DEBUG Wed Aug 28 01:10:42 2024] ...zy/mason.nvim/lua/mason-core/installer/registry/link.lua:139: Registering bin links Package(name=tree-sitter-cli) {
  ["tree-sitter"] = "{{source.asset.bin}}"
}
[DEBUG Wed Aug 28 01:10:42 2024] ...zy/mason.nvim/lua/mason-core/installer/registry/link.lua:166: Expanded bin link "tree-sitter" -> "tree-sitter-windows-x64.exe"
[DEBUG Wed Aug 28 01:10:42 2024] ...al/share/nvim-data/lazy/mason.nvim/lua/mason-core/fs.lua:59: fs: unlink C:/Users/pedro/.local/share/nvim-data\mason\staging\tree-sitter-cli.lock
[DEBUG Wed Aug 28 01:10:42 2024] ...al/share/nvim-data/lazy/mason.nvim/lua/mason-core/fs.lua:47: fs: rmrf C:/Users/pedro/.local/share/nvim-data\mason\staging\tree-sitter-cli
[DEBUG Wed Aug 28 01:10:42 2024] ...m-data/lazy/mason.nvim/lua/mason-core/installer/init.lua:39: Building receipt for Package(name=tree-sitter-cli)
[ERROR Wed Aug 28 01:10:42 2024] ...m-data/lazy/mason.nvim/lua/mason-core/installer/init.lua:249: Installation failed for Package(name=tree-sitter-cli) error='Tried to link bin "tree-sitter" to non-existent target "tree-sitter-windows-x64.exe".'
[DEBUG Wed Aug 28 01:10:43 2024] ...are/nvim-data/lazy/mason.nvim/lua/mason-core/process.lua:148: Job pid=25436 exited with exit_code=0, signal=0

Mason:

  Failed
    ◍ tree-sitter-cli
      ▼ Displaying full log
        Downloading file "https://github.com/tree-sitter/tree-sitter/releases/download/v0.23.0/tree-sitter-windows-x64.gz"…
        Unpacking "tree-sitter-windows-x64.exe.gz"…
        
        7-Zip 24.06 (x64) : Copyright (c) 1999-2024 Igor Pavlov : 2024-05-26
        
        Scanning the drive for archives:
        1 file, 7021317 bytes (6857 KiB)
        
        Extracting archive: tree-sitter-windows-x64.exe.gz
        --
        Path = tree-sitter-windows-x64.exe.gz
        Type = gzip
        Headers Size = 26
        
        Everything is Ok
        
        Size:       19362816
        Compressed: 7021317
        Tried to link bin "tree-sitter" to non-existent target "tree-sitter-windows-x64.exe".
@pedrohgmacedo
Copy link
Author

pedrohgmacedo commented Aug 28, 2024

It seems that the tree-sitter-cli package provides tree-sitter.exe instead of tree-sitter-windows-x64.exe as it is specified in the registry

@pedrohgmacedo
Copy link
Author

pedrohgmacedo commented Aug 28, 2024

Interestingly, gzip -d on git-bash.exe bahaves according to the registry, extracting the tree-sitter-windows-x64.exe.gz file to tree-sitter-windows-x64.exe, where 7z extracts to tree-sitter.exe.

@gorillamoe
Copy link

Interestingly, gzip -d on git-bash.exe bahaves according to the registry, extracting the tree-sitter-windows-x64.exe.gz file to tree-sitter-windows-x64.exe, where 7z extracts to tree-sitter.exe.

Then according to this pipeline of the tree-sitter-cli gzip is wrong, because it clearly states the artifact name as tree-sitter.exe.

https://github.com/tree-sitter/tree-sitter/actions/runs/11263306331/job/31321508631

So no matter the arch, it's always only tree-sitter.exe.

I'm no gzip expert, but the manual states that you have to invoke it with the -N flag, so that the original names are preserved when extracting. Maybe that's the culprit 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@gorillamoe @pedrohgmacedo and others