Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

haskell plugin module err on startup - Intel Mac (pre M1) #70

Closed
molleweide opened this issue Jul 22, 2021 · 13 comments
Closed

haskell plugin module err on startup - Intel Mac (pre M1) #70

molleweide opened this issue Jul 22, 2021 · 13 comments

Comments

@molleweide
Copy link
Contributor

molleweide commented Jul 22, 2021

Hi,

maybe this has to do with the fact that i installed doom under ~/.config/nvim.config/doom with Cheovim??

I don't know what this is but i post it fyi. I am going to read the contribution guidelines
so that I can contribute with better bug reports going forward.

error goes away by commenting out haskell from doomrc.

nvim-treesitter[haskell]: Error during compilation
src/scanner.cc:79:10: error: expected expression
  return [=](A a) { return f(g(a)); };
         ^
src/scanner.cc:83:10: error: expected expression
  return [=](A a) { return f(g(a)); };
         ^
src/scanner.cc:87:10: error: expected expression
  return [=](A a) { return f(g(a)); };
         ^
src/scanner.cc:90:64: error: expected expression
template<class A, class B> function<B(A)> const_(B b) { return [=](auto _) { return b; }; }
                                                               ^
src/scanner.cc:155:16: error: non-aggregate type 'vector<std::__1::string>' (aka 'vector<basic_string<char, char_traits<char>, allocator<char> > >') c
annot be initialized with an initializer list
vector<string> names = {
               ^       ~
src/scanner.cc:183:69: error: expected expression
bool all(const bool *syms) { return std::all_of(syms, syms + empty, [](bool a) { return a; }); }
                                                                    ^
src/scanner.cc:240:8: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
  for (auto i : state.indents) {
       ^
src/scanner.cc:240:15: warning: range-based for loop is a C++11 extension [-Wc++11-extensions]
  for (auto i : state.indents) {
              ^
src/scanner.cc:285:10: error: expected expression
  return [=](State & state) {
         ^
src/scanner.cc:308:57: error: expected expression
Peek operator&(const Peek & l, const Peek & r) { return [=](uint32_t c) { return l(c) && r(c); }; }
                                                        ^
src/scanner.cc:309:57: error: expected expression
Peek operator|(const Peek & l, const Peek & r) { return [=](uint32_t c) { return l(c) || r(c); }; }
                                                        ^
src/scanner.cc:310:30: error: expected expression
Peek not_(Peek con) { return [=](uint32_t c) { return !con(c); }; }
                             ^
src/scanner.cc:321:72: error: expected expression
Condition operator&(const Condition & l, const Condition & r) { return [=](auto s) { return l(s) && r(s); }; }
                                                                       ^
src/scanner.cc:322:72: error: expected expression
-- More --
@NTBBloodbath
Copy link
Collaborator

Hey, that's really weird because it works for me, can you please provide some information of your system? e.g. treesitter binary version

I'll not be able to help too much right now because I'm not at home :(

@molleweide
Copy link
Contributor Author

No stress!!

@NTBBloodbath
Copy link
Collaborator

Hi, have you managed to fix this? If you don't have the treesitter CLI then you can try installing it and trying again

@kaii-zen
Copy link

kaii-zen commented Jul 30, 2021

macOS? If yes, I got past that by adding require('nvim-treesitter.install').compilers = { 'gcc' } to lua/doom/modules/config/doom-treesitter.lua (though I think anywhere would do, as long as it's early enough). clang defaults to c++11 while the Haskell tree-sitter parser relies on some c++14 features. something like that.

@molleweide
Copy link
Contributor Author

molleweide commented Jul 30, 2021

Hi, have you managed to fix this? If you don't have the treesitter CLI then you can try installing it and trying again

Yo! No not yet. but i haven't really been working on it either. i have been learning other doom stuff.

macOS? If yes, I got past that by adding require('nvim-treesitter.install').compilers = { 'gcc' } to lua/doom/modules/config/doom-treesitter.lua (though I think anywhere would do, as long as it's early enough). clang defaults to c++11 while the Haskell tree-sitter parser relies on some c++14 features. something like that.

I will try this!!

@molleweide
Copy link
Contributor Author

yo it didn't work :(
I am looking into the issue more now!

@kaii-zen
Copy link

kaii-zen commented Aug 4, 2021

yo it didn't work :(
I am looking into the issue more now!

Did you brew install gcc first? I should've probably mentioned it.

@molleweide
Copy link
Contributor Author

molleweide commented Aug 4, 2021

ooh i just saw you replied again.

so this is what i have done:

  1. l have read this: Unable to setup on mac tree-sitter/tree-sitter-haskell#34
  2. checked treesitter version
  3. and installed gcc with brew now
    i also tried with clang bc somebody said recommended to try just incase.

still doesn't work. I will keep searching. I also asked about the error in the linked issue.

@molleweide
Copy link
Contributor Author

molleweide commented Aug 4, 2021

wait a minute. doesn't this mean i am using wrong version of gcc. or how do i make sure that the brew provided gcc is used?? I have been googling a bit and it seems really hard to update clang++, no??

╰ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

@kaii-zen
Copy link

kaii-zen commented Aug 4, 2021

Not exactly... there are 2 commonly used C/C++ compilers. Generally speaking, Linux-sphere uses gcc and macOS uses clang. In addition, the C++ language spec has different "versions". At least the clang that comes with macOS defaults to version 11 of the spec. Current gcc defaults to version 17 of the spec. Haskell treesitter depends on some features available in version 14 of the spec (and onwards). Also it looks like Apple symlinks gcc to clang which just adds to the confusion. macOS does not come with gcc (it used to tho). Hope that helps.

@molleweide
Copy link
Contributor Author

Yeah thanks man! The c world is quite new to me.

@molleweide
Copy link
Contributor Author

guys!!!! problem solved.

you had to symlink to gcc-11

ln -sf /usr/local/bin/gcc-11 /usr/local/bin/gcc

They updated the readme for tree sitter haskell.

@molleweide molleweide reopened this Sep 5, 2021
@molleweide
Copy link
Contributor Author

molleweide commented Sep 5, 2021

Hi guys,

I just got my new macbook air m1 silicone and it seems that I get the exact same
error when starting neovim after having setup all of my configs.

I will report back if I figure out why.

@molleweide molleweide changed the title haskell plugin module err on startup haskell plugin module err on startup - Intel Mac (pre M1) Sep 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants