Skip to content

Support set auto-self-update mode#2763

Merged
rbtcollins merged 1 commit intorust-lang:masterfrom
0xPoe:rustin-patch-slef-update
May 27, 2021
Merged

Support set auto-self-update mode#2763
rbtcollins merged 1 commit intorust-lang:masterfrom
0xPoe:rustin-patch-slef-update

Conversation

@0xPoe
Copy link
Copy Markdown
Member

@0xPoe 0xPoe commented May 10, 2021

close #2576

  1. The PR supports three different modes of auto self update: enable/disable/check-only.
  • When enabled, commands such as install or update will update rustup itself.
  • When disable, commands such as install or update will not update rustup itself. Only self udpate will update rustup itself.
  • When check-only, commands such as install or update will not update rustup itself but will check for updates. Only self udpate will update rustup itself.
  1. This PR removes a large number of "--no-self-update" args in tests(setup will turn off auto self update by default.)
  2. Add tests for check-only and enable.
  3. add docs

@0xPoe 0xPoe marked this pull request as draft May 10, 2021 06:24
@0xPoe

This comment has been minimized.

@0xPoe 0xPoe force-pushed the rustin-patch-slef-update branch 2 times, most recently from ae19fc2 to f46b487 Compare May 12, 2021 07:50
@0xPoe 0xPoe marked this pull request as ready for review May 12, 2021 07:51
@0xPoe 0xPoe changed the title Support self-update modes Support set auto-self-update modes May 12, 2021
@0xPoe 0xPoe changed the title Support set auto-self-update modes Support set auto-self-update mode May 12, 2021
@0xPoe 0xPoe force-pushed the rustin-patch-slef-update branch from d970923 to 945b625 Compare May 12, 2021 08:30
@0xPoe 0xPoe force-pushed the rustin-patch-slef-update branch from 13a4df1 to 9413cb6 Compare May 12, 2021 10:06
Copy link
Copy Markdown
Contributor

@kinnison kinnison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a number of whitespace changes in this PR. I don't mind them too much, but in future it's best if this kind of reformatting is only done in independent commits/PRs.

I have made a number of wording change suggestions. You do not have to accept them all, but in general I think they're likely to improve matters.

@0xPoe 0xPoe force-pushed the rustin-patch-slef-update branch from e075b80 to d235ade Compare May 12, 2021 11:14
@0xPoe 0xPoe requested review from kinnison and rbtcollins May 12, 2021 11:21
@0xPoe
Copy link
Copy Markdown
Member Author

0xPoe commented May 12, 2021

There are a number of whitespace changes in this PR. I don't mind them too much, but in future it's best if this kind of reformatting is only done in independent commits/PRs.

Got it.

@0xPoe 0xPoe force-pushed the rustin-patch-slef-update branch from d235ade to ec192fe Compare May 12, 2021 11:59
@0xPoe
Copy link
Copy Markdown
Member Author

0xPoe commented May 16, 2021

@kinnison Could you please take another look? All comments addressed. Thanks!

@0xPoe 0xPoe force-pushed the rustin-patch-slef-update branch from ec192fe to fddbc2e Compare May 19, 2021 00:58
@0xPoe
Copy link
Copy Markdown
Member Author

0xPoe commented May 19, 2021

Conflicts have been resolved.

Copy link
Copy Markdown
Contributor

@kinnison kinnison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of doc tweaks and a question which might be "no need" or might lead to a slight code change - otherwise I think this is nearly ready to merge.

@0xPoe 0xPoe force-pushed the rustin-patch-slef-update branch from 338f0bd to 390acde Compare May 23, 2021 10:00
@0xPoe 0xPoe requested a review from kinnison May 23, 2021 10:02
@0xPoe 0xPoe force-pushed the rustin-patch-slef-update branch from 390acde to 11c1d3b Compare May 23, 2021 10:40
@0xPoe
Copy link
Copy Markdown
Member Author

0xPoe commented May 23, 2021

Commits squashed.

@0xPoe 0xPoe force-pushed the rustin-patch-slef-update branch from 11c1d3b to 3670450 Compare May 23, 2021 11:41
Copy link
Copy Markdown
Contributor

@kinnison kinnison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming CI goes green, I think this is okay. @rbtcollins ?

@0xPoe 0xPoe requested a review from rbtcollins May 24, 2021 00:58
@0xPoe 0xPoe requested a review from kinnison May 24, 2021 00:58
@0xPoe 0xPoe force-pushed the rustin-patch-slef-update branch 2 times, most recently from 6f481f2 to a558f65 Compare May 24, 2021 01:10
@0xPoe 0xPoe force-pushed the rustin-patch-slef-update branch 2 times, most recently from d5b8ed7 to 2c7134f Compare May 25, 2021 07:33
@0xPoe 0xPoe requested a review from rbtcollins May 25, 2021 07:34
@0xPoe 0xPoe marked this pull request as draft May 25, 2021 07:52
@0xPoe 0xPoe force-pushed the rustin-patch-slef-update branch 2 times, most recently from 80f9e55 to 31fd3c6 Compare May 25, 2021 08:15
@0xPoe 0xPoe marked this pull request as ready for review May 25, 2021 08:16
Copy link
Copy Markdown
Contributor

@rbtcollins rbtcollins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking quite good

@0xPoe 0xPoe force-pushed the rustin-patch-slef-update branch from 6b46b3d to 8797fa8 Compare May 25, 2021 13:18
@0xPoe 0xPoe requested a review from rbtcollins May 25, 2021 13:19
@0xPoe
Copy link
Copy Markdown
Member Author

0xPoe commented May 25, 2021

@rbtcollins All comments addressed. Thanks for your review!

@0xPoe 0xPoe force-pushed the rustin-patch-slef-update branch from 8797fa8 to 9539557 Compare May 25, 2021 13:41
@0xPoe
Copy link
Copy Markdown
Member Author

0xPoe commented May 26, 2021

@rbtcollins @kinnison Can we merge it? Are there any other issues?

Copy link
Copy Markdown
Contributor

@kinnison kinnison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One tiny suggestion, otherwise I'm good with this. If @rbtcollins is happy then we can merge IMO.

@0xPoe 0xPoe force-pushed the rustin-patch-slef-update branch 2 times, most recently from b74cfea to d85d0be Compare May 27, 2021 13:36
@0xPoe
Copy link
Copy Markdown
Member Author

0xPoe commented May 27, 2021

It seems the docker image is broken.

Copy link
Copy Markdown
Contributor

@rbtcollins rbtcollins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nits - I'll fix these I think

Running `rustup update` also checks for updates to `rustup` itself and automatically
installs the latest version. To manually update `rustup` only,
without updating installed toolchains, type `rustup self update`:
If your `rustup` was build with the `no-self-update` feature, it will not be able to update itself.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be past tense

'was built with'

let arg0 = arg0
.as_ref()
.and_then(|a| a.to_str())
.ok_or(CLIError::NoExeFilePath)?;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have NoExeName : I don't think is different enough to bother with a new error (and as the error is never caught and never repeated, we can just use anyhow!(...)

test: clean up "--no-self-update" args
test: add check-only and enable tests
docs: update docs and add comment
@rbtcollins rbtcollins force-pushed the rustin-patch-slef-update branch from d85d0be to 3670473 Compare May 27, 2021 19:39
@rbtcollins rbtcollins merged commit 494b307 into rust-lang:master May 27, 2021
@0xPoe 0xPoe deleted the rustin-patch-slef-update branch May 27, 2021 23:30
@0xPoe
Copy link
Copy Markdown
Member Author

0xPoe commented May 28, 2021

@rbtcollins @kinnison Thanks again for your review!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants