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

Open
est31 opened this Issue Nov 18, 2016 · 6 comments

Comments

3 participants
@est31
Copy link

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

This comment has been minimized.

Copy link
Contributor

brson commented Dec 16, 2016

Good find. Thank you.

@brson

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Author

est31 commented Dec 16, 2016

Or one could warn about present overrides when uninstalling.

@brson brson added the enhancement label Dec 16, 2016

@Diggsey Diggsey added this to Error messages & documentation in Issue Categorisation May 3, 2017

@brson

This comment has been minimized.

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

This comment has been minimized.

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

Auto merge of #1128 - shiver:issue-820, r=Diggsey
#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!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.