Skip to content

Commit bb04d4f

Browse files
committed
ci: switch winredirect driver build to Linux cross-compilation
Replace the native Windows CI runner with msvc-wine on ubuntu-latest. This enables building all four architectures (x86, x64, ARM, ARM64) using MSVC 17.13 + WDK 10.0.22621 via wine-based cross-compilation.
1 parent 5d4df52 commit bb04d4f

2 files changed

Lines changed: 179 additions & 215 deletions

File tree

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Cross-compiles Windows kernel drivers using msvc-wine.
2+
# Toolchain: MSVC 17.13 (14.43) + SDK/WDK 10.0.22621
3+
# Architectures: x86, x64, ARM, ARM64
4+
FROM alpine:3.21 AS msvc-wine
5+
RUN apk add --no-cache git
6+
RUN git clone https://github.com/mcha-forks/msvc-wine.git /msvc-wine \
7+
&& cd /msvc-wine && git checkout 2d5f5a3
8+
9+
FROM registry.fedoraproject.org/fedora-minimal:44 AS wine
10+
11+
COPY <<-'EOF' /etc/yum.repos.d/_copr:copr.fedorainfracloud.org:mochaa:wine.repo
12+
[copr:copr.fedorainfracloud.org:mochaa:wine]
13+
name=Copr repo for wine owned by mochaa
14+
baseurl=https://download.copr.fedorainfracloud.org/results/mochaa/wine/fedora-$releasever-$basearch/
15+
type=rpm-md
16+
skip_if_unavailable=True
17+
gpgcheck=1
18+
gpgkey=https://download.copr.fedorainfracloud.org/results/mochaa/wine/pubkey.gpg
19+
repo_gpgcheck=0
20+
enabled=1
21+
enabled_metadata=1
22+
23+
[copr:copr.fedorainfracloud.org:mochaa:wine:ml]
24+
name=Copr repo for wine owned by mochaa (i386)
25+
baseurl=https://download.copr.fedorainfracloud.org/results/mochaa/wine/fedora-$releasever-i386/
26+
type=rpm-md
27+
skip_if_unavailable=True
28+
gpgcheck=1
29+
gpgkey=https://download.copr.fedorainfracloud.org/results/mochaa/wine/pubkey.gpg
30+
repo_gpgcheck=0
31+
cost=1100
32+
enabled=1
33+
enabled_metadata=1
34+
EOF
35+
36+
RUN <<-EOF
37+
set -xeu
38+
microdnf install -y wine-core wine-core.i686 wine-mono
39+
microdnf clean all
40+
EOF
41+
42+
RUN <<-EOF
43+
set -xeu
44+
wine wineboot -u
45+
wine reg.exe add HKCU\\Software\\Wine\\Drivers /v Graphics /t REG_SZ /d null
46+
wineserver -w
47+
EOF
48+
49+
WORKDIR /builddir
50+
51+
FROM wine AS fetch-wdk
52+
COPY --from=msvc-wine /msvc-wine/wdk-download.sh ./
53+
RUN WINEDEBUG=1 bash -x ./wdk-download.sh --cache wdk https://go.microsoft.com/fwlink/?linkid=2330411
54+
55+
FROM python:3.14-slim AS fetch-msvc
56+
WORKDIR /builddir
57+
COPY --from=msvc-wine /msvc-wine/vsdownload.py ./
58+
RUN PYTHONUNBUFFERED=1 ./vsdownload.py --accept-license --only-download --cache cache \
59+
--major=17 --msvc-version=17.13 --sdk-version=10.0.22621 --with-wdk-installer wdk/Installers
60+
61+
FROM wine AS builder
62+
RUN <<-EOF
63+
microdnf install -y msitools perl
64+
microdnf clean all
65+
EOF
66+
COPY --from=fetch-msvc /builddir/cache/ ./cache/
67+
COPY --from=fetch-wdk /builddir/wdk/Installers/ ./wdk/Installers/
68+
COPY --from=msvc-wine /msvc-wine/vsdownload.py ./
69+
COPY --from=msvc-wine /msvc-wine/patches/ ./patches/
70+
RUN PYTHONUNBUFFERED=1 python3 ./vsdownload.py --accept-license --cache cache --dest /opt/msvc \
71+
--msvc-version=17.13 --sdk-version=10.0.22621 --with-wdk-installer wdk/Installers
72+
COPY --from=msvc-wine /msvc-wine/lowercase /msvc-wine/fixinclude /msvc-wine/install.sh /msvc-wine/msvctricks.cpp ./
73+
COPY --from=msvc-wine /msvc-wine/wrappers/ ./wrappers/
74+
RUN bash -x ./install.sh /opt/msvc
75+
76+
FROM wine
77+
COPY --from=builder /opt/msvc /opt/msvc

0 commit comments

Comments
 (0)