-
Notifications
You must be signed in to change notification settings - Fork 951
install: add --profile flag to override profile #2075
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
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.
Thank you for tackling this issue. There are a few small problems (such as not implementing the command actually asked for in the issue -- rustup toolchain install --profile...
) and a big problem which is that I'm not comfortable with the big Clone
change on Cfg
and temp::Cfg
I'd rather see this implemented by passing through an Optiondist::Profile to the installation method functions. I appreciate this results in collateral None
arguments in a bunch of places, but over-all I think it's more in keeping with the current codebase. Perhaps in the future we'll have some more live data held in Cfg
(I was considering it for another PR but now I feel iffy about that)
I'm open to being convinced I should stop worrying about Cfg in that way, at which point I'd rather update()
took &mut Cfg
rather than all that Clone
mess though, but in the meantime I knocked up a diff for the pass-argument approach on my fork if you wanted to take a look at that approach.
The branch mentioned in the review is at: https://github.com/kinnison/rustup.rs/tree/kinnison/profile-on-install |
Yup, as you saw in the stream I was really unsure which approach would be better. I think it'd be handy to have a distinction between "active config" and "on-disk config", but agree that this PR is probably not the place to make that change. Would be happy to use your branch instead of mine -- they both fix the issue. My only comment on your version is that it's weird for |
I think there may be a happy medium to be had here. I'm not entirely comfortable with the clone and would rather just have an override profile option which we can set via a method taking If you then moved the test into I'd rather we amended your PR than replaced it with my hacked up change (the inconsistency in argument position is in part due to me hacking on it while also watching what you did) since I do think having the precedent set now might help with some work I want to do with Ben Chen. |
Sure thing! Here's a variant with all comments addressed, where we keep |
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 over-all delta looks much better now. A few more comments and if you agree with them and make the change, you may as well rebase into a nicer set of commits ready for merge.
I am slightly confused as to how the test case failing in your CI runs is failing given your change though. |
I worked it out and thanks to you permitting commits from maintainers, I've pushed a fix to your branch. If you're okay with it, and it passes the tests, and you resolve the other comments, then fold it into your commits, no need to try and credit me. |
☔ The latest upstream changes (presumably #2074) made this pull request unmergeable. Please resolve the merge conflicts. |
Previously, the profile to use when installing a new toolchain had to be set globally through `rustup set profile`, or at rustup-init time. Sometimes this is inconvenient, because you only want to use a particular profile when installing a specific toolchain. This patch allows users to pass `--profile` to `rustup install` to override the profile used for that one install. Fixes rust-lang#2004.
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.
LGTM 👍
Once the CI completes, I'll merge.
Previously, the profile to use when installing a new toolchain had to be
set globally through
rustup set profile
, or at rustup-init time.However, sometimes this is inconvenient, because you only want to use a
particular profile for a specific toolchain. This patch allows users to
pass
--profile
torustup install
to override the profile used forthat one install.
Fixes #2004.