tree-sitter-wgsl icon indicating copy to clipboard operation
tree-sitter-wgsl copied to clipboard

Can't Install/Compile the parser on macos-aarch64

Open carloskiki opened this issue 2 years ago • 1 comments

Recently, I've had problems with the wgsl parser of tree-sitter.

I tried uninstalling and reinstalling it, but I get this error:

nvim-treesitter[wgsl]: Error during compilation
Undefined symbols for architecture arm64:
  "_tree_sitter_wgsl_external_scanner_create", referenced from:
      _language.0 in ccs7asVr.o
  "_tree_sitter_wgsl_external_scanner_deserialize", referenced from:
      _language.0 in ccs7asVr.o
  "_tree_sitter_wgsl_external_scanner_destroy", referenced from:
      _language.0 in ccs7asVr.o
  "_tree_sitter_wgsl_external_scanner_scan", referenced from:
      _language.0 in ccs7asVr.o
  "_tree_sitter_wgsl_external_scanner_serialize", referenced from:
      _language.0 in ccs7asVr.o
ld: symbol(s) not found for architecture arm64
collect2: error: ld returned 1 exit status

Does anyone have any idea of what is happening?

carloskiki avatar Jan 19 '23 01:01 carloskiki

After removing the parser config specifications for tree-sitter, the parser was installed successfully.

Here is what I removed:

vim.filetype.add({extension = {wgsl = "wgsl"}})

-- REMOVED
-- local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
-- parser_config.wgsl = {
--     install_info = {
--         url = "https://github.com/szebniok/tree-sitter-wgsl",
--         files = { "src/parser.c" }
--     },
-- }

require'nvim-treesitter.configs'.setup {
    ensure_installed = {"wgsl"},
    highlight = {
        enable = true
    },
    incremental_selection = {
        enable = true,
        keymaps = {
            init_selection = "gnn",
            node_incremental = "grn",
            scope_incremental = "grc",
            node_decremental = "grm",
        },
    },
}

vim.wo.foldmethod = "expr"
vim.wo.foldexpr = "nvim_treesitter#foldexpr()"
vim.o.foldlevelstart = 99 -- do not close folds when a buffer is opened

I am unsure whether this issue is specific to my machine, and if it is more general I would consider adding more detailed information in the README.

carloskiki avatar Jan 19 '23 02:01 carloskiki