-
Notifications
You must be signed in to change notification settings - Fork 904
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 should suggest Windows 11 SDK while installing on Windows 11 #2912
Comments
Is that what rustc needs?
|
I'd be willing to have the recommendation URL change based on the OS you're installing on. If installing on win 10 recommend the win 10 SDK, if on win 11, recommend the win11 one but also mention the win10 one if you are developing for older systems. There's no point in us making it harder for people coming to Rust to develop apps which will work in a wider area. |
https://www.reddit.com/r/rust/comments/r6vkge/when_will_rust_support_windows_11_sdk/ seems to be the genesis of this discussion. Its not clear to me that rustc actually uses the windows 10 or 11 SDK at all: the windows crates involved are https://github.com/microsoft/windows-rs or https://github.com/retep998/winapi-rs. The latter is hand-crafted, no dependency on the SDK. The former is also independent of the SDK as far as I can tell - its a projection of metadata from the https://github.com/microsoft/win32metadata project. So I really do mean 'Is that what rustc needs?'. If this request is coming from folk confused about what is needed, great, lets fix that. If its coming from rustc having some need for a different SDK when targeting windows programs, then great lets fix that. |
I think I possibly misunderstood - this is likely referring to https://github.com/rust-lang/rustup/blob/master/doc/src/installation/windows.md?plain=1#L15 which mentions ensuring you install the Windows 10 SDK, which is likely to ensure there's a C runtime etc. Not sure how to improve this without introducing confusion. |
Just mention Windows 10 SDK or newer. It should suffice. |
The Windows SDK is required for every msvc application that uses the standard library. It includes import libraries for core system functions (e.g. from kernel32 et al). In the future this may be made optional (see raw_dylib) but that isn't the case at the moment. For most stuff it doesn't particularly matter which version you use so long as it has the symbols the standard library needs. Although it may matter if you make use of any utilities. etc that come with the SDK (though these aren't used by Rust itself) or want to use newer symbols (and don't want to use the |
Ok so concretely if I read this right:
So I think rustup should say something a little closer to this than it does today: something like thoughts? |
Hm, the problem is that wording isn't particularly actionable. Whereas "Windows 10 SDK" directly describes something that can be selected in the installer. I'd prefer to have a clear and concise answer to "what should I do next?". For reference, here's a screenshot of the current Visual Studio installer (this is the build tools installer, but other installers aren't too different): |
Just thinking outside the box a bit, but an alternative might be for rustup to offer to download the installer and pre-select the correct components. So all the user has to do is accept the license and click through to install. |
Here's what I got from Microsoft: https://learn.microsoft.com/en-us/answers/questions/511294/do-we-need-to-choose-specific-windows-10-sdk-or-al |
It would be nice if this were addressed for newcomers (like me) who have the exact same questions installing Rust. Do I need the Windows 10 SDK, the Windows 11 SDK, or is an SDK even needed? And here's another question: can I select the "Individual Components" tab and reduce the required components even further? I don't want to be installing additional Microsoft cruft if I don't need to if I just want to program Rust. |
@garretwilson you don't need to install any Microsoft components if you instead install mingw and use the gnu toolchain on Windows. If you consider Microsoft developer tools cruft, you might prefer that approach. I think from the perspective of the rustup team, our job is to get Rust installed as simply as possible, and since using the GNU toolchain on windows is not the common path, we don't default to that. (In particular there have been performance implications in the past). If someone wants to work on making the current instructions better, or increasing the level of automation, by all means go ahead. However, note that the current instructions are a good compromise between being super narrow but fragile as MS change their developer tools installation UI, and large but installing many unrelated things. |
Objectively speaking, if the minimal Microsoft-related install is like 8GB (if I remember correctly—it's several gigabytes at least), just to be able to compile a program written in Rust, then I will bet you a beer that there is cruft somewhere in there. 😉 Plus I'm restricted by the Microsoft license in what I can do. One can quibble and say, "oh, but you can develop open-source software" or whatever, but why should I go have to read some lawyer's small print and install gigabytes and gigabytes of stuff on my machine just to be able to print "hello world" using Rust on one of the most popular computer platforms on the planet? I'm just giving you a perspective on why I said "cruft".
Awesome!! How do I do that? Tell me how, and I'll immediately uninstall this Microsoft license-restricted bloat. (I actually searched for how to do that first, but I could only find a few comments from years ago in forums about what might work.)
My Rust level isn't enough to add anything to the installer yet, but I can write instructions! I'm not a mingw expert. Please point me to the tools I need, I'll try it out, and then be happy to contribute to the docs. |
So as not to get this ticket side-tracked and off-topic, I've opened #3358 for further discussion. |
Problem you are trying to solve
On Windows 11, it suggests installing Windows 10 SDK instead of Windows 11 SDK. Latest SDK improvements and security improvements need to be supported.
Solution you'd like
Suggest latest supported Windows SDK instead of a specific version
Notes
No response
The text was updated successfully, but these errors were encountered: