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

Auto-install toolchains more consistently #2252

Merged
merged 1 commit into from
Mar 5, 2020

Conversation

rbtcollins
Copy link
Contributor

This combines all auto-installation logic to the root of the codepaths
leading to running a binary, which should lead to auto-installation
happening for all cases, as long as a toolchain has been selected.

Config.find_default no longer verifies the toolchain in order to permit
this auto-installation to take place in one location; the callers of
find_default do not generally need verified toolchains, so this should
be fine.

Copy link
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.

Looks generally good. Let's see how the CI feels.

src/config.rs Show resolved Hide resolved
@rbtcollins rbtcollins force-pushed the more-auto-installs branch 4 times, most recently from c0a8e03 to c579abe Compare March 5, 2020 08:14
Copy link
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.

If you think the names of the test functions are okay as-is, then you're good to merge, otherwise rename them and then merge :D

Comment on lines -165 to +172
expect_err(
expect_stderr_ok(
config,
&["rustc"],
for_host!("toolchain 'nightly-{0}' is not installed"),
&["rustc", "--version"],
"info: installing component",
Copy link
Contributor

Choose a reason for hiding this comment

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

With this change, I feel the function name for the test isn't brilliant. If you can't be bothered to fix it I don't mind, otherwise it'd be nice if it were renamed something like remove_default_toolchain_auto_reinstalls or somesuch

Copy link
Contributor Author

Choose a reason for hiding this comment

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

remove_default_toolchain_autoinstalls is what my fingers put put :P. I noticed after doing it that the very next test, for overridden toolchains, had the same naming bug, but ce la vie.

Comment on lines -252 to +259
expect_err(
expect_stderr_ok(
config,
&["rustc"],
for_host!("toolchain 'nightly-{0}' is not installed"),
&["rustc", "--version"],
"info: installing component",
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment here.

This combines all auto-installation logic to the root of the codepaths
leading to running a binary, which should lead to auto-installation
happening for all cases, as long as a toolchain has been selected.

Config.find_default no longer verifies the toolchain in order to permit
this auto-installation to take place in one location; the callers of
find_default do not generally need verified toolchains, so this should
be fine.
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.

2 participants