-
Notifications
You must be signed in to change notification settings - Fork 894
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
installing Rust on Windows without Microsoft C++ Build Tools #3358
Comments
The docs attempt to explain the difference between MSVC and GNU ABI https://rust-lang.github.io/rustup/installation/windows.html The installer also has the option:
|
If you are only compiling pure Rust code then you can use the However, many rust crates pull in C or C++ code, so if you use one of those crates you'll need a valid C/C++ toolchain to build that dependency. Using the One of the downsides to using MinGW is that it links to a very old version of libc due to an... interesting interpretation of the GPL. These licensing issues were resolved when microsoft introduced the UCRT, and I believe you can now opt-into using the UCRT with MinGW, but the rust There are also many ABI differences between the |
I'm still reading this and getting ready to experiment, but a quick note. I see this command in the indicated Window installation section in the rustup documentation: rustup set default-host i686-pc-windows-msvc Update: My bad; I reread that, and I now see it's referring to the 32-bit host. I want to see what the current default host is before I start mucking with things. Being a complete Rust newbie, I try the most logical thing (i.e. the thing that would be most consistent as the complement to the rustup get default-host I expect it to say
Harrumph. However I did find
|
Ah, stable-x86_64-pc-windows-gnu
stable-x86_64-pc-windows-msvc (default) Making progress. So now I think I can do as it says in the docs: rustup set default-host x86_64-pc-windows-gnu It gives no response. So I run So I think maybe I need to add the
Current roadblocks:
I don't want to mess up something, so I'll wait for clarification before trying more commands. |
This could definitely be explained better in the book - and that page you linked to shouldn't be recommending Let me start with the concept of a "triple" - this is something like The two main types of "triple" you will encounter with rustup are a "target triple" and a "host triple".
All the commands under When you install a toolchain or want to specify which toolchain to use, you need to specify what version (eg. stable) along with the host triple. That's why toolchains have names like However, people generally don't want to type all that out every time - so rustup allows you to omit parts of the toolchain name, and rustup will try to fill them in. So when you ask for "stable", rustup recognises that it's a version identifier, and fills in the "host triple" with its best guess at what you want. It will even allow you to omit some parts of the triple and will still fill in the rest, which is why eg. That "guess" for what the host triple should be is the "default host" and If the "default host" has never been specified explicitly, the rustup tries to detect what platform it is running on, and picks the appropriate host automatically. So, eg. if you are running on 64-bit windows, then it will probably pick The implications of all this are:
|
Can I suggest that this is currently the realm of user education, and that https://users.rust-lang.org/ would be a better forum for that? Actionable bugs like 'the docs are wrong or confusing in location XXX' that spin out of such a conversation are certainly welcome, as are new features relevant to rustup such as 'please support this new triple that has the underlying platform behaviour I want'. Rustup as a project doesn't provide any capabilities that are not already implemented in cargo/rustc/system linkers and so on. Rustup's job is to:
The last point is the key one here, because there is a lot of complexity if we get into installing links, system headers for C and C++ libraries and so on. For the most part Rustup doesn't do - and I see no compelling reason for it to start doing - any of that. The one exception, for a few reasons, is the MSVC build tools on Windows. I think we'd be happy to do the same for XCode on Mac, except it is even more restricted than the MSVC build tools on Windows. Mac and Windows combined form 86% of the desktop market; folk using Linux/*BSD/other-things are part of the long tail - where increased competence is required, and where widespread knowledge about the internals is less readily available, but also where - in large part due to the open source culture and driving pressure for efficiency from the volunteer development model - things like linkers and so on are readily available. We get support requests here that show where the experience of getting going on a happy path - something that can build Rust binaries and works for the most part without substantial effort - is hard. Those requests have driven the installation UI we have today. tl;dr: Two points: If there are changes that can be made to rustup to support what you need to do, we're happy to make them, but I'm not aware of any right now. But the default behaviour for Rustup will be centered around developer experience, not software freedom - when a free software stack can be substituted in on Windows without driving up the number of people that cannot build software successfully, and don't understand why, then we should have a discussion about defaults and what the system guides people towards. |
I'm going to close this at this point, as there are no current actions. If something comes up that is relevant here feel free to reopen. |
Problem you are trying to solve
I want to install Rust on Windows without using the Microsoft C++ Build Tools, because I prefer not to install gigabytes of license-restricted software just to be able to compile a Rust program on Windows.
Solution you'd like
I want to install and use Rust normally on Windows without the Microsoft C++ Build Tools.
Notes
Here are some links that discuss this:
I'll stop there because it's the same thing over and over.
lld-link
works. What islld-link
, and what do I need to do to use it? Is it better than the mingw route?The text was updated successfully, but these errors were encountered: