Live data from Hacker News

Cross-compiling binaries for Windows is easier than building natively

gist.github.com

31–40 of 349 posts

Re: Cross-compiling binaries for Windows is easier than building natively

#31
post #22
post #14

It is. I generate the Windows executables for a program by cross-compiling Rust on Linux. Then test with Wine. The Rust crates are cross-platform enough that I don't have to special case platforms. This is easier than having a Windows machine. The only current headache is that there's no pure Rust bundler, to make ".msi" or ".msix" installer files. If you dump the legacy OS stuff, it gets easier.

Doesn't cargo-bundle do that? I haven't tried to use it to generate .msi files, only for iOS/macOS, but it has the feature!

Cargo-bundle was supposed to do that, but only the Mac part was completed. Nobody ever did the .msi output. I've been trying to get someone interested in doing that. That task needs someone very familiar with the Microsoft ecosystem, which I am not. Discussion in Rust tools forum here.[1]

[1] https://internals.rust-lang.org/t/cross-platform-bundling/16...

Re: Cross-compiling binaries for Windows is easier than building natively

#32

Are symlinks on Windows really such a big issue? I’ve never heard of projects using symlinks in their tree. If Windows developers are complaining about you doing something unusual, why is it their fault?

Nope, since XP that you can use mklink, and before there were Technet utilities for the same purpose.

However using symlinks just isn't a thing in the Windows culture, people use at most Shell shortcuts.

Re: Cross-compiling binaries for Windows is easier than building natively

#33
post #9

Are symlinks on Windows really such a big issue? I’ve never heard of projects using symlinks in their tree. If Windows developers are complaining about you doing something unusual, why is it their fault?

The higher level thing to notice is that Windows is a second class platform for much of the software world. As such, it is in a position where it needs to bend the knee for compatibility with the dominant platform if they want it to be an active player in the larger ecosystem. In the case of symlinks, the hard part is already done, to the point where it is a toggle that has already been implemented, the UX of enablin…

For game developers and GUI applications it is first class.

Apparently being the best in symlinks hasn't made a difference in the Year of Desktop Linux.

Re: Cross-compiling binaries for Windows is easier than building natively

#34
post #21

For me SDK sizes are showstopper. Mingw packages are probably 100-200 Mb total. To build anything native one has to install Windows (20+Gb in modern version and then Visual Studio 40+Gb). Not so easy to fit it all on an SSD drive. Xcode also have this problem now. 8Gb for Xcode 7 is manageable. But why 70Gb for Xcode 11?

> To build anything native one has to install Windows (20+Gb in modern version and then Visual Studio 40+Gb). Not so easy to fit it all on an SSD drive. Maybe a decade ago, but SSDs are so much cheaper per GB nowadays. Around $0.11/GB. Pretty sure that's cheaper than the first 1TB HDD I've owned.

Not when you are on Macbook. Don't suggest external drives please ;)

Re: Cross-compiling binaries for Windows is easier than building natively

#35

Earlier quoted context omitted.

There are very few things that actually require Visual Studio just to build.

Interesting, how can I install just the cmake + msvc to do command line builds with windows? I'm also installing wsl2 + mingw because it is so much lighter for compilation than many, many gigabytes of vis studio.

`msbuild` is what I used back in the day. It seems to still exist, but I have no idea if this is still preferred solution. I just use WSL 2 these days, and live with the extra io latency.

Re: Cross-compiling binaries for Windows is easier than building natively

#36
post #3

Earlier quoted context omitted.

Certainly better to avoid it if at all possible, and I'll be eliminating them specifically to improve Windows compatibility. It's not that unusual, though, a quick search turns up 1.1k GitHub repositories with `git config core.symlinks true` in their documentation or CI pipelines - including quite popular projects like Ava, Apache Arrow, Solana, Chrome Devtools, adobe-fonts, IBM/houdinID, travis-ci, RabbitMQ, various…

I agree that Windows could do more to support the developers on other platforms. Symlinks just seem like a petty thing to complain about IMHO. Didn’t realize how common they were though. NTFS does support them, however. Is Git just not supporting them properly?

It does support them, mklink.

https://docs.microsoft.com/en-us/windows-server/administrati...

Re: Cross-compiling binaries for Windows is easier than building natively

#37
post #28
post #21

For me SDK sizes are showstopper. Mingw packages are probably 100-200 Mb total. To build anything native one has to install Windows (20+Gb in modern version and then Visual Studio 40+Gb). Not so easy to fit it all on an SSD drive. Xcode also have this problem now. 8Gb for Xcode 7 is manageable. But why 70Gb for Xcode 11?

A 1tb M.2 drive is what... £70? If that's out of reach im not sure how you're powering your dev machine.

> > Xcode also have this problem now. 8Gb for Xcode 7 is manageable. But why 70Gb for Xcode 11?

> A 1tb M.2 drive is what... £70?

To be contextually fair, Apple charges $400, and the storage isn't replaceable. Who runs their editor off of an external drive? I imagine the number is very small.

Although, on my machine, Xcode only seems to be taking up 17GB, not 70GB.

Re: Cross-compiling binaries for Windows is easier than building natively

#38
post #15

Earlier quoted context omitted.

Maybe I missed something on this discussion but symlinks and NTFS are not really related.. They have them yes, how they're handled is different.

How are they not related? If NTFS didn't have symlinks we wouldn't be having this discussion. Critically, the modern standard for removable drives, exFAT does not support symlinks, so you can't count on Windows' support for symlinks if the user is git cloning on a drive that's using exFAT.

https://docs.microsoft.com/en-us/windows-server/administrati...

Re: Cross-compiling binaries for Windows is easier than building natively

#39

Are symlinks on Windows really such a big issue? I’ve never heard of projects using symlinks in their tree. If Windows developers are complaining about you doing something unusual, why is it their fault?

Projects don’t use symlinks because they aren’t supported on windows.

https://docs.microsoft.com/en-us/windows-server/administrati...

Re: Cross-compiling binaries for Windows is easier than building natively

#40
post #28
post #21

For me SDK sizes are showstopper. Mingw packages are probably 100-200 Mb total. To build anything native one has to install Windows (20+Gb in modern version and then Visual Studio 40+Gb). Not so easy to fit it all on an SSD drive. Xcode also have this problem now. 8Gb for Xcode 7 is manageable. But why 70Gb for Xcode 11?

A 1tb M.2 drive is what... £70? If that's out of reach im not sure how you're powering your dev machine.

[deleted]
Post reply on HN