I've never contributed directly to the overall Rust project before. I am however quite interested in getting the "windows-gnu" target back to actually "feeling" like a first-class target. How can I help?

For context: Windows has always been my primary OS, however I've dual-booted it in conjunction with various Linuxes for years as I've always strived to make anything I write as cross-platform as I possibly can.

"OS Wars" or the various related forms of zealotry that often pop up in relation to it are entirely uninteresting to me. I simply don't care. Not about licenses (except as as far as following them correctly as needed), or about won't-happen-in-our-lifetime big-picture idealism WRT "free software", or anything else. All that concerns me is making useful software available to as many people as possible. Who they are is completely irrelevant as far as I'm concerned.

That said, though I'm primarily a Windows user, I've always used MSYS2 as my main "base of operations" for dev work as I simply find it more convenient due to the very high immediate level of access to various libraries it provides, and also because historically I've always found that GCC simply optimizes better than MSVC does, in general.

For a long time that's all there was to it: Clang / LLVM never quite built properly in that context (as they, IMO mistakenly, put all of their focus into the MSVC-based target for quite a while) however, in the past few months it's finally become the case that you can check out the entire LLVM github repo on Windows, build it using the MSYS2-provided GCC (currently 9.2) and from then on out have a complete Clang / LLVM toolchain (even supporting LLD in full now with nothing more than -fuse-ld=lld) that generally speaking is significantly easier to develop software with in any context where you're putting a high priority on cross-platform compatibility.

How does this relate to Rust? Well, you can in fact build Rust just as easily as the Rust github claims you can with MSYS2 (which tends to be much faster and easier than doing so with MSVC, I'll note!) Even better than that though (much better, in fact) is doing so with the MSYS2-built Clang / LLVM setup I previously described, which gives you by far the fastest copy of rustc you're ever gonna get on Windows, and one that of course gets to live in a context far more compatible with the rather heavily-Unix-oriented Rust ecosystem than anything possible with an MSVC-based setup.

(Don't even get me started on how much I dislike when people attempt to literally build C libraries with their build.rs files, BTW. We'll be here forever. The TLDR is that ~5% of all the people doing it appear to have the qualified knowledge. Everyone else, not so much... Maybe I'll make a "Rust 2020: Stop frickin' using Cargo to build C libs, because you're probably not that great at it" blog post or something.)

So how does this all tie together? Well, as it stands, the x86_64-pc-windows-gnu Rust release ships with libs and linker executables from 2017, which while not that old still generally make it lag behind other "first class" Rust targets, particularly because it seems that they're just stock MinGW files (which are generally built with rather "pedestrian" optimization flags.)

I think I / we / you / all of us can do way better to support this target (which was the only way Rust originally ran on Windows, keep it mind!)

So just uh, tell me what to build and package, or whatever, and I'll happily do it.

6 Likes

Honestly, the first step is identifying where the toolchain is lagging behind, and issuing issues on the rust-lang repository to get them fixed. If you offer to help do the legwork when submitting the issue, I'm sure someone with the necessary knowledge will see the issue and drop a short overview of what needs to be done.

7 Likes

Thanks! Will put something together. And yeah, I'm happy to do the legwork, certainly. As I mentioned, I'm already building rust from source in a way that possibly no one else (or at least very few people) are currently (which may only be because they aren't aware that it's actually fully possible now, and has been for a bit.)

3 Likes

Can I suggest you propose PKGBUILDs and patches to them to https://github.com/msys2/MINGW-packages? I'd love to get involved in this effort and the MSYS2 community at large would be very receptive to this. Glad to hear things are working nicely for you too.

2 Likes

I created #53454 before, but that was long before i finally cannot tolerate windows-gnu any more, and changed my configuration to use msvc toolchain and target. I guess you can start from there though.

The reason LLVM choose to target MSVC is the same reason I think Rust should keep its focus there - tooling. Windows profilers, debuggers and loads of other tools rely on PDBs which GNU doesn’t emit. I was able to profile a Rust program this afternoon using Visual Studio on a bare .exe - still, the debug symbols produced in release mode could do with some improvement. I think maintaining two back ends on a single OS is a distraction from raising the quality of one.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.