Skip to content
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

Fix 'show' when active toolchain is not installed #1178

Closed
brson opened this issue Jun 23, 2017 · 3 comments
Closed

Fix 'show' when active toolchain is not installed #1178

brson opened this issue Jun 23, 2017 · 3 comments

Comments

@brson
Copy link
Contributor

brson commented Jun 23, 2017

Here's what happens when you run 'show' with a toolchain that is not installed:

brian@DESKTOP-CODN6ST MINGW64 /c/Users/brian/Documents/dev/rustup.rs
$ rustup override set beta
info: using existing install for 'beta-x86_64-pc-windows-msvc'
info: override toolchain for 'C:\Users\brian\Documents\dev\rustup.rs' set to 'beta-x86_64-pc-windows-msvc'

  beta-x86_64-pc-windows-msvc unchanged - rustc 1.19.0-beta.1 (a87984118 2017-06-06)


brian@DESKTOP-CODN6ST MINGW64 /c/Users/brian/Documents/dev/rustup.rs
$ rustup toolchain remove beta
info: uninstalling toolchain 'beta-x86_64-pc-windows-msvc'
info: toolchain 'beta-x86_64-pc-windows-msvc' uninstalled

brian@DESKTOP-CODN6ST MINGW64 /c/Users/brian/Documents/dev/rustup.rs
$ rustup show
Default host: x86_64-pc-windows-msvc

error: override toolchain 'beta-x86_64-pc-windows-msvc' is not installed

Instead of displaying various information about installed toolchains it immediately errors.

It should instead do something like:

brian@DESKTOP-CODN6ST MINGW64 /c/Users/brian/Documents/dev/rustup.rs
$ rustup override remove
info: override toolchain for 'C:\Users\brian\Documents\dev\rustup.rs' removed

brian@DESKTOP-CODN6ST MINGW64 /c/Users/brian/Documents/dev/rustup.rs
$ rustup show
Default host: x86_64-pc-windows-msvc

installed toolchains
--------------------

stable-x86_64-pc-windows-msvc
nightly-x86_64-pc-windows-msvc (default)

active toolchain
----------------

beta-x86_64-pc-windows-msvc (override set by blah blah blah)
(error: override toolchain 'beta-x86_64-pc-windows-msvc' is not installed)

Fix will be in rustup_cli::rustup_mode::show. Instead of returning the error, print it into the show output.

@brson
Copy link
Contributor Author

brson commented Jun 23, 2017

Fix up test cases in tests/cli-rustup.rs

@mati865
Copy link
Contributor

mati865 commented Jun 26, 2017

Here is thrown the error: Error(OverrideToolchainNotInstalled("beta-x86_64-unknown-linux-gnu"), State { next_error: Some(Error(Msg("the directory override for \'/home/mateusz/Projects/testing\' specifies an uninstalled toolchain"), State { next_error: None, backtrace: None })), backtrace: None }).

I don't know how to extract required data from it but it someone wants to fix it this tip may help.

@michaelfletchercgy
Copy link
Contributor

I managed to get about 50% done this yesterday evening. I will be able to finish it over the next five days if nobody needs it sooner.

michaelfletchercgy added a commit to michaelfletchercgy/rustup.rs that referenced this issue Jul 1, 2017
michaelfletchercgy added a commit to michaelfletchercgy/rustup.rs that referenced this issue Aug 11, 2017
bors added a commit that referenced this issue Aug 12, 2017
…ed, r=alexcrichton

Fix 'show' so it displays helpful information if the active toolchain is not installed.

Fixed 'show' so that it displays helpful information if the active toolchain is not installed.

```
$ export RUSTUP_TOOLCHAIN=beta
$ rustup show
Default host: x86_64-unknown-linux-gnu
installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu

active toolchain
----------------

(error: override toolchain 'beta' is not installed, the RUSTUP_TOOLCHAIN environment variable specifies an uninstalled toolchain)
```

Fixes #1178
mattico pushed a commit to mattico/rustup.rs that referenced this issue Apr 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants