doom-neovim / doom-nvim

A Neovim configuration for the advanced martian hacker
GNU General Public License v2.0
1k stars 108 forks source link

[BUG] MacOS GCC Treesitter grammer install error `<sys/_types/_int8_t.h>` #388

Closed connorgmeehan closed 2 years ago

connorgmeehan commented 2 years ago

Current Behavior:

When installing some treesitter grammers with GCC-12, neovim encounters an error: This occured after updating from gcc-11 to gcc-12 with the gcc/clang workaround: https://github.com/NTBBloodbath/doom-nvim/issues/246.

nvim-treesitter[yaml]: Error during compilation
In file included from /usr/local/Cellar/gcc/12.1.0/lib/gcc/current/gcc/x86_64-apple-darwin20/12/include/stdint.h:9,
                 from ./src/tree_sitter/parser.h:9,
                 from src/parser.c:1:
/usr/local/Cellar/gcc/12.1.0/lib/gcc/current/gcc/x86_64-apple-darwin20/12/include-fixed/stdint.h:27:10: fatal error: sys/_types/_int8_t.h: No such file or directory
   27 | #include <sys/_types/_int8_t.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from /usr/local/Cellar/gcc/12.1.0/lib/gcc/current/gcc/x86_64-apple-darwin20/12/include/stdint.h:9,
                 from ./src/tree_sitter/parser.h:9,
                 from src/scanner.cc:1:
/usr/local/Cellar/gcc/12.1.0/lib/gcc/current/gcc/x86_64-apple-darwin20/12/include-fixed/stdint.h:27:10: fatal error: sys/_types/_int8_t.h: No such file or directory
   27 | #include <sys/_types/_int8_t.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~

How to fix

I just re-installed xcode's cli tools. xcode-select --install and it worked

If you're still running into issues you may need to fresh install homebrew or install gcc from source (brew reinstall -s gcc