-
Notifications
You must be signed in to change notification settings - Fork 12
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
Cannot install on macOS arm64 due to outdated CLI version #15
Comments
See the discussion here for why an update is still postponed: #2 |
Yes, @mikehaertl is correct. That said, I understand that the latest TS (0.20.3 or .4) allows us to generate parsers for arbitrary ABIs. I'll try to play with this to see if we can update to latest TS but then commit the older ABI parsers for use on npm and Atom. That way, anyone could get the latest version as well, just by doing something like |
Turns out this is not true. It only supports ABIs 13 and 14, both of which are "newer" than what I can use for my OG use case. Until Atom gets updated tree-sitter support, we either need to make sure that this parser works w/ newer tree-sitter versions, or that it can be downgraded and still work for older versions. Either way, it's a PITA. FWIW, I've just confirmed that this works as-is w/ the the latest tree-sitter: |
Not compatible with Apple Silicon (see claytonrcarter/tree-sitter-phpdoc#15).
Quick fix: install tree-sitter-phpdoc under macOS arm chipPrinciple: Hack customization of nvim-treesitter.
Steps:Go to the nvim-treesitter directory: cd ~/.local/share/lunarvim/site/pack/packer/start/ Modify the file list.phpdoc = {
install_info = {
- url = "https://github.com/claytonrcarter/tree-sitter-phpdoc",
+ url = "https://github.com/Anoxia/tree-sitter-phpdoc",
files = { "src/parser.c", "src/scanner.c" },
-- parser.c in the repo still based on TS 0.17 due to other dependencies
requires_generate_from_grammar = true,
generate_requires_npm = true,
},
maintainers = { "@mikehaertl" },
experimental = true,
} Modify "phpdoc": {
- "revision": "46d6366a66266f1e9ae00ee7ea27aa9de629ade6"
+ "revision": "cc4a3da3089e58cf037dc6675b01c41f08143b53"
}, Finally, reload the nvim configuration, install phpdoc via cp ~/.local/share/nvim/tree-sitter-phpdoc/parser.so ~/.local/share/lunarvim/site/pack/packer/start/nvim-treesitter/parser/phpdoc.so enjoy😊! |
Came into this great answer and wanted to provide a more general version of the last comment's solution, in case you have installed a regular version of Neovim instead of LunarVim (Neovim vs LunarVim): 1. Go to plugins pathDefault Neovim path: cd ~/.local/share/nvim/site/pack/packer/start/ 2. Modify
|
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
-- Fix `Cannot install tree-sitter-cli for architecture arm64`
parser_config.phpdoc.install_info.url = "https://github.com/Anoxia/tree-sitter-phpdoc"
require("nvim-treesitter.configs").setup {
...
} And remove lockfile.json |
This path does not exist on my machine: cd ~/.local/share/nvim/site/pack/packer/start/ |
@anoxia happy to help if you can provide more information about your setup. Do you use packer and have tree-sitter installed? Do you have LunarVim installed or regular Neovim? |
I use LunarVim. Sorry, I thought everyone used LunarVim, so I mistook the path you provided for a problem. |
@claytonrcarter would it be possible to include this change in this repo as well? |
Thank you all for your patience. This repo is using the latest version (at this time) of tree-sitter as of 592429e, so all of this rigamarole should be no longer necessary. |
There had been an issue where PHPDoc installation failed on Apple Silicon machines, but it appears to have been resolved. (claytonrcarter/tree-sitter-phpdoc#15)
I ran into an error saying
npm ERR! Error: Cannot install tree-sitter-cli for architecture arm64
(tree-sitter/tree-sitter#942) while installing tree-sitter-phpdoc.This is because of tree-sitter-cli version is set to ^0.17.3 -- The issue has been fixed in tree-siter-cli v0.18.3+. Can you update the dependency version so that I can install the module on a arm64 mac? Thanks!
The text was updated successfully, but these errors were encountered: