Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Toolchain is reportedly not installed, even though it very much is #89

Closed
ljedrz opened this issue Jul 2, 2018 · 8 comments
Closed

Comments

@ljedrz
Copy link

ljedrz commented Jul 2, 2018

I'm getting errors pointing to a missing rustup installation while I'm very certain it is available and present in PATH:

Uncaught (in promise) Error: failed to start server: Error: Command failed: rustup run stable-x86_64-pc-windows-gnu rustc --version
error: toolchain 'stable-x86_64-pc-windows-gnu' is not installed

    at RustLanguageClient.startServerProcess (C:\Users\user\.atom\packages\ide-rust\lib\index.js:622)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

Running rustup run stable-x86_64-pc-windows-gnu rustc --version in cmd works nicely and returns rustc 1.27.0 (3eda71b00 2018-06-19). rustup component list --toolchain stable confirms that the required components are there:

cargo-x86_64-pc-windows-gnu (default)
rls-preview-x86_64-pc-windows-gnu (installed)
rust-analysis-x86_64-pc-windows-gnu (installed)
rust-docs-x86_64-pc-windows-gnu (default)
rust-mingw-x86_64-pc-windows-gnu (default)
rust-src (installed)
rust-std-x86_64-pc-windows-gnu (default)
rustc-x86_64-pc-windows-gnu (default)

I've also tried to make it work with nightly-x86_64-pc-windows-gnu (that I also have along with RLS), but it only changed the flavor of the error to:

Error: Command failed: rustup run nightly-x86_64-pc-windows-gnu rustc --version
error: toolchain 'nightly-x86_64-pc-windows-gnu' is not installed

Debug mode doesn't show any more errors.

@alexheretic
Copy link
Member

ide-rust uses the path that the atom process is supplied with & also adds ~/.cargo/bin if it isn't already there.

You could have a different environment setup launching atom & executing on the cli. On windows env var changes sometimes only take effect after logging-out & in again, so that's worth a try if you've changed env vars in your current session.

It sort of looks like you have 2 different rustup installs, that ide-rust's rls could think a toolchain wasn't installed that the cli does. Is that possible?

It might be worth me adding PATH info to the error logging to help debug these kind of issues.

@ljedrz
Copy link
Author

ljedrz commented Jul 2, 2018

Hmm, I don't think I've installed rustup more than once. My user environment variables (these are not present in the system variables) are:

HOME: C:\Local\poligon
CARGO_HOME: C:\Local\poligon\.cargo
RUSTUP_HOME: C:\Local\poligon\.rustup
Path: C:\Local\poligon\.cargo\bin;C:\Users\user\AppData\Local\atom\bin

I haven't tried relogging yet, I'll do it when I can.

@ljedrz
Copy link
Author

ljedrz commented Jul 2, 2018

Unfortunately relogging didn't help; any other options/debugging I can try?

@alexheretic
Copy link
Member

alexheretic commented Jul 2, 2018

Well I guess you can look at the env vars supplied to atom by typing into the console:

process.env

Maybe theres a difference from when you run set in your cli?

@ljedrz
Copy link
Author

ljedrz commented Jul 2, 2018

I ran process.env in the console and Path contains C:\Local\poligon\.cargo\bin;C:\Users\user\AppData\Local\atom\bin, so this shouldn't be an issue. Or maybe it should be in all caps, i.e. PATH?

@alexheretic
Copy link
Member

The case should be fine I have Path too in windows without issue.

I actually may have an idea, I remember having some issues in windows when not passing the full env with the commands. ide-rust does that now, but I just noticed only for starting rls rather than the earlier rustup checks that are failing for you.

I will add it in both places and make a release.

@alexheretic
Copy link
Member

Ok I've made the 0.18 release as I was meaning to anyway. Let me know if it the change helps.

@ljedrz
Copy link
Author

ljedrz commented Jul 2, 2018

That did the trick; thanks!

@ljedrz ljedrz closed this as completed Jul 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants