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
'Error during compilation' How to get more information? #1030
Comments
i resolved this issue by installing the nixOS package How to debug further errors ? how do i get the exact error messages instead of just "Error ... " ? |
TSInstallSync yields the complete compiler output in case of failure but we should capture stdio also in async launches |
I got the exact same. Running latest neovim and with tree-sitter 0.19.3 PR 1000. For me the culprit is Output from
|
Yes, haskell uses C++11. You should try to use a more recent version of gcc or clang that use C++11 as a default. You can controll that with CC enviroment variable. This is why I updated our CI to Ubuntu 20.04 because it uses a more recent GCC. |
Thanks @theHamsta |
@dahmc The problem why we can't add |
@theHamsta I see. I just manually compiled the file and copied it over. I don't even use haskell, just want to be able to use the 'all' setting, so that fixes it for me :) |
I get the same error as @dahmc with treesitter complaining about haskell when I open nvim. I don't exactly understand how dahmc fixed it. If anyone will help enlighten me it would really be appreciated 🙏 |
@Jens-Andersen a very recent compiler will automatically use C++1X and the haskell parser will compile. The haskell parser is the only parser causing that problem and it fails to compile with some compilers that don't assume C++11: #1080 we eventually need to find a solution for this. A recent GCC and clang seems to do fine (but I had to upgrade the CI to Ubuntu 20.04). Apple clang and the compilers on Windows seem to have problems. |
@Jens-Andersen This is the very hacky solution I did to make the error go away, if I recall correctly: cd ~/.local/share/nvim/tree-sitter-haskell
/usr/local/opt/gcc/bin/gcc-10 -o parser.so -I./src src/parser.c src/scanner.cc -shared -Os -lstdc++ -fPIC
cp parser.so ~/.vim/plugged/nvim-treesitter/parser/haskell.so |
You can also set CC environment variable to gcc-10 to use gcc-10 |
If use packer.nvim cd ~/.local/share/nvim/tree-sitter-haskell
/usr/local/opt/gcc/bin/gcc-10 -o parser.so -I./src src/parser.c src/scanner.cc -shared -Os -lstdc++ -fPIC
cp parser.so ~/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/haskell.so |
@Jens-Andersen If using Apple's Clang, you would need to invoke the compiler twice, for cd ~/.local/share/nvim/tree-sitter-haskell
clang -o scanner.so -I./src src/scanner.cc -std=c++14 -shared -Os -fPIC -lstdc++
clang -o parser.so scanner.so -I./src src/parser.c -shared -Os -fPIC -lstdc++
# if using vim-plug
cp parser.so ~/.vim/plugged/nvim-treesitter/parser/haskell.so
# if using packer.nvim
cp parser.so ~/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/haskell.so It would also be a good idea to add |
@theHamsta could you give an example of how I would set my CC env variable? I get a lot of different results some with setting it in a make file others in my .*rc file. And fantastic that you are already on top of the problem, I will keep the linked issue bookmarked to follow the progress. @ziulev thanks for the walk-through that was exactly what I was hoping for. And I use packer so I really appreciate the example with that since im still very new in this ecosystem. @omar25h I presume I use Apple's Clang but not quite sure. And thanks for the extended answer it would be quite annoying if |
@Jens-Andersen CC should just lead to your prefered C compiler (name or full path). You can also set the compiler explicitly via Lua https://github.com/theHamsta/nvim-treesitter/blob/rust-closures/lua/nvim-treesitter/install. Maybe we should allow multiple compiler invocations but this can quickly lead to a complexity where we should have use an actual build system. In the past, we only had this problem with really old compilers and just said we require a recently modern C++ standard. If it's only the Haskell parser then maybe we should special-case it? You can also treat tree-sitter-haskel as a plugin with the corrsponding compile commands as install commands. Just remember to move the resulting |
Thanks for the help everyone you guys are life savers! @theHamsta In my case it was only the haskell parser there were an issue with, the rest seems to have worked out of the box or according to the installation guides |
Could you fix link please? I've got the same issue also on NixOS |
Is the problem the haskell compiler? |
I've solved the issue by removing clang from packages |
Yes, on MacOS there seems to be a problem with Apple Clang not defaulting to C++14. There is only one spot in the Haskell compiler that requires C++14. Maybe I can create a PR to lower the requirement to C++11 |
Hmm, but I'm not using MacOS, I've got NixOS Linux. |
But with Haskell. I can happen when your compiler defaults to C++11. I hope this change can lower the required standard to C++11 theHamsta/tree-sitter-haskell@9931c25 |
Thanks @breuerfelix for the fix. I installed ❯ nix-env -iA nixpkgs.clangStdenv
installing 'stdenv-darwin'
building '/nix/store/cs9bs384hljk66s0y3zxx5zjvjp99zwj-user-environment.drv'... Opened lunarvim and ran |
Describe the bug
Everytime i start Neovim, it tries to install one missing language parser and fails. I am not able to get any error messages to figure out which one it is or why this happens.
TSUpdate also returns errors for two parsers. How do i get more information?
To Reproduce
Steps to reproduce the behavior:
:messages
:TSUpdate
Expected behavior
More Error Information. Or no Error at all :)
Output of
:checkhealth nvim_treesitter
Output of
nvim --version
Treesitter config:
Additional context
/edit now i got this error on all of my systems. not able to debug!
The text was updated successfully, but these errors were encountered: