rust-lang / vscode-rust

Rust extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=rust-lang.rust
Other
1.39k stars 167 forks source link

Can't detect components: Command failed (toolchain stable error) #933

Closed SamMatzko closed 2 years ago

SamMatzko commented 2 years ago

I have the Rust extension installed. When I start VSCode, I get two errors, one as explained in another issue.

The other error shows up at the same time:

Can't detect components: Command failed: rustup
component list --toolchain stable error:
  toolchain 'stable-x86_64-unknown-linux-gnu' does not support components

Here is the message in the OUTPUT window:

[Error - 1:53:56 PM] Starting client failed
Error: Command failed: rustup component list --toolchain stable
error: toolchain 'stable-x86_64-unknown-linux-gnu' does not support components

    at ChildProcess.exithandler (child_process.js:317:12)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1048:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)

The odd thing is, when I first installed it (that is, on the first day), it worked perfectly. What's making it not work now, and how can I fix it? I've already tried the solutions in the linked issue above, but they didn't work.

SamMatzko commented 2 years ago

Okay, it turns out that somehow Rust got uninstalled from my system. I'll re-install it as soon as I can, and let you all know how it goes after that.

lnicola commented 2 years ago

@SamMatzko you might want to give https://marketplace.visualstudio.com/items?itemName=matklad.rust-analyzer a try.

SamMatzko commented 2 years ago

@lnicola Thanks! I've discovered the problem; the Rust extension requires Rust to be installed to function, and Rust got uninstalled when I fixed my filesystem this morning. I'll close this issue, as it doesn't really have to do with something that's wrong with the Rust extension, but thanks for the help!

lnicola commented 2 years ago

That's fair and I'm glad you managed to solve it, but I still suggest trying rust-analyzer. See the thread linked above.

SamMatzko commented 2 years ago

@lnicola Yes, I'll definitely use it, but it'll be a while before I can get back to coding in Rust anyway, because it'll probably be a while before my admin can re-install Rust for me. I'm digging through some backups now to see if I can get it back myself, but in the meantime my Rust-coding will be suspended. Thanks again, I'll let you know if I need help with anything rust-analyzer-related ;-), and happy coding!

lnicola commented 2 years ago

You can install it using rustup.rs. You don't (in the technical sense) need admin access for it.

SamMatzko commented 2 years ago

@lnicola Well, I tried downloading and unzipping the latest Rust release from GitHub and installing it (using x.py), but it requires curl to install. For some reason, curl isn't on my system either, so I have to figure out how to install that too (or I can have my admin do it). If curl was on my system, it Rust would have installed properly.

What exactly is rustup.rs? I didn't try that, but I don't know what it is. Could you provide a link?

lnicola commented 2 years ago

https://rustup.rs

If you don't have cURL, you can try wget or a browser.

x.py is something else, don't try to install it like that.

SamMatzko commented 2 years ago

@lnicola My admin just installed curl. Unfortunately, I'm now having the trouble as stated in issue #85024. According to the README.md in the Rust repo, I'm supposed to use x.py for Unix-like systems (my system is an Ubuntu). Just explaining why I used x.py.

I'll try other installation methods as soon as I can...

SamMatzko commented 2 years ago

@lnicola Yay! I used curl to install rustup, and then used rustup to install Rust. I guess because of my previous attempts at installation, something currently installed was messing everything up. I ran the override subcommand for rustup, and it installed perfectly.

rust-analyzer works well, by the way. Thanks for your patience!

lnicola commented 2 years ago

Just so you're aware of it, x.py is used to build Rust from source. That can take about an hour or so, uses some 10s GB of disk space and you only need to do it if you want to contribute to the compiler. Otherwise, you should use rustup.

The issue you had with x.py is caused by GitHub not including submodules in the release archives. That's a GitHub feature and not something the Rust developers can control.

SamMatzko commented 2 years ago

Ah... I wasn't aware of the memory or time usage (10 GB; that's a lot!). I guess it's good I couldn't build it from source, because doing so would have been a lot more trouble.

Also, from reading the issue, I knew that it had to do with GitHub, not the developers (especially as the issue spanned at least two releases of Rust), so I'm not blaming any Rustaceans there.

Plus, vscode-rust gets a star for being so awesome!