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

codelldb still doesn't load from dap... #83

Closed
LittleTealeaf opened this issue Dec 1, 2023 · 11 comments · Fixed by #84
Closed

codelldb still doesn't load from dap... #83

LittleTealeaf opened this issue Dec 1, 2023 · 11 comments · Fixed by #84
Assignees
Labels
bug Something isn't working

Comments

@LittleTealeaf
Copy link

Neovim version (nvim -v)

0.10.0

Operating system/version

Arch Linux x86_64

Output of :checkhealth rustaceanvim

Well now the errors' changed!

==============================================================================
rustaceanvim: require("rustaceanvim.health").check()

- ERROR Failed to run healthcheck for "rustaceanvim" plugin. Exception:
  ...al/share/nvim/lazy/rustaceanvim/lua/rustaceanvim/dap.lua:1: loop or previous error loading module 'rustaceanvim.config.internal'


### How to reproduce the issue

```console
codelldb is installed from both Mason and on the system

Expected behaviour

Should be using mason's codelldb

Actual behaviour

Throws error, causing entire plugin to not load

The minimal config used to reproduce this issue.

default configuration
@LittleTealeaf LittleTealeaf added the bug Something isn't working label Dec 1, 2023
@LittleTealeaf
Copy link
Author

This is after I updated to 643f044

@mrcjkb mrcjkb self-assigned this Dec 1, 2023
@LittleTealeaf
Copy link
Author

working on a local version, I changed the code to be this, and verified that it does return a path

local has_mason, mason_registry = pcall(require, 'mason-registry')
local codelldb_package = has_mason and mason_registry.has_package('codelldb') and mason_registry.get_package('codelldb') or nil
if codelldb_package ~= nil then
    print(codelldb_package:get_install_path())
end

it prints

/home/tealeaf/.local/share/nvim/mason/packages/codelldb

but it still crashes? might be the path configuration

@mrcjkb
Copy link
Owner

mrcjkb commented Dec 1, 2023

It's because of a cyclic dependency between the config.internal and dap modules 😭

@mrcjkb mrcjkb closed this as completed in #84 Dec 1, 2023
@mrcjkb
Copy link
Owner

mrcjkb commented Dec 1, 2023

Sorry for all the hiccups. I don't use mason myself, and assumed the snippets in the mason issues would work.

@theCollectiv
Copy link

theCollectiv commented Dec 1, 2023

Still not working.

Error detected while processing BufReadPost Autocommands for "*":                                                                                             
Error executing lua callback: /usr/share/nvim/runtime/filetype.lua:30: Error executing lua: /usr/share/nvim/runtime/filetype.lua:31: BufReadPost Autocommands 
for "*"..FileType Autocommands for "*"..function <SNR>1_LoadFTPlugin[20]..script /home/censored/.local/share/nvim/site/pack/packer/start/rustaceanvim/ftplugi
n/rust.lua: Vim(runtime):E5113: Error while calling lua chunk: .../start/rustaceanvim/lua/rustaceanvim/config/internal.lua:225: attempt to call field 'get_cod
elldb_adapter' (a nil value)                                                                                                                                  
stack traceback:                                                                                                                                              
        .../start/rustaceanvim/lua/rustaceanvim/config/internal.lua:225: in function 'evaluate'                                                               
        ...ker/start/rustaceanvim/lua/rustaceanvim/config/check.lua:81: in function 'validate'                                                                
        .../start/rustaceanvim/lua/rustaceanvim/config/internal.lua:297: in main chunk                                                                        
        [C]: in function 'require'                                                                                                                            
        ...im/site/pack/packer/start/rustaceanvim/ftplugin/rust.lua:2: in main chunk                                                                          
        [C]: in function 'nvim_cmd'                                                                                                                           
        /usr/share/nvim/runtime/filetype.lua:31: in function </usr/share/nvim/runtime/filetype.lua:30>                                                        
        [C]: in function 'nvim_buf_call'                                                                                                                      
        /usr/share/nvim/runtime/filetype.lua:30: in function </usr/share/nvim/runtime/filetype.lua:10>                                                        
stack traceback:                                                                                                                                              
        [C]: in function 'nvim_cmd'                                                                                                                           
        /usr/share/nvim/runtime/filetype.lua:31: in function </usr/share/nvim/runtime/filetype.lua:30>                                                        
        [C]: in function 'nvim_buf_call'                                                                                                                      
        /usr/share/nvim/runtime/filetype.lua:30: in function </usr/share/nvim/runtime/filetype.lua:10>                                                        
stack traceback:                                                                                                                                              
        [C]: in function 'nvim_buf_call'                                                                                                                      
        /usr/share/nvim/runtime/filetype.lua:30: in function </usr/share/nvim/runtime/filetype.lua:10>     

I'd be glad to help, but I don't have much knowledge about programming plugins in lua, rustaceanvim and mason. So it's more about testing, I can provide.

Maybe it would be better to revert the 'use codelldb by mason' feature for now and just keep it as a note in the readme

But I think the idea (get codelldb 'autointegrated' in rustaceanvim by mason) is worth a future feature (maybe it's not a 1 day quickfix), because it would attract a lot of users by an easy entry / easy nvim debugger config for rust.

@LittleTealeaf
Copy link
Author

Using excessive print statements I think I narrowed it down to this line

result = config.get_codelldb_adapter(codelldb_path, liblldb_path)

@LittleTealeaf
Copy link
Author

==============================================================================

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

- ERROR Failed to run healthcheck for "rustaceanvim" plugin. Exception:
  ...af/dev/rustaceanvim/lua/rustaceanvim/config/internal.lua:225: attempt to call field 'get_codelldb_adapter' (a nil value)
  

@mrcjkb
Copy link
Owner

mrcjkb commented Dec 1, 2023

Yup... It's a typo (╯°□°)╯︵ ┻━┻

I'm tired 😫

@LittleTealeaf
Copy link
Author

a57bcf3 fixed it! YAY!

@mrcjkb
Copy link
Owner

mrcjkb commented Dec 1, 2023

That should not have taken so many iterations 😥
Sorry 😅

@theCollectiv
Copy link

It's working. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants