-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Windows build instructions are inconsistent #16654
Comments
Here are the steps I follow on Windows. Feel free to use what I say here in the windows build instructions.
|
There are three (popular) ways to get build system:
I think msys2/pacman is the easiest option for Rust developers. mingw is not recommended now, but Note-getting-started-developing-Rust is not updated. |
We may also have to maintain FAQ about this topic:
|
(Note: I was the ungrateful bastard who complained on Reddit.) Edit: I realise there are various pages on contributing to Rust. I haven't gone through these yet; I just wanted to make sure I put a note in this issue that I'm working on some changes to the docs to avoid anyone duplicating the effort. I've cloned the wiki and modified the information there to be unified and consistent. I'm not sure what to pull on or whatever the process is. If preferred, I can just copy+paste the changes into the wiki directly (it looks like I can edit it). I did want to check in this issue first. Currently, the changes redirect people visiting both "Building Rust before 0.8 on Windows Systems" and "How to install an unofficial nightly for Windows" to the current pages. I removed the instructions on using Chocolatey, on the basis that there are official nightly builds. I intend to see if there is still a way to do this, and will update accordingly. The "Using Rust on Windows" page now explains the distinction between MinGW, MinGW-w64, MSYS, MSYS2 and Cygwin, why they are needed, what combinations are possible and how to make this all work. The bolded recommendation on the page is "MSYS2 with MinGW-w64", with separate instructions on installing MinGW-w64 outside of MSYS2. There are also up-to-date instructions on installing and using MinGW and MSYS, since until I tried to compile Rust itself, I wasn't aware there was a problem. I will check the other official docs as well. Should I put a note in |
Updated Note getting started developing Rust, since it is directly linked by README.md and it can be primary source of confusion. @DanielKeep could you upload your work on gist or somewhere? I'd like to see the improvements! |
@klutzy I've made a gist out of the changes so far. I've also noted that the Rust guide doesn't mention Rust's dependence on MinGW at all. Nor does the download page about it, or the installer. Not sure whether something should be done about that, or how. I've removed the instructions for installing through Chocolatey since there's now a Rust package in the default repository based on actual releases (if someone is using a package manager, presumably they have the wherewithal to check and see if a package is there), and the "nightly" package hasn't been updated in a while. Finally, I noticed a few minor things in the guide that could be improved on Windows. I know that's in the main source repository, so I'll do a pull request for those separately. Edit: incidentally, the only change to the "Building pre-0.8 Rust" page was to include a link to more recent instructions. |
It's important not to refer to MinGW-w64 as mingw or MinGW, they are entirely different projects by different sets of developers. The same goes for MSYS and MSYS2: http://stackoverflow.com/questions/25019057/how-are-msys-msys2-and-msysgit-related-to-each-other |
I've just found msys2's mingw-w64-{i386,x86_64}-toolchain is configured as "Thread model: posix". This was known to affect performance (#13501) so we should investigate if it is possible to avoid, or just recommend mingw-builds package instead of pacman... |
We will try to build a new MSYS2/MinGW-w64 llvm/clang 3.5 package without POSIX threads in the next few days (i.e. as soon as 3.5 is out). |
FWIW, I use msys2 + "win32" mingw64 from mingw-builds. |
Well, winpthread may be an issue, seems no one's entirely sure if it's avoidable (and if so, can it be avoided when using --std=c++11, my guess is no). Maybe speeding up the winpthread mutexes is the best course of action; I guess at some point llvm/clang itself may start wanting to "#include " and at that time our hands will be forced. |
@mingwandroid I tried to be clear about the difference in the changes I made. I might have used "MinGW" to refer collectively to MinGW and MinGW-w64 in a few places; would "MinGW_" and "MSYS_" as collective terms be reasonable? :) @klutzy Any comments on my version of the "Using Rust on Windows" page? I don't know if it's too overbearing, or whether there are any procedures for making changes to the Wiki's contents (can you even pull request a GitHub wiki?) |
@DanielKeep, the wiki guide is horribly out-of date. I think we should dump it all, and start afresh with instructions in readme.md. I also think we should stop supporting msys/mingw and only support msys2/mingw-w64 going forward. According to @brson, this is what build bots run. |
Actually, this page looks fine, but all that stuff about pre-0.8 Rust needs to go. |
Actually...I'm not sure if I should note this here, file a bug, or update the file as I'm suggesting...it depends I guess on if you are moving away from the wiki system or not. I'm kinda just trying to note it somewhere so it gets fixed eventually. Here in Makefile.in, there are 2 links and the 1st doesn't exist. I think these pop up if you do |
@DanielKeep : I'd actually rather we have a complete disassociation between the old mingw/msys and the new ones to be honest with you. If you can, just explicitly call them MSYS2/MinGW-w64, anything else muddies the waters for no gain, cf: http://www.reddit.com/r/rust/comments/2e62f6/compiling_rust_on_windows_aka_why_does_this_have/ |
I'm in the process of adding a mingw-w64-rust-git PKGBUILD to MSYS2/MinGW-w64 at present: https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-rust-git .. but I'm getting an error with the following (command line snagged via "PATH=/mingw64/bin:$PATH MSYSTEM=MINGW64 make VERBOSE=1"):
Anyone got any ideas about this? Should I open a bug report? |
From googling around, this seems to be related: https://mail.mozilla.org/pipermail/rust-dev/2013-November/006314.html |
@mingwandroid The message means LLVM doesn't support segmented stack on your target (x86_64-w64-mingw32 if configure is correct). |
@DanielKeep as @vadimcn said, I also think MinGW should not be present in the guide. I think guide should recommend only one way (which is msys2 now). |
Can anyone who uses Windows a lot comment on the state of this today? |
I use Rust on Windows so much that I haven't read any documentation on how to build Rust on Windows in a while. However I do use MSYS2 like the README states, although I use x86_64 instead of i686. I'm not happy with using MSYS2, but it does work, mostly. |
@retep998 can you elaborate on the unhappiness with MSYS2? What can we do better? |
@mingwandroid For example, Rust not detecting mintty as a console and thus not coloring output. Many MSYS2 utilities being broken or being unable to copy with Windows paths. I have to use an external Git because MSYS2's Git refuses to work with Windows paths, and the guis for Git refuse to open. Even putting aside faults with MSYS2, I don't like Rust's reliance on what is effectively shoving a posix world into Windows. |
Triage:
|
MSYS2 still provides posix-threaded gcc. Currently |
(Or if there's no performance issue it would be fine? It only affects if you link to libstdc++.) |
These should help out with the in-tree parts of rust-lang#16654
This contains a whole ton of stuff that I think is all addressed today. If there are more things we should update with regards to Windows build instructions, please open new issues with specifics, thank you. |
…, r=lnicola Add short flag -V for consistency with other rust tooling Minor change to add the `-V` short flag to `rust-analyzer` to bring it in-line with other rust tooling such as: > rustc -V ```bash rustc 1.76.0 (07dca48 2024-02-04) ``` > rustup -V ```bash rustup 1.26.0 (5af9b9484 2023-04-05) info: This is the version for the rustup toolchain manager, not the rustc compiler. info: The currently active `rustc` version is `rustc 1.76.0 (07dca48 2024-02-04)` ``` > cargo -V ```bash cargo 1.76.0 (c84b36747 2024-01-18) ```
There are multiple instructions for building on Windows, and they are not in agreement, as described here: http://www.reddit.com/r/rust/comments/2e62f6/compiling_rust_on_windows_aka_why_does_this_have/
The text was updated successfully, but these errors were encountered: