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

rustup set default-host does not change the default toolchain #3651

Open
jyn514 opened this issue Jan 27, 2024 · 2 comments
Open

rustup set default-host does not change the default toolchain #3651

jyn514 opened this issue Jan 27, 2024 · 2 comments
Milestone

Comments

@jyn514
Copy link
Member

jyn514 commented Jan 27, 2024

Problem you are trying to solve

i have a stable-x86_64-pc-windows-gnu toolchain as my default:

PS C:\Users\jyn\src\example> rustup default
stable-x86_64-pc-windows-gnu (default)

i want it to be -msvc instead so i can use windbg (i don't have gdb installed). i ran rustup set default-host x86_64-pc-windows-msvc, which succeeded, but did not install any toolchains or change the default:

PS C:\Users\jyn\src\example> rustup show
Default host: x86_64-pc-windows-msvc
rustup home:  C:\Users\jyn\.rustup

installed toolchains
--------------------

stable-x86_64-pc-windows-gnu (default)
nightly-x86_64-pc-windows-gnu
stage1

active toolchain
----------------

stable-x86_64-pc-windows-gnu (default)
rustc 1.75.0 (82e1608df 2023-12-21)

then i tried rustup update stable, which did install the -msvc toolchain, but did not change the default:

info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
...
PS C:\Users\jyn\src\example> rustup default
stable-x86_64-pc-windows-gnu (default)

Solution you'd like

rustup set default-host foo should behave the same as rustup set default-host foo && rustup default $channel-foo, where $channel is the channel of the current default toolchain.

ideally, rustup would give a warning if the default toolchain did not match the default host (e.g. rustup default nightly-x86_64-pc-windows-gnu with a default-host of msvc).

Notes

rustup 1.26.0 (5af9b94 2023-04-05)

@rami3l rami3l added this to the 1.28.0 milestone Mar 13, 2024
@rami3l
Copy link
Member

rami3l commented Jul 7, 2024

Following the long-term goal of eliminating implicit installation (#3635), I think the best thing to do here is to add a warning.

@jyn514
Copy link
Member Author

jyn514 commented Jul 7, 2024

@rami3l i still think this suggestion from the description is the best approach:

rustup set default-host foo should behave the same as rustup set default-host foo && rustup default $channel-foo, where $channel is the channel of the current default toolchain.

if rustup default nightly for a non-installed toolchain warns instead of installing, that's fine. but i do not think rustup should leave the default toolchain so that it doesn't match the default host.

@rami3l rami3l modified the milestones: 1.28.0, 1.29.0 Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
@jyn514 @rami3l and others