Skip to content

Add aarch64 wine with msys2

Serge S. Gulin requested to merge wip/deb12-aarch64-wine into master

Enables support Wine with MSYS2 and arm64ex at our linux-aarch64 runners.

Core motivation lies here:

  1. Windows x86-64 runners are limited.
  2. Aarch64 hardware emulation is slower at x86-64 but x86-64 emulation under Aarch64 works faster.
  3. We have no Windows Aarch64 hardware at the moment.
  4. Reducing costs by usage Windows machines.
  5. Licensing issues with Windows to use real hardware like raspberry pi 5 for CI-purposes.

Uses the following components:

  1. Wine bindist from https://gitlab.haskell.org/gulin.serge/ci-wine-msys2-arm64ec/-/packages (custom patches are applied from https://gitlab.winehq.org/jhol/wine/-/commit/f4ee66ef58d4e4b66ea3b11328d1bd2dda3da927 and https://github.com/AndreRH/wine/commit/263c34123886c6a0f3d9982e595443b679bf11e4 rebased over Wine-10.4 version, it required rebasing).
  2. FEX bindist from https://launchpad.net/~fex-emu/+archive/ubuntu/fex (enables arm64ex virtualization for Wine environments). Needed to give a chance for Wine to run x86-64 code at aarch64 hardware same way how Windows 11 does.
  3. MSYS2 bindist https://github.com/msys2/msys2-installer/releases. Needed to create GHC Windows environment where GHC build process itself can be executed.
  4. Git-For-Windows Aarch64 bindist (installed from MSYS2 manually added repository according to https://gitforwindows.org/install-inside-msys2-proper.html). Uses Aarch64 version because it is notable faster than MSYS2's one. MSYS2 origin has only x86-64 git.
  5. Install https://github.com/mstorsjo/llvm-mingw Aarch64 Clang 19.7 for Linux and Windows environments. MSYS2 uses 20 but GHC does not support it at the moment.

As well it installs additional packages into MSYS2 environment:

"base-devel"
"mingw-w64-clang-aarch64-python"
"mingw-w64-clang-aarch64-python-pip"
"mingw-w64-clang-aarch64-pkgconf"
"mingw-w64-clang-aarch64-git"
"mingw-w64-clang-aarch64-git-lfs"
"mingw-w64-clang-aarch64-git-credential-manager"
"automake-wrapper"
"autoconf-wrapper"
"gmp"
"gmp-devel"
"unzip"

They are required to install GHC x86-64 Windows bindist with cabal x86-64.

This image is useful at following scenarios:

  1. Cross-compile Haskell code from Linux Aarch64 into Windows Aarch64 and test its execution under Wine.
  2. Cross-compile Haskell GHC itself from Linux Aarch64 into Windows Aarch64 and run it under Wine with installed Cabal.
  3. Cross-compile Haskell GHC itself from Windows x86-64 into Windows Aarch64.
  4. Compile and run GHC Windows Aarch64 by using GHC bindist from ghc#24603 (comment 601980) or ghc#24603 (comment 602054) (the last is better, it has enabled stack checks and Windows AV does not recognize it as a malware :-))
  5. Compile GHC JS Backend for Windows Aarch64 by usage Windows Aarch64 bindists and test it

Further steps could be but not limited at:

  1. Prepare MSYS2 + Wine x86-64 configuration to run tests for Windows platform without needing actual usage of Windows machines.
  2. Use this image to develop Windows Aarch64 (and later x86-64) in Docker environment.

It takes ~1h to build the image but most time spent on signature verifications (~50%). It is enabled for now, but can be disabled to speed up the process. I've applied a decision to leave these checks ON just to make sure that we have installed actually what requested.

To run MSYS2 environment do the following:

/opt/wine-arm64ec-msys2-deb12/bin/wine c:/msys64/usr/bin/env.exe -i HOME="$HOME" c:/msys64/usr/bin/bash.exe -l
Edited by Serge S. Gulin

Merge request reports

Loading