fannheyward / coc-rust-analyzer

rust-analyzer extension for coc.nvim
MIT License
1.13k stars 40 forks source link

"Failed to run build scripts of some packages, check the logs" #1097

Closed MathieuDuponchelle closed 1 year ago

MathieuDuponchelle commented 1 year ago

Hey, thanks for the great plugin, it usually works very well for me but recently I am seeing this error message, and no longer seeing diagnostics (though I do still get completions).

Note that this only happens when analysing a complex project (https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/), I don't get that with an hello world project. I expect some dependency is causing an issue, but I don't see anything in the logs, I suppose my main issue here is that I would like to know where I am supposed to find "the" logs :)

What's the output of :CocInfo

## versions                                                                                                                    

vim version: VIM - Vi IMproved 9.0 9001054                                                                                     
node version: v16.18.1                                                                                                         
coc.nvim version: 0.0.82-b11a93ba 2022-12-25 15:19:13 +0800                                                                    
coc.nvim directory: /home/meh/.vim/plugged/coc.nvim                                                                            
term: dumb                                                                                                                     
platform: linux                                                                                                                

## Log of coc.nvim                                                                                                             

2023-01-05T15:56:55.649 INFO (pid:385546) [plugin] - coc.nvim initialized with node: v16.18.1 after 220                        
2023-01-05T15:56:55.651 INFO (pid:385546) [services] - LanguageClient Rust Analyzer Language Server state change: stopped => starting                                                                                                                         
2023-01-05T15:56:55.661 INFO (pid:385546) [language-client-index] - Language server "rust-analyzer" started with 385560        
2023-01-05T15:56:55.681 INFO (pid:385546) [services] - LanguageClient Rust Analyzer Language Server state change: starting => running       
2023-01-05T15:56:55.721 INFO (pid:385546) [services] - service rust-analyzer started

What's the output of :CocCommand rust-analyzer.serverVersion

[coc.nvim] rust-analyzer 0.3.1348-standalone

What's your coc-rust-analyzer version? You can get it from :CocList extensions

  * coc-rust-analyzer 0.71.1 ~/.config/coc/extensions/node_modules/coc-rust-analyzer                                                                                                                                                                          
  + coc-svelte 0.4.2 ~/.config/coc/extensions/node_modules/coc-svelte
  + coc-clangd 0.27.0 ~/.config/coc/extensions/node_modules/coc-clangd
fannheyward commented 1 year ago

Set "rust-analyzer.trace.server": "messages" in your coc-settings.json and try :CocCommand workspace.showOutput rust-analyzer.

Looks like this error logs came from rust-analyzer.

MathieuDuponchelle commented 1 year ago

Great thanks, trying. How could we make this info more discoverable? A dedicated "How to access the rust-analyzer logs" section in the README perhaps?

fannheyward commented 1 year ago

The trace logs contain requests and responses from language client, here's coc.nvim, to rust-analyzer https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#logTrace.

I don't know whether the logs contain Failed to run build scripts of some packages or not, because this log isn't log between client and server, but server issue logs. Maybe you can't find this in the trace logs...

MathieuDuponchelle commented 1 year ago

I did find the issue in the logs, let me paste a gist for reference :)

MathieuDuponchelle commented 1 year ago

https://gist.github.com/MathieuDuponchelle/e2d7ddc48a6a665cf192bb422d6604c5 , this is really quite surprising though because I've always had that csound issue on my machine when building the whole workspace, and that hasn't prevented diagnostics up until now (or triggered a "pop-up" in my editor either).

fannheyward commented 1 year ago

Sorry for the delay response. Checked the err logs and rust-analyzer failed to work on this. Can you test with VSCode + rust-analyzer with your project?

MathieuDuponchelle commented 1 year ago

sure

fannheyward commented 1 year ago

Does VSCode+rust-analyzer work or same error?

MathieuDuponchelle commented 1 year ago

@fannheyward I just installed VSCode and installed the rust-analyzer extension, but it doesn't seem to be doing much for what it's worth, I'm not familiar with this editor at all so I don't really know where to start debugging this, feels like I'm now going to have two problems :P

MathieuDuponchelle commented 1 year ago

Ah, I was in something called "restricted mode"

MathieuDuponchelle commented 1 year ago

Yes, I'm seeing the exact same behavior in vscode, including the "failed to run build scripts" pop-up.

fannheyward commented 1 year ago

the exact same behavior in vscode

Can confirm this is rust-analyzer's issue.

MathieuDuponchelle commented 1 year ago

Yes, I will log the issue there, thanks @fannheyward , you can close this if you want but I would perhaps recommend requalifying the issue to a request for making the procedure to access rust-analyzer logs more discoverable in the documentation :)