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

Make `rustup default x86_64-unknown-linux-gnu` do something smarter. #411

Closed
brson opened this issue May 7, 2016 · 3 comments

Comments

@brson
Copy link
Contributor

commented May 7, 2016

That is, naming a toolchain by just the target triple might do something useful. I've seen others type the wrong thing and I've done it myself. Especially since rustup target takes bare target triples it's easy to confuse the two.

At the least, the default and update commands should use a heuristic to detect this and offer a suggestion.

That's probably the best way to start. With default if we see something that looks like a bare target, then, if the default toolchain is from a release channel, instead print an explanation and say 'did you mean nightly-$triple.

If the update command, then see if there's only one installed toolchain that we can take the channel name from and say 'did you mean nightly-$tirple`.

In both cases if we can't make a guess about what they meant, but it does look like a target triple, we must fall back to a generic error about toolchain specs vs target triples.

@brson brson added the help wanted label May 7, 2016
@brson brson changed the title Make `rustup default x86_64-unknown-linux-gnu` work Make `rustup default x86_64-unknown-linux-gnu` do something smarter. May 7, 2016
@moosingin3space

This comment has been minimized.

Copy link

commented Jun 2, 2016

I'll bite. Assuming there is only one x86_64-unknown-linux-gnu toolchain available, rustup default x86_64-unknown-linux-gnu should select that one. In the case of multiple toolchains, should the user then be prompted to choose the correct one?

@brson

This comment has been minimized.

Copy link
Contributor Author

commented Jun 7, 2016

@moosingin3space I'd prefer that rustup not make the selection automatically, but report an error with the correct toolchain. Likewise for multiple toolchains, print them all (up to some limit perhaps). Unfortunately, @inejge already has a PR up.

@brson

This comment has been minimized.

Copy link
Contributor Author

commented Jun 23, 2016

Done.

@brson brson closed this Jun 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.