Open buraksirma opened 1 year ago
I fixed the problem by changing the used gcc binary. macOs is getting shipped with apple version of clang
and it's the problem. You can install gcc via brew. If you symlink it with gcc it will override apple one and TSUpdate
will work but if you don't want to symlink it just install gcc and pass it nvim-treesitter
with the config below.
require("nvim-treesitter.install").compilers = { "gcc-12" }
I am facing the same problem. I tried the same approach as above, but another error occurred:
nvim-treesitter[norg]: Error during compilation
0 0x102f641a0 __assert_rtn + 140
1 0x102deba8c mach_o::relocatable::Parser<arm64>::parse(mach_o::relocatable::ParserOptions const&) + 4536
2 0x102dbdd38 mach_o::relocatable::Parser<arm64>::parse(unsigned char const*, unsigned long long, char const*, long, ld::File::Ordinal, mach_o::relocatable::ParserOptions const&) + 148
3 0x102e264ac ld::tool::InputFiles::makeFile(Options::FileInfo const&, bool) + 1468
4 0x102e29360 ___ZN2ld4tool10InputFilesC2ER7Options_block_invoke + 56
5 0x18a312544 _dispatch_client_callout2 + 20
6 0x18a327654 _dispatch_apply_invoke_and_wait + 224
7 0x18a326938 _dispatch_apply_with_attr_f + 1152
8 0x18a326b48 dispatch_apply + 108
9 0x102e291f4 ld::tool::InputFiles::InputFiles(Options&) + 616
10 0x102dab6c0 main + 552
A linker snapshot was created at:
^I/tmp/parser.so-2023-01-18-223913.ld-snapshot
ld: Assertion failed: (_file->_atomsArrayCount == computedAtomCount && "more atoms allocated than expected"), function parse, file macho_relocatable_file.cpp, line 2061.
collect2: error: ld returned 1 exit status
I use Homebrew GCC 12.2.0 on M1 Mac.
$ gcc-12 --version
gcc-12 (Homebrew GCC 12.2.0) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Sorry, I found the comment that solves the problem.
https://github.com/nvim-neorg/tree-sitter-norg/issues/7#issuecomment-1251675173
The above comment will probably solve the issue, but another way to solve this is to remove the xcode from your mac, and install the latest version of clt directly using xcode-select --install
, and use the gcc-12 when installing the parser like this CC=$(which gcc-12) nvim -c "TSUpdate norg"
I fixed the problem by changing the used gcc binary. macOs is getting shipped with apple version of
clang
and it's the problem. You can install gcc via brew. If you symlink it with gcc it will override apple one andTSUpdate
will work but if you don't want to symlink it just install gcc and pass itnvim-treesitter
with the config below.require("nvim-treesitter.install").compilers = { "gcc-12" }
same here, thanks
I had this problem attempting to install norg
directly via nvim-treesitter
.
require('nvim-treesitter.configs').setup({
ensure_installed = {
'norg',
},
})
However, I don't have any issues if I install via the command
:Neorg sync-parsers
I ran into this and spent some time digging into it. There's a few things going on here, but the fundamental issue is that Neorg is reaching into nvim-treesitter to a) change the version of tree-sitter-norg that it builds and b) install a kludge that changes the way it builds parsers.
I've created nvim-neorg/neorg#1587 which should fix this.
I've updated my plugins after a few months and tree sitter for norg doesn't get compiled.
Error stack tree:
CC version:
Default standart from man pages if it helps