-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
rust-analyser hangs at "Fetching", and uses CPU at 100% #16614
Comments
Another workaround is to use the pre-release version 0.4.1851 |
For me pre-release version 0.4.1851 and version 0.3.1850 show the same behavior. v0.3.1839 is working correctly. |
This seems to be non-deterministic ... |
Also affected. Fetching eventually finishes, but it easily takes half an hour. Afterwards it is responsive until I run a build on the command line (which, after rust-analyzer ran requires rebuilding half the application starting from proc_macro2, even if there were no changes). Reverting back to 0.3.1839 fixed the issue for me as well. |
Actually it |
For the time being you can disable |
#16616 should fix this I believe, I pushed out a new nightly release if some of you could check with the |
v0.4.1852 is still hanging for me :c |
Same here, downgraded to 0.3.1839 |
Mine was also fetching for about 10 minutes, deleting some of the compiled project and seemed to have a hard time determining types, reverting to 0.3.1839 also fixed mine. |
same here. both in stable v0.3.1850 and in v0.4.1853 (pre-release). |
Same for me in Linux. Both v0.3.1850 in vscode and v20240219 for helix I encountered similar problem. Another issure: when the analyzer found |
The problem for me got fixed after changing |
In general it seems that the issue can be sidestepped by first building the project via a manual cargo invocation before loading up rust-analyzer. I'll try looking into this more by the end of the week. |
@Veykril That is not exactly what was happening to me, that's how I used to do it before the problem arose, I would build because otherwise the indexing will take much longer. As of right now After running And If I open the project again now, rust-analyzer does what it did again and rebuild + invalidate my manual cargo build. Even if I close my editor and re-open again without running There were various steps I took to try and address this problem, including setting analyzerTargetDir to true. In the end, as of right now, I'm not exactly sure what fixed the issue for me. Nightly seems not to be the fix, when I switched back to stable I found that the problem has come back, but switching back to nightly didn't fix it this time. Apparently I could get rid of the problem by disabling opt builds and the dynamic_linking but only on nightly rustc, stable still has the issue even with those disabled. |
Build invalidation is a different problem than the one described here. I am having problems reproducing this issue again right now (been trying to bisect it with no luck) |
I'm running into this issue. My fix is to uninstall rust-analyzer in VS Code, and reinstall. It'll work fine into the next time I open the editor. |
Hi. For me it still stuck after uninstalling and reinstalling version
(similar to #16605) |
I finally solved my problem by updating my toolchain ( |
Updating the toolchain helps? 🤨 now that would be very confusing to me. |
Just ran into it again earlier, from the looks of it it seems that the server deadlocks somewhere |
Alright it can easily be reproduced by just editing a proc-macro in the loaded workspace, captured a backtrace of the running lsp-server
|
Looks like 11 and 2 are locking each other up?
Hmm no that doesn't seem right, 11 is in a spinlock 0.4.1843 seems to be good, 0.4.1849 shows the issue, commit range b9b0d29...68c506f |
Ah nevermind it is the two threads I think I found the problem |
Full rebuild (Fetching...) on each save ("rust-analyzer.checkOnSave": true). Extension version: v0.4.1856 (pre-release) Using Bevy 0.13 crate in project. Rust-analyser extension 0.3.1839 works fine. Am I do something wrong, or problem is still not solved? |
I'm also still having the issue where it hangs at I am getting completions however, but no diagnostics for my code. I don't exactly know the release cycle of nightly and stable yet, so there just might be something that I'm missing here. |
@LucaSchwan I'm not sure how you installed rust-analyzer, but the deadlock corresponding to this issue has been resolved and released. If you installed rust-analyzer through rustup, it seems like the last sync was four days ago: rust-lang/rust#122272. |
@davidbarsky I am on NixOS and I'm using fenix with a flake to install the nightly toolchain. |
I'm also running into the |
rust-analyzer version: 0.3.1850 (latest at time of writing)
rustc version: rustc 1.78.0-nightly (3246e7951 2024-02-19)
System specs:
Windows 10
Processor 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz 2.30 GHz
Installed RAM 16,0 GB (15,8 GB usable)
System type 64-bit operating system, x64-based processor
relevant settings:
Project is a bevy project setup as in this link
https://bevyengine.org/learn/quick-start/getting-started/setup/
(I am using VSCode)Like in the title, rust-analyser hangs at "Fetching" when starting the project, if I click on show logs it doesn't show anything, but it keeps using the CPU with multiple rustc processes at 100%. I tried cleaning up the cache, reinstalling rust, messing with num thread and cache priming settings, but nothing worked.
The only thing that worked to make it usable was to revert to v0.3.1839, and now everything works fine. I will stay on that for now until it gets fixed :)
The text was updated successfully, but these errors were encountered: