Closed Puncia closed 1 year ago
@Puncia thank you for reporting this. this comes up when cargo.exe is not in path.
please can you tell me the following?
where.exe cargo.exe
-> what do you see?c:\users\pnc\.cargo\bin
?also while you are at it, can you close VS and restart again?
It looks like cargo.exe
is not found from cmd.exe
, but works instead using powershell. After some further investigation I found out that my PATH is over 2047 characters long, which apparently causes problems.. As a workaround I manually edited this registry entry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PATH
which allowed me to override the character limit and put c:\users\pnc\.cargo\bin
manually, but that's beyond the scope of this issue I guess.
I've been always using powershell lately so thank you for bringing up cmd.exe
as well. I am now able to run the extension and debug Rust projects without issues. Thanks.
also while you are at it, can you close VS and restart again?
Side note, but when the error message is displayed, either clicking OK or closing the window visual studio restarts again and, if we were previously inside a Rust project, the error would automatically show again because it opens the project after restart, making visual studio restart again after closing the error and so on creating a loop where it's only possible to exit using ALT+F4 on visual studio.
i'll push in a fix to first search in the $env:USERPROFILE\.cargo\bin
and then fall back to a path search.
also let me know how you'd prefer to have the side note issue fixed? thing is if i do not block the user, they will proceed to have a really confusing experience where some things work and others don't.
i'll push in a fix to first search in the
$env:USERPROFILE\.cargo\bin
and then fall back to a path search.
Sounds good!
also let me know how you'd prefer to have the side note issue fixed? thing is if i do not block the user, they will proceed to have a really confusing experience where some things work and others don't.
I'm not sure, because as per this message only by pressing OK the instructions will open, but in reality also closing the window does it, and that would be a way to avoid the "loop". But it will also create problems for inexperienced users or for those that do not pay exact attention to the message.
Perhaps show the message every time it's opportune (when opening a rust project or viewing the settings), but also offer a way out without restarting, notifying the user their config will be broken up until visual studio will be restarted again.
looking in $env:USERPROFILE.cargo\bin for cargo.exe first.
I am getting this message whenever I open a project initialized with
cargo init
or when I go toTools -> Options -> rust-analyzer.vs
. I uninstalled and installed multiple times Rust using rustup-init.exe from the official website, and I am able to runcargo
correctly from the command line, initialize new projects and access the local docs. All files are present in the home directory:Is there any log files I can check from the extension? I'm not sure what is going on.