Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign up'default' and 'update' heuristics for bare triples #516
Conversation
This comment has been minimized.
This comment has been minimized.
|
Thanks @inejge! I see that your logic is not quite the same as what I suggested on the issue. From my reading, for both the 'default' and 'update' cases this considers all installed toolchains with a matching triple to be candidates (with the exception of discarding the existing default for 'rustup default'). I think the logic is right for the 'update' case but needs to be different for 'default': the main reason I expect people to typo this when running 'rustup default' is because they are switching their host platform. So e.g. I start off on I'm also not sure I want to automatically use the channel name, nor prompt for it, though I can see why one might, and I can see why that's consistent with other areas of rustup that try to just 'do the right thing', notably the command synonyms. I've previously imagined printing out an error suggestion but forcing the user to type it correctly. Have to think about it some. |
This comment has been minimized.
This comment has been minimized.
Oh, I see -- I misunderstood the example in the original comment on the issue. I'll change the logic for 'default' accordingly, just let me know whether you think that rustup should prompt for a toolchain name or error out. |
This comment has been minimized.
This comment has been minimized.
|
Here's a version of the patch which implements the 'default' logic as it should have in the first place, and terminates with an error in all cases. The triple provided to the subcommand doesn't have to be complete, i.e., it should be possible to enter something like |
inejge
force-pushed the
inejge:dflt-heur
branch
from
5fd5bec
to
f423559
Jun 9, 2016
brson
merged commit c7fc118
into
rust-lang:master
Jun 17, 2016
This comment has been minimized.
This comment has been minimized.
|
Thanks @inejge! I'm so sorry I've been slow to respond to this. |
inejge commentedJun 5, 2016
•
edited
[For issue #411]
[Whoops, I started working on this before @moosingin3space left his/her comment. Here goes anyway, sorry if it led to wasted effort.]
This patch lets you use any recognizable target triple with default or update. The code will scan all installed toolchains matching the given (partial) triple and offer the user to choose one, or, if there is just one found, to confirm its use. If the command is default, the current default toolchain is not included in the list of candidates. The user must choose or confirm the inferred choice; there is no automatic operation. An empty list of candidates is an error. So is not choosing/confirming an offer.