Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Macos startup errors #10

Closed
molleweide opened this issue Sep 5, 2021 · 6 comments
Closed

Macos startup errors #10

molleweide opened this issue Sep 5, 2021 · 6 comments

Comments

@molleweide
Copy link

molleweide commented Sep 5, 2021

Yo!

I use doom-nvim and .norg i not working on neither of my old intel macbook pro or my new M1 macbook air.

M1 startup error

nvim-treesitter[norg]: Error during compilation
Undefined symbols for architecture arm64:
  "_tree_sitter_norg_external_scanner_create", referenced from:
      _tree_sitter_norg.language in parser-29db6d.o
  "_tree_sitter_norg_external_scanner_deserialize", referenced from:
      _tree_sitter_norg.language in parser-29db6d.o
  "_tree_sitter_norg_external_scanner_destroy", referenced from:
      _tree_sitter_norg.language in parser-29db6d.o
  "_tree_sitter_norg_external_scanner_scan", referenced from:
      _tree_sitter_norg.language in parser-29db6d.o
  "_tree_sitter_norg_external_scanner_serialize", referenced from:
      _tree_sitter_norg.language in parser-29db6d.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Intel startup error

nvim-treesitter[norg]: Error during compilation
Undefined symbols for architecture x86_64:
  "_tree_sitter_norg_external_scanner_create", referenced from:
      _language.0 in cc3MwxxW.o
  "_tree_sitter_norg_external_scanner_deserialize", referenced from:
      _language.0 in cc3MwxxW.o
  "_tree_sitter_norg_external_scanner_destroy", referenced from:
      _language.0 in cc3MwxxW.o
  "_tree_sitter_norg_external_scanner_scan", referenced from:
      _language.0 in cc3MwxxW.o
  "_tree_sitter_norg_external_scanner_serialize", referenced from:
      _language.0 in cc3MwxxW.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
@molleweide
Copy link
Author

molleweide commented Sep 5, 2021

When syncing plugins in doom nvim this info is given:
vhyrro/neorg/unstable: updated: 1a85556...6c01988

and this is what is given on M1:
✓ vhyrro/neorg/unstable: already up to date

@vhyrro
Copy link
Member

vhyrro commented Sep 5, 2021

Welp, that's not good. A lot of this comes from clang being nasty on MacOS. nvim-treesitter guys are working on it from what I know. Dany has a workaround here if you haven't seen that already, although I don't know how applicable it is in your scenario. If all fails then the best thing you can do is unfortunately wait i suppose

@JoeyGrajciar
Copy link
Collaborator

The error points to fact that src/scanner.cc was not compiled. Make sure you add it to sources of nvim-treesitter norg parser config.

@vhyrro
Copy link
Member

vhyrro commented Sep 5, 2021

Hmm. I'd imagine doom has the scanner.cc set up properly. @molleweide you are running on the latest doom version right?

@cnt0
Copy link

cnt0 commented Sep 18, 2021

I got such error too. This part of my config was problematic:

local parser_configs = tsparsers.get_parser_configs()
parser_configs.norg = {
  install_info = {
    url = "https://github.com/vhyrro/tree-sitter-norg",
    files = { "src/parser.c" },
    branch = "main"
  },
}

as @JoeyGrajciar pointed, you need to add src/scanner.cc here:

local parser_configs = tsparsers.get_parser_configs()
parser_configs.norg = {
  install_info = {
    url = "https://github.com/vhyrro/tree-sitter-norg",
    files = { "src/parser.c", "src/scanner.cc" },
    branch = "main"
  },
}

also, clang from macos can't compile it anyway. So, brew install gcc or brew install llvm and start nvim like

CC=/opt/homebrew/Cellar/gcc/11.2.0/bin/gcc-11 nvim

you can then run TSUpdate and everything will be OK

@molleweide
Copy link
Author

Hi guys, my apologies for replying after so many days.

After having pulled doom-nvim main branch today, the errors pertaining to neorg have gone away. I will therefore close this becuase everything seems to be all good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants