Wednesday, December 10, 2025

Patches to Build Python3.14.2 on Cygwin

Well, that took a while, but I finally did it.

First, here's the payload (for 3.14.2).

Next, the explanation on what it is.

Cygwin remains as my preferred UNIX-like interface while operating in a primarily Windows environment. The Python interpreter that is still present in Cygwin is Python3.9, which is fine for me.

But the useful yt-dlp tool has pushed their support from Python3.9 to a version that is at least Python3.10, because Python3.9 will not be getting security support from 2025-10-31.

I understand. yt-dlp is a tool that targets a slightly more tech-y user, but not by much. It is also a tool that needs to be continuously updated due to the ever-evolving nature of video services, so having a Python environment that has proper security patches is a good thing.

But Cygwin hasn't a good working Python environment beyond 3.9 as at now. There's a weird Python3.12 build in the background, but it is incomplete and weird. Moreover, if you looked at the same site I linked to earlier, even Python3.12 is seeing the end of security supports at 2028-10-31, which really isn't that far away, should the maintainer of Python in Cygwin actually fix the current build.

So, it's probably better to build my own.

Building Python isn't hard... in Linux. On Windows/Cygwin, it gets complicated.

Which is what the payload (for 3.14.2) is supposed to ease. The contents of the payload can be seen in detail here, but I will outline the rough changes here as well.
  1. uuid support library detection was broken;
  2. List of support libraries defined (in static-compilation for ease of use);
  3. Incomplete detection for clk_id for Cygwin;
  4. Messed up refactoring on LDLIBRARY use that got an unusable name (libpython3.14.dll.a versus the actual libpython3.14.dll); and
  5. Fixing up the way compileall.py does multi-processing (Cygwin's spawn() and forkserver implementations don't work as compared to simple fork()).
So now, I have a nearly-clean build of Python3.14 from which yt-dlp can run well enough.

``MT, why not contribute back the changes to upstream and/or take over the maintenance for Python3.14 on Cygwin?''

Well, it takes time due to the additional responsibilities and accountabilities on these patches that I have done up basically only to get working in my circumstance. So I think I've done the next best thing by putting it on my website, and talking about it here (where it can get indexed and highlighted).

I think that's it for now. Till some update in the future.

No comments: