Live data from Hacker News

Cross-compiling binaries for Windows is easier than building natively

gist.github.com

161–170 of 349 posts

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

#161
I use Cygnal for making a Windows version of TXR.

https://www.kylheku.com/cygnal/

You compile in the Cygwin environment where you have all the usual tools. Then shipping the program with cygwin1.dll from the Cygnal project gives it native-like behaviors.

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

#162

Earlier quoted context omitted.

Easy static link everything. I think you meant a GUI application that runs on a version of Linux older than yours.

Statically link everything ? Including glibc?

Trick question: glibc doesn't support that.

Trying to statically link with glibc is a fool's errand.

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

#163

Only if you want to be trendchasing rather than letting backwards compatibility take care of itself... I'm a native Win32 developer, have been one for a few decades, and know quite a few others still using MSVC6 because it's fast and enough for what they do. Takes Long file paths: Azure, OpenSearch, and ~90 other open source projects have to document how to enable long file paths on Windows because the default is a ~…

Not enough. Between path limits and "this file is in use by another program" nonsense I regularly ran into while developing on Windows, I switched away and never looked back.

That cuts both days, a Windows developer trying to port a project to Linux would be justified in concluding the filesystem locking semantics are horribly broken and non-existent.

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

#164
post #98
post #87

Earlier quoted context omitted.

Yeah, given the sheer cpu/ram/m.2 power of what even a tiny NUC provides, with modular, replaceable monitor(s)/keyboard/mouse/USB(3/C/Thunderbolt)/HDMI etc, for less than a Mac, I am unable to understand the appeal of a laptop. And I use a i7/64GB/1TB NUC for traveling! I use a twice as powerful Ryzen rack server for my office dev box. 5m extension cables so the noise is in a closet. I have no problems with external…

I live in a small apartment with my partner who also works from home. We don’t have enough space to dedicate to two desks. We also travel a lot, so I need to be able to take my work with me.

It is a weird thing to me that a minimal impact lifestyle[0] requires a very constrained and expensive computer ecosystem to facilitate unrealized happiness.

[0] ...but with frequent travel?

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

#165

Earlier quoted context omitted.

> But you don't have to develop on Macbook Can you please tell that to my IT department which refused to issue me a Linux laptop for 1 month, then took two months to put the order in... I had to get an executive (President of R&D) at the company to harangue IT... I still haven't seen it, apparently they are trying to install the standard "employee spyware" package on it.

If your IT department is an overt detriment to your development effort, send a letter to your company’s upper management and leave. This is the only way to push for change in these moronic companies, and you keep your sanity.

No? There's a lot of other amazing things about the company beyond having 15% development drag? IT is not that important in the grand scheme of things.

Jesus. I have an executive level officer in the company that has my back and you're telling me to quit? Utterly horrible advice.

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

#166
post #94

Earlier quoted context omitted.

WiX is great. I have been using it for over a decade to package an internal application. It's all driven by a simple text file which I liked over Microsoft's packaging offerings.

The Windows Installer XML Toolset (WiX) is owned by Microsoft.

It's not. It's an open source project (aka owned by no one) that started at Microsoft. The person who created WiX left Microsoft to create Firegiant, which is the primary contributor to its continued development and maintenance.

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

#167

Now try building a "portable" binary that runs on a version of Linux older than yours.

I totally agree, it's practically impossible. Is it a philosophical thing or a technological thing? GPL is about source code and going against that will never make much progress.

It is almost always possible to do some relatively simple hacks to make old stuff work, though (LD_PRELOAD, binfmt_misc/qemu, chroot/docker).

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

#168
post #80
post #53

Earlier quoted context omitted.

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

If you toggle that response to "All Respondents" instead of "Professional Developers" Windows goes up to 45%. Plus, 3% of users are using windows subsystem for Linux. So 48%. Whereas Mac and Linux are both at 25%. Even for developers, Windows is still the clear majority.

If you look at desktop os share from tracking general web use rather than surveying people on a dev-focused site windows is 75%.

https://gs.statcounter.com/os-market-share/desktop/worldwide

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

#169

>I'm still blown away that they literally made the .NET team revert the dotnet watch PR at the last minute, so that they could sell it as a feature. This is not even true. Due to limited resources they wanted to cut scope of what the .NET 6 update included and they thought that it would be okay to delay the dotnet watch feature because most people would still have hot reloading from using Visual Studio. The PR for br…

> This is not even true. It is absolutely true. The CLI-first `dotnet watch` was pretty much done (I was using it in preview for months beforehand), and it was cut to promote hot reload as a Visual Studio feature. Source: I'm the person who raised the initial GitHub issue about the dotnet watch change, and I talked to multiple Developer Division employees off the record. It was a deeply unpopular move that came from…

So it's the public word of someone from the .NET team versus your unnamed sources. It sounds like there was a communication issue as from the blog post the reason given behind removing it wasn't to drive sales of Visual Studio. It sounds like if their team had more resources it wouldn't have been cut which invalidates the point of them using it to promote VS.

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

#170

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?

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.

>Not sure how real that concern is, but that's the excuse I've heard.

Bufferoverun I guess? I haven't programmed Windows in years, but there's plenty of code I've seen that is pretty much

    char path[MAX_PATH];
    res = some_func(&path);
from there you put in a large path and then you get your RCE.
Post reply on HN