Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Allow installing alongside existing Rust (with warning) #2214
Allow installing alongside existing Rust (with warning) #2214
Changes from all commits
703b405
62f32f7
680b2ed
5bc1c8c
76164d2
8095f81
ac5105f
1e0a497
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Errata: this is not ignorable if the location of the existing rust is in the CARGO_BIN directory that rustup's proxies will be written to. We're making this easier to run into, so perhaps we should check for that at this point.
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.
@rbtcollins Should it be possible to skip it in any way (e.g. environment variable) or not?
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.
Currently the code will give a warning later about "tool X is already installed", and not touch those binaries. This would mean that rustup isn't actually installed. I don't think it makes sense to allow that to be bypassed, but would like @kinnison 's input. This might be something to do as a separate PR for instance.
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.
The cases this PR covers are to do with
rustc
on thePATH
or about detecting an old-stylerustup.sh
install as I understand the change. If it happens that it's inCARGO_BIN
then the user is going to get warnings as you say, and if they ignore those then they get to keep all the pieces. I don't think we can stop all the footguns -- this is simply a way to allow another footgun for someone who really can't installrustup
otherwise due to immutable underlying layers.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.
The concern I have is that this is escalating it from a read-the-docs situation to a y/n prompt, so perhaps a lot easier to perform targeted foot removal.
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.
Possibly so. I shall check the feel of that in my testing which I'm about to undertake.
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.
Okay so the issue here is that if the
rustc/cargo
is in$CARGO_BIN
then the only real pain is thatrustup
will replace them with proxies without prompting. The only tools you get the warnings about arerustfmt
andcargo-fmt
because those used to be provided viacargo install
rather than always being proxied viarustup
. I think that the footgun is permissible in this case because it's exceedingly unlikely that the user will have set up this kind of thing without also being aware of whatrustup-init
will end up doing