Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Building failed caused by a syntax error in scanner.c #2692

Closed
SpacewaIker opened this issue Jun 6, 2022 · 5 comments
Closed

Building failed caused by a syntax error in scanner.c #2692

SpacewaIker opened this issue Jun 6, 2022 · 5 comments
Labels
C-bug Category: This is a bug O-windows Operating system: Windows

Comments

@SpacewaIker
Copy link

Summary

I tried building helix as per the instructions on the website and got the following error:

  --- stderr
  thread 'main' panicked at 'Failed to compile tree-sitter grammars: Failed to build some grammar(s)

  Caused by:
      Parser compilation failed.
      Stdout: scanner.c
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(211): error C2146: syntax error: missing ')' before identifier 'vs'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(211): error C2061: syntax error: identifier 'vs'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(211): error C2059: syntax error: ';'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(211): error C2059: syntax error: ','
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(211): error C2059: syntax error: ')'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(300): error C2146: syntax error: missing ')' before identifier 's'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(300): error C2061: syntax error: identifier 's'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(300): error C2059: syntax error: ';'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(300): error C2059: syntax error: ','
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(300): error C2059: syntax error: ')'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(387): error C2146: syntax error: missing ')' before identifier 's'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(387): error C2061: syntax error: identifier 's'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(387): error C2059: syntax error: ';'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(387): error C2059: syntax error: ','
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(387): error C2059: syntax error: ')'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(643): error C2146: syntax error: missing ')' before identifier 'desc'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(643): error C2061: syntax error: identifier 'desc'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(643): error C2059: syntax error: ';'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(643): error C2059: syntax error: ')'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(643): error C2449: found '{' at file scope (missing function header?)
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(646): error C2059: syntax error: '}'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(694): error C2440: 'return': cannot convert from 'int' to 'Result'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(705): error C2440: 'return': cannot convert from 'int' to 'Result'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(757): error C2440: 'return': cannot convert from 'int' to 'Result'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(778): error C2440: 'return': cannot convert from 'int' to 'Result'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(805): error C2440: 'return': cannot convert from 'int' to 'Result'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(807): error C2440: 'return': cannot convert from 'int' to 'Result'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(848): error C2440: 'return': cannot convert from 'int' to 'Result'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(852): error C2440: 'return': cannot convert from 'int' to 'Result'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(897): error C2440: 'return': cannot convert from 'int' to 'Result'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(936): error C2440: 'return': cannot convert from 'int' to 'Result'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(950): error C2440: 'return': cannot convert from 'int' to 'Result'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(969): error C2440: 'return': cannot convert from 'int' to 'Result'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(989): error C2440: 'return': cannot convert from 'int' to 'Result'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(1004): error C2440: 'return': cannot convert from 'int' to 'Result'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(1014): error C2440: 'return': cannot convert from 'int' to 'Result'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(1038): error C2440: 'return': cannot convert from 'int' to 'Result'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(1071): error C2440: 'return': cannot convert from 'int' to 'Result'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(1062): error C2440: 'initializing': cannot convert from 'int' to 'Result'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(1075): error C2440: 'initializing': cannot convert from 'int' to 'Result'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(1105): error C2440: 'return': cannot convert from 'int' to 'Result'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(1114): error C2440: '=': cannot convert from 'int' to 'Result'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(1116): error C2440: '=': cannot convert from 'int' to 'Result'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(1142): error C2440: 'return': cannot convert from 'int' to 'Result'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(1230): error C2440: 'return': cannot convert from 'int' to 'Result'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(1238): error C2440: 'return': cannot convert from 'int' to 'Result'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(1342): error C2440: 'return': cannot convert from 'int' to 'Result'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(1365): error C2440: ':': cannot convert from 'Result' to 'int'
      C:\Program Files\Helix\helix\runtime\grammars\sources\haskell\src\scanner.c(1365): error C2440: 'return': cannot convert from 'int' to 'Result'
      parser.c
      Generating Code...

      Stderr: ', helix-term\build.rs:22:26
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: failed to compile `helix-term v0.6.0 (C:\Program Files\Helix\helix\helix-term)`, intermediate artifacts can be found at `C:\Program Files\Helix\helix\target`

Reproduction Steps

I'm running Windows 11 and I opened a command prompt with Admin privileges, then navigated to "C:\Program Files\Helix". I then followed the instructions:

git clone https://github.com/helix-editor/helix
cd helix
cargo install --path helix-term

Helix log

No response

Platform

Windows 11

Terminal Emulator

Windows cmd

Helix Version

helix 22.05

@SpacewaIker SpacewaIker added the C-bug Category: This is a bug label Jun 6, 2022
@the-mikedavis
Copy link
Member

Are you running an old version of a C/C++ compiler? IIRC the haskell grammar only needs C99 now (#1417)

@SpacewaIker
Copy link
Author

My compiler version is gcc 6.3.0 on windows cmd. I also tried WSL, and there, it is version gcc 9.3.0. I actually just tried to install helix with a WSL terminal and everything worked. The only issue is that the hx command is only recognized in WSL terminals, not my cmd terminals...

So I tried updating my version of GCC/MinGW on cmd but I can't figure out how to do this. I tried looking for solutions online but they didn't seem to work... However this seems to be the problem, not helix

Although that could mean that the haskell grammar needs a more recent version of C than C99? I'm not sure

@SpacewaIker
Copy link
Author

I succeeded in upgrading GCC, I now have gcc version 12.1.0. However, I got the same error at line 211 in scanner.c in the haskell grammar directory. I'm not sure why it worked with WSL but not with cmd though...

@the-mikedavis the-mikedavis added the O-windows Operating system: Windows label Jun 7, 2022
@vinyatu
Copy link

vinyatu commented Jun 16, 2022

I confirm this issue on Cygwin version 3.3.5-1 running on Windows 7. Building fails with exactly the same error output in scanner.c

@pascalkuthe
Copy link
Member

Helix now requires a C11 compiler for compiling grammars so I am closing this as stale.

running on Windows 7.

Windows 7 is also EOL and not supported by rust (and by extension helix).

@pascalkuthe pascalkuthe closed this as not planned Won't fix, can't repro, duplicate, stale Jul 16, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-bug Category: This is a bug O-windows Operating system: Windows
Projects
None yet
Development

No branches or pull requests

4 participants