Live data from Hacker News

Cross-compiling binaries for Windows is easier than building natively

gist.github.com

51–60 of 349 posts

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

#51
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.

> The only current headache is that there's no pure Rust bundler, to make ".msi" or ".msix" installer files.

I have set up a toolchain based on Wix, running via Mono and Wine on Linux, for the purpose of packaging some rather complex .msi files in a commercial software project. Has been running on the Linux-based CI servers of that project for 10 years straight now, with the only change having been that the entire chain has been packaged into a Docker container a few years ago when that became fashionable.

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

#52
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.

Good news is winget will soon support single binaries so that is one option.

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

#53
post #41
post #5

Microsoft's days as a 'primary' desktop operating system are numbered. The OP doesn't seem to understand this, but even Microsoft itself does, which is why most of its major moves the past few years haven't been improving its own desktop, but positioning itself to control "open source" the best it can. More people within the MS ecosystem should understand this.

Better check those desktop market share numbers.

I suspect if you restrict it to developers the numbers would look very, very different

on the stackoverflow survey windows is 41.2%: https://insights.stackoverflow.com/survey/2021#most-popular-...

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

#55
post #36

Earlier quoted context omitted.

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...

Yes, Windows does, but this post is complaining about support. Which led me to ask if Git is the problem. Cause Git also supports symlinks, but is clearly having issues on Windows.

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

#56
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?

NTFS has supported them for ages. The main issue is that they're locked behind elevated permissions or having developer mode enabled (as of Windows 10.)

My understanding is Microsoft's concern is that applications and OS components not expecting them could lead to security issues. Not sure how real that concern is, but that's the excuse I've heard.

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

#57
post #34

Earlier quoted context omitted.

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

I thought apple computers usually had thunderbolt ports. You can't just connect a thunderbolt/M.2 drive enclosure and mount it as root?

That’s still an external drive

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

#58

Earlier quoted context omitted.

That's exactly it. Windows developers know NTFS has Symbolic Links https://docs.microsoft.com/en-us/windows/win32/fileio/creati...

What's the standard for being an "actual Windows user"? Asking because I doubt e.g. my mom knows that NTFS has symlinks.

> What's the standard for being an "actual Windows user"?

I think you misread that line.

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

#59
post #39

Earlier quoted context omitted.

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

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

The command won't help when you don't have the permissions.

Or do you just want it to be phrased "not supported for users on normally configured systems"? There, then.

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

#60
post #42

Earlier quoted context omitted.

What's the standard for being an "actual Windows user"? Asking because I doubt e.g. my mom knows that NTFS has symlinks.

Is she a Windows developer? https://docs.microsoft.com/en-us/windows-server/administrati...

The developers who complained to me about this are Windows developers regularly.

One is even a professional AAA DirectX gamedev.

Post reply on HN