I don't know where this would go or where someone would want me to put it.
I realized that there isn't an easy installer/executable installer for rust. So I made one using the standard library. If you like it then this will probably take forever to get the edge case bugs out of, but it should make installing rust on windows machines a lot easier
Right now it #worksonmymachine so if you guys have issues with getting it to work on yours then the information would be helpful so that I can add modifications and updates. This should work for all windows 10/11 machines
And now I feel dumb because I realize that my vscode blocked my save to main.rs from updating the file so for the last 24 hours it's just said hello world. It's fixed lol the actual code is there for other people to review
Sounds interesting. Is your goal to be something like the NullSoft (NSIS) Installer? Or is it to be something more along the lines of a tool to create MSI's etc?
I probably should've read the linked repo first. I see this is something to install the Rust Toolchain and all the necessary dependencies on Windows.
Yeah I wanted there to be a single executable file that will install rust for you like they do for python or other languages.
The native installation requires you to install visual studio so that you can get the native installs of gcc/cmake, but I'll get to that later lol. That requires understanding anything about the rust windows api
It doesn't right now. I'm going to eventually add that once I figure out how to do it, but right now you can see at line 137 that if it doesn't have admin and it gets blocked then you'll need to rerun as admin
"PowerShell execution policy blocks downloads. Please run as administrator or enable PowerShell scripts"
Though I was able to get it to work on a fresh install of windows without admin, but your mileage may vary.
From what I can tell once you get past the Msys install it doesn't complain at all. So hopefully that is true for everyone forever.... (it won't be, but I can hope)
So if there's things that you're having issues with or you want me to add then let me know by adding it as an issue on the repo. I'll probably complete the issue that weekend, or if you make the issue on the weekend, that day (hopefully)
Github just privated my whole account for something. They didn't tell me but I think it's for making a video player because I didn't want to pay for plex. Putting that last sentence in the about page for the repo was probably a bad idea. Should be back up whenever they get around to looking at my ticket and telling me what I actually did
I gave a Rust course. The Windows participants were pretty annoyed, as apparently rustup needs to install Visual Studio. If I understood this right that’s because it in turn installs C++, which comes with a linker.
Does using msys mean you avoid that horrible detour?
Yeah there's actually a method that uses Gnu for windows and installs software called Msys which does all of that for you using the command line. I can pass someone else the code so they can make sure people have access to it. I can still see it, but github just won't let me show it to others. Right now I just need other peoples take on the code and get as many issues as I can so I can solve them and make this easy for everyone. Until that happens, you can do this:
follow this thread to get the right installs and just ask some Ai to give you what's missing
https://stackoverflow.com/questions/47379214/step-by-step-instruction-to-install-rust-and-cargo-for-mingw-with-msys2
Rust does come with a linker (rust-lld.exe) that can be used as a replacement for the MSVC one (link.exe) but it isn't used by default. I'd love it if it were. However, it's not just the linker. Some libraries are also required and the licensing means we can't bundle them with rust or even download just the necessary libraries. Visual Studio is the only way to obtain them without violating the license.
The windows-gnu targets use mingw, which is a permissively licensed OSS alternative
It should be noted that the two toolchains are not equivalent. The -msvc one will use Microsoft's ABIs, while the -gnu will use GNU's ABIs. This can cause incompatibilities when linking to external libraries (including system ones) that are built with a different ABI than the one you are using.
I believe the main difference in ABI is that MinGW doesn't support short import libraries, so you need different import libraries. The calling convention should be identical outside of some edge cases like zero sized arguments (which C doesn't officially allow). If you are trying to pass libc types like FILE * to a library with the wrong ABI you also hit issues, but the same would happen if you pass it to an MSVC compiled library that links against a different version of msvcrt even with the MSVC target. The MinGW targets use the Windows system libraries compiled with MSVC just fine.
I'm not gonna wait for github to get back to me about getting all the stuff back up. So I just used one of my other ones to get this library up for people to use. If you have issues then drop em in the issues on this page. I'll still respond
you're definitely right about this. Doing this method initially I had problems with a library called zoxide and had to install it manually through msys rather than through the cmd.
It's not yet possible to override linkage in dependencies (especially if that dependency is std) so progress on raw-dylib is moving ahead very cautiously. We do need to make sure everything is perfect before we make the switch.
But that's the easy part. The hard part is panic handling. Rust (understandably) took the decision to reuse the whole C++ exception infrastructure which means we have a hard dependency on their exception libraries. We'd either need to reverse engineer it or else implement our own thing. The former is not ever going to happen (lol) and the latter may need to be a new target (and would need compiler support for SEH handling, which admittedly I'd love to have regardless).
Having said the above, an issue just cropped up which would justify implementing our own exception personality on the msvc targets. So, touch wood, this may be a way toward having an msvc toolchain without the msvc.