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

feat(cli)!: remove implicit toolchain installation #3985

Merged
merged 10 commits into from
Aug 9, 2024

Conversation

rami3l
Copy link
Member

@rami3l rami3l commented Aug 8, 2024

Closes #3943.

As a follow-up of #3983, this PR makes rustup toolchain install (or rustup install) the only way to ensure the installation of the active toolchain (apart from installing it manually).

When the active toolchain needs to be installed, the existing error messages now come to our rescue:

cx.config
.expect_ok(&["rustup", "override", "add", "beta"])
.await;
cx.config
.expect_ok(&["rustup", "toolchain", "remove", "beta"])
.await;
cx.config
.expect_err_ex(
&["rustc", "--version"],
"",
for_host!(
r"error: toolchain 'beta-{0}' is not installed
help: run `rustup toolchain install beta-{0}` to install it
"
),
)
.await;

This PR also makes it possible to merge find_or_install_active_toolchain() and find_active_toolchain() by reducing the number of call sites of the former.

Given the current state of this PR, the CI will certainly fail, since even the test suite also relies on implicit installation. Fixup commits has been added accordingly, which will of course be squashed onto the original commit respectively before actually merging this PR.

src/toolchain.rs Outdated Show resolved Hide resolved
@rami3l rami3l marked this pull request as ready for review August 8, 2024 13:32
Copy link
Contributor

@djc djc left a comment

Choose a reason for hiding this comment

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

This is looking great!

tests/suite/cli_rustup.rs Show resolved Hide resolved
src/config.rs Show resolved Hide resolved
src/config.rs Show resolved Hide resolved
@djc
Copy link
Contributor

djc commented Aug 9, 2024

I think after this lands we should probably do a release!

@rami3l
Copy link
Member Author

rami3l commented Aug 9, 2024

I think after this lands we should probably do a release!

@djc There are 20-ish items remaining in the milestone: https://github.com/rust-lang/rustup/milestone/8. I invite you to check them out and let's decide which ones are here to stay and which ones will be left for v1.28.1, or even v1.29.0.

I'm even for having a very long beta cycle for this one: there are just so many changes and I'm afraid of breaking anything by accident: I just don't have that much bandwidth, plus I have to do the legwork around cutting a new release.


Update: I've created a new milestone for v1.28.1 and have moved some not-so-urgent items there: https://github.com/rust-lang/rustup/milestone/13

Also, please remember we can add new stuff even in the beta stage, as long as they are minor enough (doc changes, new warnings, etc). We've done this with v1.27.0 as well.

@rami3l rami3l enabled auto-merge August 9, 2024 10:03
@rami3l rami3l added this pull request to the merge queue Aug 9, 2024
Merged via the queue into rust-lang:master with commit c94ef35 Aug 9, 2024
27 checks passed
@rami3l rami3l deleted the feat/no-implicit-install branch August 9, 2024 10:39
@djc djc mentioned this pull request Aug 19, 2024
@rukai
Copy link

rukai commented Sep 10, 2024

Hi, does this PR mean that if I have a rust-toolchain.toml set to a specific release, rustup will no longer automatically install that release, instead a manual command must be run before that toolchain is available?

If so this is going to break CI for many projects who rely on a pinned nightly or pinned stable + fail on warnings.

@rami3l
Copy link
Member Author

rami3l commented Sep 10, 2024

Hi, does this PR mean that if I have a rust-toolchain.toml set to a specific release, rustup will no longer automatically install that release, instead a manual command must be run before that toolchain is available?

If so this is going to break CI for many projects who rely on a pinned nightly or pinned stable + fail on warnings.

Yes, you've understood it correctly, and this breakage is intentional: #3635 (comment)

Before the actual release, we'll definitely clearly communicate this change with the community, and we'll use the beta phase to collect user feedback.

@ickk
Copy link

ickk commented Sep 10, 2024

I am looking forward to this change, so thanks for working on it

re: breakage

Might I suggest adding the new behaviour (#3983), and then waiting a release or two before completely removing the implicit installs? My concern is having a path with some continuity; rustup toolchain install on <= 1.27.1 is an error, but after >= 1.28 it will be an error not to do so, leaving no grace period.

If there is need - perhaps some tool that is blocked waiting on the new behaviour - during the transitional period an extra flag could be added to opt-out of implicit installs, at the risk of some complexity.

@rami3l
Copy link
Member Author

rami3l commented Sep 12, 2024

We currently propose #3635 (comment) as a migration path. If you have any concerns/suggestions/comments, let's continue the discussion over there.

@rami3l rami3l mentioned this pull request Oct 6, 2024
3 tasks
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.

rustc --version should not trigger/initiate toolchain updates
4 participants