Consider moving Windows from mingw64 to ucrt64

In working on the PyInstaller I found out that GExiv2 is not built for our current system: MSYSTEM: MINGW64.

The GExiv2 PKGBUILD says:

mingw_arch=(‘ucrt64’ ‘clang64’ ‘clangarm64’)

So gexiv2 is not available for mingw64 — only for ucrt64, clang64, and clangarm64. Our build uses MSYSTEM: MINGW64, so the package simply doesn’t exist for ours.

We could switch to ucrt64 — it is a big change, but gexiv2 would be available

What is ucrt64?

UCRT64 = Universal C Runtime, 64-bit

It’s the modern Windows C runtime that Microsoft introduced with Windows 10. There are two flavors in MSYS2:

┌────────────────┬───────────────────────────────────┬──────────────────────────────────────────────────┐
│                │              MINGW64              │                      UCRT64                      │
├────────────────┼───────────────────────────────────┼──────────────────────────────────────────────────┤
│ C runtime      │ msvcrt.dll (legacy, from the 90s) │ ucrt.dll (modern, Windows 10+)                   │
├────────────────┼───────────────────────────────────┼──────────────────────────────────────────────────┤
│ Compiler       │ GCC                               │ GCC                                              │
├────────────────┼───────────────────────────────────┼──────────────────────────────────────────────────┤
│ Package prefix │ mingw-w64-x86_64-*                │ mingw-w64-ucrt-x86_64-*                          │
├────────────────┼───────────────────────────────────┼──────────────────────────────────────────────────┤
│ Windows compat │ XP+                               │ Windows 10+ (ships with 10, backportable to 8.1) │
├────────────────┼───────────────────────────────────┼──────────────────────────────────────────────────┤
│ Status         │ Older, stable                     │ Recommended by MSYS2 since ~2022                 │
└────────────────┴───────────────────────────────────┴──────────────────────────────────────────────────┘

MSYS2 now recommends UCRT64 for new projects because:

  • It’s what Microsoft supports going forward
  • Better standards compliance
  • Some newer packages (like gexiv2) are only built for ucrt64

The trade-off: switching means replacing every mingw-w64-x86_64- with mingw-w64-ucrt-x86_64- in build.sh, changing MSYSTEM: MINGW64 to MSYSTEM: UCRT64 in the workflow, and updating the NSIS template. It’s mechanical but there are a lot of package names.

Since Gramps targets Windows 10+ anyway (GTK3 requirement), UCRT64 is actually the better fit.

I didn’t want to change something this big on a bug fix release (6.0.7) even though we may be switching to PyInstaller. But worth considering for Gramps 6.1.

4 Likes

Good idea. I’m in favour of this.

The Windows AIO is community maintained and I would normally leave decisions like this to the maintainer. However the current maintainer is listed as Paul Culley [@prculley] and I don’t think that he is active at the moment.

There is no reason why we, or anyone else, shouldn’t distribute a ucrt64 version of the Windows AIO.

2 Likes

I’d be glad to help with this if needed. I suggest we target 6.1 for the first ucrt64 version. (I don’t use Windows either, but Claude and I now have some experience with Windows installers).

4 Likes

@dsblank Did not know you already started this thread as I was away for a few days. I started a similar discussion on the mailing list and I came to the same conclusion as you for the path forward.

One thing that this change implies (and I’ve included this in the mailing list thread) is that Windows 8.1 will no longer be a supported platform. Not having any data number of Gramps installations on that OS, I hesitate to make a statement, but a strong reason to drop support anyway is that Microsoft EOL was back in 2023, and that MSYS2 won’t be supporting any package dependencies either.

I’m happy to work on this with you.

3 Likes

That will no no great loss. Win 8 / 8.1 was universally despised. Did anybody (apart from my 80+ year old mother, and me when I had to help her out every time I was at her house) ever use a device that ran Win 8.1?

1 Like

While reviewing the packages used by AIO, one potential issue in migration to UCRT64 is the db package. This is not available from MSYS2 and was custom built and made available for Gramps by JosipB. We pull that in aio/build.sh:

wget --no-verbose -N https://github.com/bpisoj/MINGW-packages/releases/download/v5.0/mingw-w64-x86_64-db-6.0.30-1-any.pkg.tar.xz
pacman -U --needed --noconfirm mingw-w64-x86_64-db-6.0.30-1-any.pkg.tar.xz

There is some documentatin about the db package on the MSYS2 wiki. We’ll need build it for UCRT64 ourselves from the source in Josip’s repo if we want to match what we are using now. It’s going to take some effort to do this, and I’m not sure how to test and validate the build.

So before I go deeper into this, can I get validation that db (and bsddb3) is is still a requirement for Gramps?
Are there any db experts who are willing to help with this?

Thanks!

bd and bsddb3 are needed to migrate from Gramps version 4 and earlier I think.

Perhaps we can rely on previous versions of Gramps to do migrations?

3 Likes

I used both Win 8 and all the following updates up until Win 10 without any problems Both as a system administrator for multiple client networks and as a photographer. In addition, I ran several research applications for my hobby projects. During the whole period I think I had two crashes that weren’t caused by the Radeon driver package – and that was AMD, not Microsoft.

I also had a few Windows Server boxes and a deployment service with Win 8 images. The client was a small one with around 50 licenses. Never a fault on those either. But all of those machines ran old Matrox or workstation‑class GPUs from both Nvidia and AMD. They had issues, yes – but that was with software like Maya and 3ds Max, and the GPU drivers, not Windows itself.

Yes, correct - migration. For now we can remove this blocker by leaving out both db and bsddb3 for the UCRT64 port. We can revisit when the decision is made on that functionality.

2 Likes

Given the number of packages that have had to be pinned in order to (hopefully) get a 6.0.7 aio build, I’m in favour of moving to a ucrt64 based build this for gramps 6.1

3 Likes

Our FlatPak hasn’t included BSDDB since v5.2.

3 Likes

First build in the UCRT64 environment - AI did most of the grunt work, but I ran the build-check log-fix cycle. Will upload draft PR later. Caveats:

  • db and bsddb3 removed
  • pygraphviz build failing : WIP
  • Needs to integrate some changes from aio-6.0.7, i.e. graphviz, gspell and enchant

I’ll push up a draft PR later.

3 Likes

Draft PR #2198 open for comments and contributions.

@Nick-Hall @dsblank @SteveY any other developers,

Migration to UCRT64 is going well. One stumbling block is the migration to Enchant 2.7.0+ (currently 2.8.15). I’ve added a commit to PR #2198 with a comment about what’s holding it up (ignore the Black formatting failure - I’ll fix that with the next commit). Would appreciate your help. Thanks.

In the meanwhile I copied the folder manually to the install location and spell check still doesn’t work, so there’s more debugging to be done after the packaging step.

1 Like