Skip to content

Update on install#2339

Merged
kinnison merged 3 commits intorust-lang:masterfrom
kinnison:update-or-check-on-install
Jun 26, 2020
Merged

Update on install#2339
kinnison merged 3 commits intorust-lang:masterfrom
kinnison:update-or-check-on-install

Conversation

@kinnison
Copy link
Copy Markdown
Contributor

This is a semi-prototype, but in theory ready-for-showtime attempt at resolving #2330

Opinions from @Manishearth and @mcclure are invited.

@Manishearth
Copy link
Copy Markdown
Member

So I think always prompting about this is a mistake, since all users will have to care about this.

We should either:

  • detect that there is an existing install at the beginning, and only then prompt "There is an existing toolchain installed. Update it? Y/n"
  • run rustup check after installation and prompt if necessary

I'd prefer the former UX since then there's only one block of prompts.

@rbtcollins
Copy link
Copy Markdown
Contributor

I've commented on #2330 - I don't think prompting is ever desirable here.

@kinnison kinnison force-pushed the update-or-check-on-install branch from 29ef83e to c6caad9 Compare June 13, 2020 14:26
kinnison added 3 commits June 13, 2020 16:13
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
@kinnison kinnison force-pushed the update-or-check-on-install branch from c6caad9 to b02bc1a Compare June 13, 2020 15:14
@kinnison kinnison changed the title Update or check on install Update on install Jun 17, 2020
@kinnison
Copy link
Copy Markdown
Contributor Author

@Manishearth How do you feel about this prototype?

Copy link
Copy Markdown
Member

@Manishearth Manishearth left a comment

Choose a reason for hiding this comment

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

If i'm reading this right this unconditionally does the equivalent of rustup update <default> on install unless otherwise specified?

Seems good to me!

@kinnison
Copy link
Copy Markdown
Contributor Author

Yep that's the intent. Okay, @rbtcollins how about you? Are you okay with this?

@mcclure
Copy link
Copy Markdown

mcclure commented Jun 18, 2020

I'm sorry, I don't know how to test this. I'm sure y'all know what's right for your project tho.

This said, I don't understand why you're trying so hard to avoid a prompt given when last I ran it, rustup.sh already shows a prompt?

@Manishearth
Copy link
Copy Markdown
Member

@mcclure the initial prototype prompted for every install, even if there wasn't an existing installation to update, which means a lot of people need to go through an unnecessary prompt.

The current prototype never prompts, which is also fine IMO, it's hard to see a use case for not updating an existing install when you are installing rustup (as opposed to updating it)

.use_delimiter(true),
)
.arg(
Arg::with_name("no-update-default-toolchain")
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.

I feel this is a bit verbose. We have --no-self-update; perhaps just --no-update ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I will have a ponder. --no-update feels a little odd but the terseness may be okay. I'll reconsider in the face of the rest of the args, it is a bit long yes.

use std::process::Stdio;
use std::sync::Mutex;

macro_rules! for_host {
Copy link
Copy Markdown
Contributor

@rbtcollins rbtcollins Jun 22, 2020

Choose a reason for hiding this comment

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

I don't really feel that a used-once macro that just forms a function once, used in a single test is really pulling its weight - but if you feel it is going to be used again I'm cool with it being added.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm intending, once this is merged, to file an e-easy e-mentor help-wanted to move those macros into mock/clitools.rs

@kinnison kinnison merged commit 6d6e137 into rust-lang:master Jun 26, 2020
@kinnison kinnison deleted the update-or-check-on-install branch June 26, 2020 10:57
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.

4 participants