-
Notifications
You must be signed in to change notification settings - Fork 884
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 on Windows installs incorrect architecture of Rust by default #176
Comments
Thanks for the report. Did you expect it to install x86_64-pc-windows-msvc instead of i686-pc-windows-msvc? You can install that toolchain anyway with You got the i686 MSVC toolchain because the way rustup infers parts of the target spec is based off the target of the running exe (which is i686-pc-windows-gnu). We could possibly change the inference to use the architecture of the host platform instead, but I'm not sure that's better - it's long been my impression that 32-bit development is still a safe 'default' for Windows. So what you are seeing is intended behavior, but it's definitely debatable. |
One of the features I've wanted for a while is for the default host target to be configurable, which would help avoid this problem. |
I did expect to install Here's where my expectation comes from: My profile executes I see where you're coming from with 32-bit being the default - that's still relatively safe for many Windows users. I don't know what the right answer is here. |
Actually, I do think we should provide both 32 and 64-bit binaries from www.rustup.rs |
@Diggsey do you mean a default set up/install path so that people like me who default to 64-bit MSVC would get a 64-bit MSVC Rust by default? |
@peschkaj The idea is that instead of the host target being hard-coded at compile time (it's currently based off the rust cfg variables) it would be configurable. |
Interesting, so we could detect that you are running in a VC console and automatically pick the 'right' toolchain. |
@brson - absolutely! The It could be confusing if someone were using the VC console for "X64 X86 Cross Build Tools", but even in that case you'll have:
But, yeah, back to your original point - it's totally possible to target the current running environment. Worst case, the user is running in a basic CMD or PowerShell window and then they get whatever the "base" version of Rust is. At that point, 32-bit GCC Rust makes sense. |
I have almost similar question about toolchain resolving: why the default environment is gnu?
|
@pravic: From a conversation on IRC (I think with @steveklabnik), it's historical. In that same conversation, it was mentioned that the "Install Rust" link might default to MSVC at some point in the future, but these are idle conversations that in no way reflect the future of Rust and I am just an innocent bystander with limited powers. These days, MSVC++ is completely free for open source developers, and the community edition of Visual Studio works just as well, too. |
Is there a way to hack rustup to change target resolving priority? |
@pravic You can download rustup for other targets from here: https://github.com/rust-lang-nursery/multirust-rs#other-installation-methods |
@Diggsey thanks! It seems, I reinstalled it from rustup.rs with gnu abi:
|
Adding to this: I installed rustup from my previous multirust install, and I was surprised when it unexpectedly installed i686-gnu instead of x86_64-msvc by default when I simply tried to install "stable" with no additional target info. Unless I'm remembering improperly, my previous usage of multirust it would use msvc by default (or I configured it to do so or something, I don't remember). It's probably best to default to msvc on windows...and probably 64-bit on 64-bit machine, though that's a little less crucial other than 32-bit msvc hasn't been considered stabilized yet. |
This will be fixed by #421 |
Host architecture is configurable at install time now. |
Using Windows 10 Professional, 64-bit with MSVC installed,
Platform
set to "X64", andPROCESSOR_ARCHITECTURE
set to "AMD64".Currently, running
rustup default stable-msvc
(or even specifying an override) without specifying the architecture installsi686-pc-windows-msvc
which is incompatible with 64-bit MSVC binaries.Steps to repro:
The text was updated successfully, but these errors were encountered: