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

Setting to only check for a self-update during rustup update #2576

Closed
Nemo157 opened this issue Nov 26, 2020 · 12 comments · Fixed by #2763
Closed

Setting to only check for a self-update during rustup update #2576

Nemo157 opened this issue Nov 26, 2020 · 12 comments · Fixed by #2763

Comments

@Nemo157
Copy link
Member

Nemo157 commented Nov 26, 2020

Describe the problem you are trying to solve
When testing the staging rustup release I had it "upgrade" back to the previous version when I ran rustup update nightly. This made me reconsider somehow aliasing in rustup update to include --no-self-update so that I could control when rustup itself updates.

Describe the solution you'd like
Something like rustup set update-self-update check-only that will check whether a self-update is available and report it, rather than installing it straight away.

Notes

@Nemo157
Copy link
Member Author

Nemo157 commented Nov 26, 2020

(I just noticed that rustup toolchain install also does a self-update, so update-self-update is probably a bad setting name, not sure what it could be called).

@kinnison
Copy link
Contributor

kinnison commented Dec 3, 2020

Such a setting could be very useful, it'd be nice to clean up a bunch of --no-self-update in our test suite for example. While not trivial, it shouldn't be too hard to add the setting and pipe it through to the requisite places in the CLI through our Cfg object.

@Rustin170506
Copy link
Member

@kinnison Can I working on this?

@kinnison
Copy link
Contributor

Sure you're welcome to work on it. Do you want to start by reading through how settings are passed around in the Cfg code, and then write a comment here with how you suggest you'll fix this?

@Rustin170506
Copy link
Member

Sure you're welcome to work on it. Do you want to start by reading through how settings are passed around in the Cfg code, and then write a comment here with how you suggest you'll fix this?

I will write my thoughts here after I read the code and go back to the code after you give your comments.

@Rustin170506
Copy link
Member

Sorry for the late reply.

I have read the code and I think the problem can be solved in a few steps.

  1. We need to add a self-update related setting item in Settings.
  2. We need to set the value in Cfg with the set subcommand support.
  3. Since the configuration can be read in Cfg, we can get the value from the cli (similar to get_default_host_triple) and check for it in the self-update mod and use it.

Do you think there is any problem?
Are there any other suggestions about this configuration item and its value name? @kinnison

@Rustin170506
Copy link
Member

@kinnison ping~

@kinnison
Copy link
Contributor

Sorry for the delay, I had a very busy work week.

I think your proposed approach is on-track. I'd suggest a setting name along the lines of auto-self-update with permitted values enabled (default if missing), disabled (does nothing unless manually running rustup self update), and check-only (which does a check for new versions to report when otherwise it would do an automatic self update).

@Nemo157 Would that solve your use-case?

@Nemo157
Copy link
Member Author

Nemo157 commented Feb 20, 2021

Yep, that seems about what I was thinking.

@Rustin170506
Copy link
Member

Rustin170506 commented May 9, 2021

Sorry, I forgot about this. I will take the time to add that feature recently.
cc: @jonhoo

@jonhoo
Copy link
Contributor

jonhoo commented May 9, 2021

@hi-rustin That would be amazing!

@Rustin170506
Copy link
Member

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants