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

Trouble running package on macos (apple silicon) #82

Closed
avonmoll opened this issue Jun 27, 2024 · 2 comments
Closed

Trouble running package on macos (apple silicon) #82

avonmoll opened this issue Jun 27, 2024 · 2 comments

Comments

@avonmoll
Copy link

I had a working setup on my previous intel-based macos. Since migrating to the new machine, I cannot get papis.nvim to work. One thing that was necessary at some point was to install an arm64-specific version of sqlite3. Previously, I had in my config:

 vim.g.sqlite_clib_path = "/Users/.../homebrew/opt/sqlite/bin/sqlite3"

but running :checkhealth papis showed that it couldn't find the associated library, so I switched to

vim.g.sqlite_clib_path = "/Users/.../homebrew/opt/sqlite/lib/libsqlite3.dylib"

Now, running :checkhealth papis shows

papis: require("papis.health").check()

- ERROR Failed to run healthcheck for "papis" plugin. Exception:
  .../.local/share/nvim/lazy/papis.nvim/lua/papis/health.lua:26: attempt to index field 'data' (a nil value)

I went ahead and deleted the previous papis_db folder from ~/.local/share/nvim in case that folder (copied from previous mac) was causing issues. So it looks like something in the papis/sqlite-wrapper.lua file isn't running correctly, but that's about all I can figure out on my end.

@jghauser
Copy link
Owner

jghauser commented Jul 2, 2024

Thanks for the report! First, are you sure that papis.nvim has been loaded before you ran :checkhealth papis. I get your error if I run checkhealth before papis.nvim is loaded by a configured filetype. This in itself is a problem, but I don't think it is related to your main issue. Second, can you try running papis.nvim with the debug module (as described in the README) and check if the log has any pointers to where things fail? I doubt it will as the issue seems to be with the sqlite.lua dependency, but it doesn't hurt to be sure :).

@avonmoll
Copy link
Author

avonmoll commented Jul 11, 2024

Firstly, I updated papis.nvim. Then, I enabled the debug module by including enable_modules = { ["debug"] = true} to my setup function. Now I get this error when I run :checkhealth papis:

E5009: Invalid $VIMRUNTIME: /Users/me/share/nvim/runtime                                                                                                   
Error executing lua: /Users/me/share/nvim/runtime/lua/vim/health.lua:346: FileType Autocommands for "checkhealth": Vim(append):Error executing lua callback:
 ...me/share/nvim/runtime/lua/vim/treesitter/language.lua:107: no parser for 'yaml' language, see :help treesitter-parsers                                     
stack traceback:                                                                                                                                                  
        [C]: in function 'error'                                                                                                                                  
        ...me/share/nvim/runtime/lua/vim/treesitter/language.lua:107: in function 'add'                                                                        
        ...me/share/nvim/runtime/lua/vim/treesitter/query.lua:250: in function 'fn'                                                                         
        ...rs/me/share/nvim/runtime/lua/vim/func/_memoize.lua:58: in function 'parse'                                                                       
        ...are/nvim/lazy/papis.nvim/lua/papis/completion/source.lua:36: in main chunk                                                                             
        [C]: in function 'require'                                                                                                                                
        ...share/nvim/lazy/papis.nvim/lua/papis/completion/init.lua:22: in function 'setup'                                                                       
        ...me/.local/share/nvim/lazy/papis.nvim/lua/papis/init.lua:89: in function 'start'                                                                       
        ...me/.local/share/nvim/lazy/papis.nvim/lua/papis/init.lua:20: in function <...me/.local/share/nvim/lazy/papis.nvim/lua/papis/init.lua:18>              
        [C]: in function 'setfiletype'                                                                                                                            
        /Users/me/share/nvim/runtime/lua/vim/health.lua:346: in function '_check'                                                                           
        [string "<nvim>"]:1: in main chunk                                                                                                                        
stack traceback:                                                                                                                                                  
        [C]: in function 'setfiletype'                                                                                                                            
        /Users/me/share/nvim/runtime/lua/vim/health.lua:346: in function '_check'                                                                           
        [string "<nvim>"]:1: in main chunk

I noticed it said that I didn't have the parser for yaml installed so I ran :TSInstall yaml. Now, when I run health check for papis it says: Failed to load parser for language 'yaml': uv_dlopen: no error. I have been wrestling with a very similar error with the norg parser (see related issue). Anyhow, I don't think papis.nvim is ever properly loaded since I don't have access to any of the :Papis commands (though I verified that Lazy is loading the package). Maybe my issues stem from a problem with nvim-treesitter, but I'm not sure how to proceed.


Update: I think I finally fixed my treesitter-related issues. I ran arch -arm64 nvim and then I was able to successfully install and compile the parsers for yaml as well as norg (and norg_meta). For some reason, by default, when I run arch I get i386 which seems very strange. Afterwards, I ran :checkhealth papis and I got the following:

ERROR Failed to run healthcheck for "papis" plugin. Exception: vim/loader.lua:0: cannot open /Users/me/.local/share/nvim/lazy/papis.nvim/lua/papis/health.lua: Too many open files

Then, when I try to exit neovim I get:

Error detected while processing ExitPre Autocommands for "*":
Error executing lua callback: .../.local/share/nvim/lazy/sqlite.lua/lua/sqlite/assert.lua:57: sqlite.lua: operation failed, ERRMSG: unable to open database file

Oddly, I also get other too many open files errors from other packages (such as mason) along the lines of:

E886: System error while opening ShaDa file /Users/me/.local/state/nvim/shada/main.shada for writing: too many open files

I tried deleting the main.shada file but the error returns. It appears something is fundamentally amiss with my whole setup.


Update 2: I checked this issue concerning "too many open files" and the proposed fix there helped. I am now successfully running papis.nvim (as well as neorg). Sorry for all of the fuss over something that had nothing to do with papis.nvim, itself.

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

2 participants