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

Treesitter build failures on Windows #2

Closed
simsrw73 opened this issue Jan 1, 2023 · 8 comments · Fixed by #70
Closed

Treesitter build failures on Windows #2

simsrw73 opened this issue Jan 1, 2023 · 8 comments · Fixed by #70

Comments

@simsrw73
Copy link

simsrw73 commented Jan 1, 2023

I'm new to Vim/NeoVim and wish I knew better how to debug this. I've been trying configs (ThePrimeagen/init.lua, LunarVim/nvim-basic-ide, nvim-lua/kickstart.nvim) and rewriting a few dozen trying to learn before evolving in this direction. I didn't have any trouble getting the others up with TreeSitter & LSP functional but this one fails on Windows. Likely pathing issue? Target and Source seem to exist but getting access errors.

NVIM v0.8.2
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compiled by runneradmin@fv-az28-353

Features: -acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM\sysinit.vim"
  fall-back for $VIM: "C:/Program Files (x86)/nvim/share/nvim"
[nvim-treesitter] [0/15] Downloading tree-sitter-bash...
[nvim-treesitter] [0/15] Downloading tree-sitter-help...
[nvim-treesitter] [0/15] Downloading tree-sitter-html...
[nvim-treesitter] [0/15] Downloading tree-sitter-javascript...
[nvim-treesitter] [0/15] Downloading tree-sitter-json...
[nvim-treesitter] [0/15] Downloading tree-sitter-lua...
[nvim-treesitter] [0/15] Downloading tree-sitter-markdown...
[nvim-treesitter] [0/15] Downloading tree-sitter-markdown_inline...
[nvim-treesitter] [0/15] Downloading tree-sitter-python...
[nvim-treesitter] [0/15] Downloading tree-sitter-query...
[nvim-treesitter] [0/15] Downloading tree-sitter-regex...
[nvim-treesitter] [0/15] Downloading tree-sitter-tsx...
[nvim-treesitter] [0/15] Downloading tree-sitter-typescript...
[nvim-treesitter] [0/15] Downloading tree-sitter-vim...
[nvim-treesitter] [0/15] Downloading tree-sitter-yaml...
[nvim-treesitter] [0/15] Checking out locked revision
[nvim-treesitter] [0/15] Checking out locked revision
[nvim-treesitter] [0/15] Checking out locked revision
[nvim-treesitter] [0/15] Checking out locked revision
[nvim-treesitter] [0/15] Checking out locked revision
[nvim-treesitter] [0/15] Checking out locked revision
[nvim-treesitter] [0/15] Checking out locked revision
[nvim-treesitter] [0/15] Compiling...
[nvim-treesitter] [0/15] Compiling...
[nvim-treesitter] [0/15] Compiling...
[nvim-treesitter] [0/15] Compiling...
[nvim-treesitter] [0/15] Compiling...
[nvim-treesitter] [0/15] Compiling...
[nvim-treesitter] [0/15] Compiling...
[nvim-treesitter] [0/15] Checking out locked revision
[nvim-treesitter] [0/15] Compiling...
[nvim-treesitter] [1/15] Treesitter parser for json has been installed
[nvim-treesitter] [2/15] Treesitter parser for query has been installed
[nvim-treesitter] [3/15] Treesitter parser for regex has been installed
[nvim-treesitter] [4/15] Treesitter parser for help has been installed
        0 file(s) moved.
nvim-treesitter[lua]: Failed to execute the following command:
{
  cmd = "cmd",
  opts = {
    args = { "/C", "move", "/Y", "parser.so", "C:/Users/simsrw73/.local/share/nvim-data/lazy/nvim-treesitter\\parser\\lua.so" },
    cwd = "C:\\Users\\simsrw73\\.local\\share\\nvim-data\\tree-sitter-lua",
    stdio = {
      [2] = <userdata 1>,
      [3] = <userdata 2>
    }
  }
}
Access is denied.
[nvim-treesitter] [6/15, failed: 1] Treesitter parser for yaml has been installed
[nvim-treesitter] [7/15, failed: 1] Treesitter parser for html has been installed
[nvim-treesitter] [8/15, failed: 1] Treesitter parser for bash has been installed
[nvim-treesitter] [8/15, failed: 1] Checking out locked revision
[nvim-treesitter] [8/15, failed: 1] Compiling...
[nvim-treesitter] [8/15, failed: 1] Checking out locked revision
[nvim-treesitter] [8/15, failed: 1] Compiling...
[nvim-treesitter] [8/15, failed: 1] Checking out locked revision
[nvim-treesitter] [8/15, failed: 1] Compiling...
        0 file(s) moved.
nvim-treesitter[markdown_inline]: Failed to execute the following command:
{
  cmd = "cmd",
  opts = {
    args = { "/C", "move", "/Y", "parser.so", "C:/Users/simsrw73/.local/share/nvim-data/lazy/nvim-treesitter\\parser\\markdown_inline.so" },
    cwd = "C:\\Users\\simsrw73\\.local\\share\\nvim-data\\tree-sitter-markdown_inline\\tree-sitter-markdown-inline",
    stdio = {
      [2] = <userdata 1>,
      [3] = <userdata 2>
    }
  }
}
Access is denied.
[nvim-treesitter] [10/15, failed: 2] Treesitter parser for python has been installed
        0 file(s) moved.
nvim-treesitter[markdown]: Failed to execute the following command:
{
  cmd = "cmd",
  opts = {
    args = { "/C", "move", "/Y", "parser.so", "C:/Users/simsrw73/.local/share/nvim-data/lazy/nvim-treesitter\\parser\\markdown.so" },
    cwd = "C:\\Users\\simsrw73\\.local\\share\\nvim-data\\tree-sitter-markdown\\tree-sitter-markdown",
    stdio = {
      [2] = <userdata 1>,
      [3] = <userdata 2>
    }
  }
}
Access is denied.
[nvim-treesitter] [11/15, failed: 3] Checking out locked revision
[nvim-treesitter] [11/15, failed: 3] Checking out locked revision
[nvim-treesitter] [11/15, failed: 3] Compiling...
[nvim-treesitter] [11/15, failed: 3] Compiling...
[nvim-treesitter] [12/15, failed: 3] Treesitter parser for javascript has been installed
[nvim-treesitter] [13/15, failed: 3] Treesitter parser for vim has been installed
[nvim-treesitter] [13/15, failed: 3] Checking out locked revision
[nvim-treesitter] [13/15, failed: 3] Compiling...
[nvim-treesitter] [14/15, failed: 3] Treesitter parser for tsx has been installed
[nvim-treesitter] [14/15, failed: 3] Checking out locked revision
[nvim-treesitter] [14/15, failed: 3] Compiling...
[nvim-treesitter] [15/15, failed: 3] Treesitter parser for typescript has been installed
@folke
Copy link
Collaborator

folke commented Jan 1, 2023

Hi! fyi: I've only started working on this config yesterday, so defintely not ready for real usage.

I didnt have the time yet to test everything on Windows, and there's a bunch of things I still need to do.

Closing this for now. I'll announce it on Reddit once this is ready.

@folke folke closed this as completed Jan 1, 2023
@domsch1988
Copy link

Can this be reopened? Found this through Reddit and am running into similar issues.
There are two things going wrong. What OP mentioned seems to be some permission issues, which i'm also getting:

[nvim-treesitter] [0/15] Downloading tree-sitter-bash...
[nvim-treesitter] [0/15] Downloading tree-sitter-help...
[nvim-treesitter] [0/15] Downloading tree-sitter-html...
[nvim-treesitter] [0/15] Downloading tree-sitter-javascript...
[nvim-treesitter] [0/15] Downloading tree-sitter-json...
[nvim-treesitter] [0/15] Downloading tree-sitter-markdown_inline...
[nvim-treesitter] [0/15] Downloading tree-sitter-lua...
[nvim-treesitter] [0/15] Downloading tree-sitter-markdown...
[nvim-treesitter] [0/15] Downloading tree-sitter-python...
[nvim-treesitter] [0/15] Downloading tree-sitter-query...
[nvim-treesitter] [0/15] Downloading tree-sitter-tsx...
[nvim-treesitter] [0/15] Downloading tree-sitter-regex...
[nvim-treesitter] [0/15] Downloading tree-sitter-vim...
[nvim-treesitter] [0/15] Downloading tree-sitter-typescript...
[nvim-treesitter] [0/15] Downloading tree-sitter-yaml...
[nvim-treesitter] [0/15] Checking out locked revision
[nvim-treesitter] [0/15] Checking out locked revision
[nvim-treesitter] [0/15] Checking out locked revision
[nvim-treesitter] [0/15] Checking out locked revision
[nvim-treesitter] [0/15] Checking out locked revision
[nvim-treesitter] [0/15] Compiling...
[nvim-treesitter] [0/15] Checking out locked revision
[nvim-treesitter] [0/15] Compiling...
[nvim-treesitter] [0/15] Compiling...
[nvim-treesitter] [0/15] Compiling...
[nvim-treesitter] [0/15] Checking out locked revision
[nvim-treesitter] [0/15] Compiling...
[nvim-treesitter] [0/15] Compiling...
[nvim-treesitter] [0/15] Checking out locked revision
[nvim-treesitter] [0/15] Compiling...
[nvim-treesitter] [0/15] Compiling...
[nvim-treesitter] [1/15] Treesitter parser for json has been installed
[nvim-treesitter] [1/15] Checking out locked revision
[nvim-treesitter] [2/15] Treesitter parser for regex has been installed
[nvim-treesitter] [3/15] Treesitter parser for query has been installed
[nvim-treesitter] [4/15] Treesitter parser for help has been installed
[nvim-treesitter] [5/15] Treesitter parser for lua has been installed
[nvim-treesitter] [5/15] Compiling...
[nvim-treesitter] [5/15] Checking out locked revision
[nvim-treesitter] [5/15] Compiling...
[nvim-treesitter] [6/15] Treesitter parser for html has been installed
[nvim-treesitter] [6/15] Checking out locked revision
[nvim-treesitter] [6/15] Compiling...
[nvim-treesitter] [6/15] Checking out locked revision
[nvim-treesitter] [6/15] Compiling...
[nvim-treesitter] [6/15] Checking out locked revision
[nvim-treesitter] [6/15] Compiling...
[nvim-treesitter] [7/15] Treesitter parser for yaml has been installed
[nvim-treesitter] [8/15] Treesitter parser for bash has been installed
        0 Datei(en) verschoben.
nvim-treesitter[markdown_inline]: Failed to execute the following command:
{
  cmd = "cmd",
  opts = {
    args = { "/C", "move", "/Y", "parser.so", "C:/Users/dosaadmin/AppData/Local/nvim-data/lazy/nvim-treesitter\\parser\\markdown_inline.so" },
    cwd = "C:\\Users\\dosaadmin\\AppData\\Local\\nvim-data\\tree-sitter-markdown_inline\\tree-sitter-markdown-inline",
    stdio = {
      [2] = <userdata 1>,
      [3] = <userdata 2>
    }
  }
}
Zugriff verweigert
        0 Datei(en) verschoben.
nvim-treesitter[markdown]: Failed to execute the following command:
{
  cmd = "cmd",
  opts = {
    args = { "/C", "move", "/Y", "parser.so", "C:/Users/dosaadmin/AppData/Local/nvim-data/lazy/nvim-treesitter\\parser\\markdown.so" },
    cwd = "C:\\Users\\dosaadmin\\AppData\\Local\\nvim-data\\tree-sitter-markdown\\tree-sitter-markdown",
    stdio = {
      [2] = <userdata 1>,
      [3] = <userdata 2>
    }
  }
}
Zugriff verweigert
[nvim-treesitter] [11/15, failed: 2] Treesitter parser for javascript has been installed
[nvim-treesitter] [12/15, failed: 2] Treesitter parser for vim has been installed
[nvim-treesitter] [13/15, failed: 2] Treesitter parser for python has been installed
[nvim-treesitter] [13/15, failed: 2] Checking out locked revision
[nvim-treesitter] [13/15, failed: 2] Checking out locked revision
[nvim-treesitter] [13/15, failed: 2] Compiling...
[nvim-treesitter] [13/15, failed: 2] Compiling...
        0 Datei(en) verschoben.
nvim-treesitter[typescript]: Failed to execute the following command:
{
  cmd = "cmd",
  opts = {
    args = { "/C", "move", "/Y", "parser.so", "C:/Users/dosaadmin/AppData/Local/nvim-data/lazy/nvim-treesitter\\parser\\typescript.so" },
    cwd = "C:\\Users\\dosaadmin\\AppData\\Local\\nvim-data\\tree-sitter-typescript\\typescript",
    stdio = {
      [2] = <userdata 1>,
      [3] = <userdata 2>
    }
  }
}
Zugriff verweigert
        0 Datei(en) verschoben.
nvim-treesitter[tsx]: Failed to execute the following command:
{
  cmd = "cmd",
  opts = {
    args = { "/C", "move", "/Y", "parser.so", "C:/Users/dosaadmin/AppData/Local/nvim-data/lazy/nvim-treesitter\\parser\\tsx.so" },
    cwd = "C:\\Users\\dosaadmin\\AppData\\Local\\nvim-data\\tree-sitter-tsx\\tsx",
    stdio = {
      [2] = <userdata 1>,
      [3] = <userdata 2>
    }
  }
}
Zugriff verweigert
84 lines yanked into "+

A second thing is treesitter Parsers not getting compiled correctly. I have a feeling this is related to the Troubleshooting portion here: https://github.com/nvim-treesitter/nvim-treesitter/wiki/Windows-support
If i understand this correctly, nvim-qt on windows has it's own libc++ which is a different Version from the libc++ used by gcc. The workaround there is to install LLVM and tell treesitter to use clang instead of gcc. But so far, i have not been able to get this to work.

:checkhealth nvim-treesitter reports:

nvim-treesitter: require("nvim-treesitter.health").check()
========================================================================
## Installation
  - OK: `tree-sitter` found (unknown version) (parser generator, only needed for :TSInstallFromGrammar)
  - OK: `node` found v19.3.0 (only needed for :TSInstallFromGrammar)
  - OK: `git` executable found.
  - OK: `clang` executable found. Selected from { "clang" }
    Version: clang version 15.0.5
  - OK: Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.

## OS Info:
{
  machine = "x86_64",
  release = "10.0.22621",
  sysname = "Windows_NT",
  version = "Windows 10 Pro"
}

## Parser/Features H L F I J
  - bash           ✓ ✓ ✓ . ✓
  - html           x x x x x
  - markdown_inline✓ . . . ✓
  - python         ✓ ✓ ✓ ✓ ✓
  - tsx            ✓ ✓ ✓ ✓ ✓
  - yaml           x x x x x
  - query          ✓ ✓ ✓ ✓ ✓
  - typescript     ✓ ✓ ✓ ✓ ✓
  - javascript     ✓ ✓ ✓ ✓ ✓
  - regex          ✓ . . . .
  - lua            ✓ ✓ ✓ ✓ ✓
  - help           ✓ . . . ✓
  - markdown       ✓ . ✓ . ✓
  - json           ✓ ✓ ✓ ✓ .
  - vim            ✓ ✓ ✓ . ✓

  Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
         +) multiple parsers found, only one will be used
         x) errors found in the query, try to run :TSUpdate {lang}

## The following errors have been detected:
  - ERROR: html(highlights): Failed to load parser: uv_dlopen: The specified procedure could not be found.
    
    html(highlights) is concatenated from the following files:
    | [ERROR]:"C:\Users\dosaadmin\AppData\Local\nvim-data\lazy\nvim-treesitter\queries\html_tags\highlights.scm", failed to load: Failed to load parser: uv_dlopen: The specified procedure could not be found.
    
    | [ERROR]:"C:\Users\dosaadmin\AppData\Local\nvim-data\lazy\nvim-treesitter\queries\html\highlights.scm", failed to load: Failed to load parser: uv_dlopen: The specified procedure could not be found.
  - ERROR: html(locals): Failed to load parser: uv_dlopen: The specified procedure could not be found.
    
    html(locals) is concatenated from the following files:
    | [ERROR]:"C:\Users\dosaadmin\AppData\Local\nvim-data\lazy\nvim-treesitter\queries\html\locals.scm", failed to load: Failed to load parser: uv_dlopen: The specified procedure could not be found.
  - ERROR: html(folds): Failed to load parser: uv_dlopen: The specified procedure could not be found.
    
    html(folds) is concatenated from the following files:
    | [ERROR]:"C:\Users\dosaadmin\AppData\Local\nvim-data\lazy\nvim-treesitter\queries\html\folds.scm", failed to load: Failed to load parser: uv_dlopen: The specified procedure could not be found.
  - ERROR: html(indents): Failed to load parser: uv_dlopen: The specified procedure could not be found.
    
    html(indents) is concatenated from the following files:
    | [ERROR]:"C:\Users\dosaadmin\AppData\Local\nvim-data\lazy\nvim-treesitter\queries\html_tags\indents.scm", failed to load: Failed to load parser: uv_dlopen: The specified procedure could not be found.
    
    | [ERROR]:"C:\Users\dosaadmin\AppData\Local\nvim-data\lazy\nvim-treesitter\queries\html\indents.scm", failed to load: Failed to load parser: uv_dlopen: The specified procedure could not be found.
  - ERROR: html(injections): Failed to load parser: uv_dlopen: The specified procedure could not be found.
    
    html(injections) is concatenated from the following files:
    | [ERROR]:"C:\Users\dosaadmin\AppData\Local\nvim-data\lazy\nvim-treesitter\queries\html\injections.scm", failed to load: Failed to load parser: uv_dlopen: The specified procedure could not be found.
  - ERROR: yaml(highlights): Failed to load parser: uv_dlopen: The specified procedure could not be found.
    
    yaml(highlights) is concatenated from the following files:
    | [ERROR]:"C:\Users\dosaadmin\AppData\Local\nvim-data\lazy\nvim-treesitter\queries\yaml\highlights.scm", failed to load: Failed to load parser: uv_dlopen: The specified procedure could not be found.
  - ERROR: yaml(locals): Failed to load parser: uv_dlopen: The specified procedure could not be found.
    
    yaml(locals) is concatenated from the following files:
    | [ERROR]:"C:\Users\dosaadmin\AppData\Local\nvim-data\lazy\nvim-treesitter\queries\yaml\locals.scm", failed to load: Failed to load parser: uv_dlopen: The specified procedure could not be found.
  - ERROR: yaml(folds): Failed to load parser: uv_dlopen: The specified procedure could not be found.
    
    yaml(folds) is concatenated from the following files:
    | [ERROR]:"C:\Users\dosaadmin\AppData\Local\nvim-data\lazy\nvim-treesitter\queries\yaml\folds.scm", failed to load: Failed to load parser: uv_dlopen: The specified procedure could not be found.
  - ERROR: yaml(indents): Failed to load parser: uv_dlopen: The specified procedure could not be found.
    
    yaml(indents) is concatenated from the following files:
    | [ERROR]:"C:\Users\dosaadmin\AppData\Local\nvim-data\lazy\nvim-treesitter\queries\yaml\indents.scm", failed to load: Failed to load parser: uv_dlopen: The specified procedure could not be found.
  - ERROR: yaml(injections): Failed to load parser: uv_dlopen: The specified procedure could not be found.
    
    yaml(injections) is concatenated from the following files:
    | [ERROR]:"C:\Users\dosaadmin\AppData\Local\nvim-data\lazy\nvim-treesitter\queries\yaml\injections.scm", failed to load: Failed to load parser: uv_dlopen: The specified procedure could not be found.

I'm running nvim 0.8.0 on Windows 11. MSys2 and LLVM are installed.

@groovyghoul
Copy link

This is definitely still an issue, Windows 11, LLVM and gcc installed.
Exact same results as @domsch1988 mentioned above. I understand this is still a WIP in Window, but thought I would throw this in, just in case you need somebody else to test anything for you.

@folke folke reopened this Jan 16, 2023
@folke
Copy link
Collaborator

folke commented Jan 16, 2023

I'll look at it later today. Sorry for the delay!

@folke
Copy link
Collaborator

folke commented Jan 16, 2023

I just did a clean install on windows and for me all treesitter parsers install without an issue.

@groovyghoul
Copy link

groovyghoul commented Jan 16, 2023

When you close neovim and then open it back up, Treesitter doesn't try to install them all again? We are seeing this behavior on two different dev boxes (both installs exhibited the same issues reports in this ticket).

We see :checkhealth reporting that all of the parsers are installed with no issues, but then when you close neovim and open it, the treesitter installs kick in again.

(for context, this all works perfectly in WSL)

@folke
Copy link
Collaborator

folke commented Jan 16, 2023

I found the issue. LazyVim installed the latest release of nvim-treesitter, but unfortunately that release is pretty old and has issues.

The issue you are encountering is nvim-treesitter/nvim-treesitter#2844

Luckily this has been fixed in the meantime, so I set version=false for nvim-treesitter.

To fix it, please update lazyvim and nvim-treesitter, restart Neovim and then run TSUpdate.

If that would fail again with an access denied error, then you'll need to delete the existing parsers at AppData/Local/nvim-data/lazy/nvim-treesitter/parsers/* (something like that. on linux again)

@groovyghoul
Copy link

@folke That seems to have did the trick! Thank you so much!

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

Successfully merging a pull request may close this issue.

4 participants