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

rust and rustup should be msvc by default #931

Closed
Livven opened this issue Mar 26, 2020 · 6 comments · Fixed by #4224
Closed

rust and rustup should be msvc by default #931

Livven opened this issue Mar 26, 2020 · 6 comments · Fixed by #4224

Comments

@Livven
Copy link
Contributor

Livven commented Mar 26, 2020

The official Rust download page links to the MSVC version. This is what how most users will be installing it so scoop should match that.

There is also a good reason for that default. See the official explanation (emphasis mine):

At the release of Rust 1.0, we only supported the GNU toolchain on Windows. With the release of Rust 1.2, we introduced initial support for the MSVC toolchain. After that, as support matured, we eventually made it the default choice for Windows users.

The difference between the two matters for interacting with C. If you're using a library built with one toolchain or another, you need to match that with the appropriate Rust toolchain. If you're not sure, go with MSVC; it's the default for good reason.

Therefore rust should install the MSVC version and there should be a separate rust-gnu. Right now it is the other way around, presumably for historical reasons. To preserve backwards compatibility, maybe start by adding rust-gnu and slowly move towards deprecating rust. The same applies to rustup.

Thoughts?

@stale
Copy link

stale bot commented Oct 27, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 27, 2021
@HUMORCE HUMORCE added the help-wanted Extra attention is needed label Oct 28, 2021
@stale stale bot removed the stale label Oct 28, 2021
@rashil2000
Copy link
Member

This will be a breaking change for a lot of users. I don't think it's worth it.

@rashil2000 rashil2000 removed the help-wanted Extra attention is needed label Nov 8, 2021
@comp500
Copy link
Contributor

comp500 commented Nov 19, 2022

If the --default-host $host_arch-pc-windows-gnu argument is removed from the rustup install command, I think any existing install of rustup will use the host value in persist/rustup/.rustup/settings.toml previously set by this command - so existing installs will still use the GNU default.

I think there should at least be a warning in the rustup/rust package since the GNU toolchain is much more likely to cause linking problems with C/C++ code. It would probably also make sense to use the MSVC rustup build even for GNU toolchains; https://rust-lang.github.io/rustup/installation/other.html recommends you set the aforementioned --default-host flag instead of using the GCC build of rustup (see also: rust-lang/rustup#2976 (comment) rust-lang/rustup#1851 (comment))

@rashil2000
Copy link
Member

rashil2000 commented Dec 9, 2022

I've revisited this thread, and I think we should switch the rust/rustup manifest to be MSVC by default.

@comp500 thanks for the detailed info. Could you make a PR for the change? We can just keep one rustup and do whatever it does by default.

@comp500
Copy link
Contributor

comp500 commented Dec 13, 2022

Should I add a rust-gnu manifest as well?

@rashil2000
Copy link
Member

Yes

comp500 added a commit to comp500/Main that referenced this issue Dec 13, 2022
Changes rust and rustup packages to use MSVC toolchain by default, as
this is generally the better supported (and default) choice.
In the rustup package, the MSVC version is always used (the GCC build
of rustup provides no benefits, and the MSVC version can be used to
install MSVC toolchains). The --default-host flag has been removed, so
new installs will use the rustup default (MSVC) but existing installs
will have a configuration file indicating GCC is the default; a note was
added to the rustup packages stating how to change this.
The rust-gnu package was added, to allow using the GCC toolchain without
rustup, and a note was added to all rust packages indicating that rustup
can be used to more easily manage multiple toolchains (and is the
primary install method; see
https://forge.rust-lang.org/infra/other-installation-methods.html).

Closes ScoopInstaller#931.
comp500 added a commit to comp500/Main that referenced this issue Jan 15, 2023
Changes rust and rustup packages to use MSVC toolchain by default, as
this is generally the better supported (and default) choice.
In the rustup package, the MSVC version is always used (the GCC build
of rustup provides no benefits, and the MSVC version can be used to
install MSVC toolchains). The --default-host flag has been removed, so
new installs will use the rustup default (MSVC) but existing installs
will have a configuration file indicating GCC is the default; a note was
added to the rustup packages stating how to change this.
The rust-gnu package was added, to allow using the GCC toolchain without
rustup, and a note was added to all rust packages indicating that rustup
can be used to more easily manage multiple toolchains (and is the
primary install method; see
https://forge.rust-lang.org/infra/other-installation-methods.html).

Closes ScoopInstaller#931.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@comp500 @Livven @HUMORCE @rashil2000 and others