-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Running rust-analyzer 0.3.2667 on a fresh Windows installation fails, because VCRUNTIME140.DLL is missing on that system and doesn't come with a default Windows installation.
This error and the solution of installing the missing Visual C++ Redistributable is hard to grasp for the average user, because rust-analyzer fails silently. You need to open the OUTPUT tab in VS Code, jump to "rust-analyzer Language Server" and translate the error stating:
Server process exited with error code 3221225781.
I see two viable solutions here:
-
Auto-install the missing Visual C++ Runtime package. I remember a time when every Windows installer detected the presence of that package and auto-installed it if missing. Is that also possible when installing VS Code extensions?
-
Build the rust-analyzer server binary with a static CRT. This may marginally increase the size of the binary, but entirely removes the DLL dependency. Adding the Rust flag
-Ctarget-feature=+crt-staticshould be sufficient to achieve that.
CC @Veykril