-
Notifications
You must be signed in to change notification settings - Fork 1k
fix(toolchain): forbid toolchain names starting with +
#4650
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
Conversation
67167b9 to
cf4154e
Compare
djc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense to me, thanks!
cf4154e to
18def8d
Compare
|
@djc Just confirming, currently it's far from common but we do allow toolchain names with the If that is the case, then it's possible that we need to raise this error later in the pipeline, only when a toolchain with the said name is not found?
|
|
From what I'm seeing |
@djc Sorry for not being clear enough previously, but what I wanted to say is about the edge case of a toolchain name starting with I know this sounds crazy and should be banned in #4059, but IIRC for now such names are still valid 😓 > rustup run +foo cargo
error: toolchain '+foo' is not installed
> rustup ++foo show
Default host: aarch64-apple-darwin
[...]
error: toolchain '+foo' is not installed... totally coherent 😱 |
|
Ahh. Let's not worry about it and/or ban it now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@djc Yeah, why not? I'd expect this breakage will be relatively small and nearly no one will actually notice it.
@cachebag How about just banning all toolchain names starting with + right now?
Instead of the current changes, put the general part in the fn validate(candidate: &str) -> Result<&str, InvalidName>; function (that's where common rules are defined), and put the hint specific to #4571 in and just suggest using the toolchain name without that prefix, without being specific to rustup runrustup run.
df9b381 to
8dbf0c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks! I'm okay with this as long as the name of the commit and the PR is changed to reflect the latest changes, say forbid toolchain names starting with `+`.
@djc What do you think?
Does this also steer from the original issue at hand? |
+
|
Hmmm the original error message was confusing but made sense exactly because Also, given the current error message, it should be easy to deduce that a toolchain name is expected as the positional argument here, rather than the Besides, I think this is also an opportunity for us to test out what toolchain names are actually used so at least we'd have some expectation of what can be broken. Finally, this could allow smarter guesses to happen, since we are sure that the
|
When users accidentally use '+stable' with 'rustup run', we now provide a message instructing them to remove the '+' prefix.
8dbf0c3 to
7525e07
Compare
|
As I already said, this looks good to me as long as @djc feels the same. However we could potentially use more prudence in merging yet another breaking change between beta and stable... I'd currently prefer playing the safe card and postpone this to the upcoming 2.0 👀 |
I mean, do you have a concrete plan for 2.0? When will that be released? I still think the version number is not going to make much difference in how much testing/caution people exercise before/when upgrading. |
@djc Thank you for this constructive question. I'm sorry but I'm not sure if we are on the same page here; I think my stance with breaking changes will not change significantly whether the next non-patch release will be Of course, in terms of actual impact this should be considered a minor breakage, so I'm also okay with merging this patch immediately, as long as enough attention has been drawn. Your call! |
|
Given the amount of response on internals I have no reason to feel the beta has resulted in a substantial amount of testing. Maybe we should do a post to the Inside Rust blog? |
@djc Yes, that's a good idea! I'll take care of it. Besides, after giving this PR another look, I think I'm probably worrying too much again over a small change that can be easily reverted in the next patch release. My apologies! |
Users accidentally use
+stablewithrustup run; in this PR we now forbid toolchain names starting with+globally.closes #4571