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

Improve error message when override doesn't exist #820

Closed
est31 opened this issue Nov 18, 2016 · 8 comments
Closed

Improve error message when override doesn't exist #820

est31 opened this issue Nov 18, 2016 · 8 comments

Comments

@est31
Copy link
Member

est31 commented Nov 18, 2016

Try this:

  • rustup override add nightly-2016-11-02
  • downloads specified nightly and sets it as override
  • rustup toolchain remove nightly-2016-11-02
  • removes toolchain
  • rustup show

Gives output:

error: toolchain 'nightly-2016-11-02-x86_64-unknown-linux-gnu' is not installed
info: caused by: not a directory: '~/.multirust/toolchains/nightly-2016-11-02-x86_64-unknown-linux-gnu'

It can be fixed by removing the override but I think that should already happen when you do rustup toolchain remove

@brson
Copy link
Contributor

brson commented Dec 16, 2016

Good find. Thank you.

@brson
Copy link
Contributor

brson commented Dec 16, 2016

Hm, after thinking about this, I'm not sure that removing toolchains should remove overrides. Just because the toolchain doesn't exist doesn't invalidate the need for that toolchain to build a project. For now I'd prefer to just have better error messages here.

@brson
Copy link
Contributor

brson commented Dec 16, 2016

Hm, this error basic error is not horrible, but is obscured by the 'cause', which is irrelevant here. A better error though would indicate that an override requires this toolchain but it is not installed, install it with ... etc.

@est31
Copy link
Member Author

est31 commented Dec 16, 2016

Or one could warn about present overrides when uninstalling.

@brson
Copy link
Contributor

brson commented May 12, 2017

I think I prefer to solve this by simply making a better error message, like:

error: override toolchain 'nightly-2016-11-02-x86_64-unknown-linux-gnu' is not installed

And getting rid of the causal error info: caused by: not a directory: '~/.multirust/toolchains/nightly-2016-11-02-x86_64-unknown-linux-gnu', which is an implementation detail.

It would be even better if rustup suggested how to remove the override, but the current UI doesn't have a way to do that.

@brson brson changed the title When removing toolchain, override is not removed Improve error message when override doesn't exist May 12, 2017
@shiver
Copy link
Contributor

shiver commented May 19, 2017

I took a quick stab at resolving this. The output should look something like this:

$ rustup show
Default host: x86_64-unknown-linux-gnu

error: override toolchain 'nightly-2016-11-02-x86_64-unknown-linux-gnu' is not installed

Hopefully that is what you were after.
Thanks!

bors added a commit that referenced this issue May 21, 2017
#820 Supress confusing NotADirectory error and show override missing

This is my attempt at tackling issue #820.
Hopefully I interpreted the original request correctly and this is what you were looking for.

It is my first time dealing with error_chain, so not 100% sure I did it right.

Any suggestions you might have to improve the submission would be great.
Thanks!
@workingjubilee
Copy link
Member

Can this be closed? @kinnison

@est31
Copy link
Member Author

est31 commented Sep 7, 2020

Indeed, rustup show now re-downloads the nightly instead of showing an error. So I'd say it's resolved now.

@est31 est31 closed this as completed Sep 7, 2020
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

4 participants