Himujjal / tree-sitter-svelte

Tree sitter grammar for Svelte
MIT License
77 stars 15 forks source link

Error during compilation #39

Open AnnikenYT opened 1 year ago

AnnikenYT commented 1 year ago

Hiya! I'm relatively new to everything-vim, recently made the switch from vscode to nvim w/ nvchad, so excuse my "noobishness". When I'm trying to do :TSInstall svelte, I get the following error:

nvim-treesitter[svelte]: Error during compilation
In file included from src/scanner.c:7:
src/uthash.h:375:16: error: always_inline function '_mm_crc32_u8' requires target feature 'crc32', but would be inlined into function 'hashmap_crc32_helper' that is compiled without support for 'crc32'
    crc32val = _mm_crc32_u8(crc32val, HASHMAP_CAST(unsigned char, s[i]));
               ^
1 error generated.

I am using Windows (I know, shame on me) 11, and have emcc installed.

Kohlenbach commented 12 months ago

I'm having the same issue 😞 (also windows 11)

AnnikenYT commented 12 months ago

Good to know that I'm not alone on that. I'll check if this can be reproduced on win 10.

Kohlenbach commented 12 months ago

If you don't find a way to use with :TSInstall then maybe use custom until fix. May help: https://youtu.be/Mtgo-nP_r8Y?t=420

Rasmus-Bertell commented 11 months ago

I can confirm this happening also on Windows 10, for whatever reason my Windows 11 laptop worked just fine.

Edition     Windows 10 Enterprise
Version     22H2
Installed on    ‎xx/xx/2022
OS build    19045.3208
Experience  Windows Feature Experience Pack 1000.19041.1000.0

Processor   12th Gen Intel(R) Core(TM) i7-12700H   2.30 GHz
Installed RAM   32,0 GB (31,7 GB usable)
System type 64-bit operating system, x64-based processor
Himujjal commented 11 months ago

Sorry fellas. Was out for vacation. Will get this fix done soon

Noodle-Bug commented 6 months ago

Looks like this is still happening

:TSInstall svelte

nvim-treesitter[svelte]: Error during compilation
In file included from src/scanner.c:7:^M
src/uthash.h:375:16: error: always_inline function '_mm_crc32_u8' requires target feature 'crc32', but would be inlined into function 'hashmap_crc32_helper' that is compiled without support for 'crc32'^M
    crc32val = _mm_crc32_u8(crc32val, HASHMAP_CAST(unsigned char, s[i]));^M
               ^^M
1 error generated.^M
NVIM v0.9.4
Build type: RelWithDebInfo
LuaJIT 2.1.1696883897
lllama commented 5 months ago

So I've had the same issue and I was able to resolve it by opening a "Developer Powershell for VS2022" terminal, rather than my usual one. I then opened nvim and did TSInstall svelte. Everything compiled and then I got highlighting etc in normal sessions.

You'll need to install some variant of VS Studio Dev tools to get the required files etc.

Noodle-Bug commented 5 months ago

So I've had the same issue and I was able to resolve it by opening a "Developer Powershell for VS2022" terminal, rather than my usual one. I then opened nvim and did TSInstall svelte. Everything compiled and then I got highlighting etc in normal sessions.

You'll need to install some variant of VS Studio Dev tools to get the required files etc.

Hey that worked! What made you try that out?

lllama commented 5 months ago

Thanks @Noodle-Bug. The error was suggesting that some feature needed turning on and I couldn't find a way to change the compiler options used by the treesitter plugin, so I decided to take a punt and see whether it would be enabled by default in the Developer terminal. (I know it sets a load of env vars etc.)