ci: rely on the Void CI images for the toolchain

The windows-gcc image already ships MinGW-w64 GCC 16 (UCRT), Wine and
CMake/Ninja, and the vulkan image ships GCC 16, CMake 4 and the Void
dependencies. Drop the MinGW download, the apt package installs and the
Wine install; the Windows lane now uses the repository's PATH-based
MinGW toolchain file and stages the runtime DLLs from the MinGW sysroot.
This commit is contained in:
faumaray committed 2026-12-06 07:40:05 +03:00
1 parent a4e855f130
commit 51d437d339
3 files changed
+22 -98

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
# Cross-compiles VoidBuildSystem for 64-bit Windows (UCRT) with the MinGW-w64
# toolchain on PATH (the Void CI `windows-gcc` image provides GCC 16).
# The Wine CI lane runs the executables on Linux.
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR x86_64)
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
set(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
set(CMAKE_AR x86_64-w64-mingw32-ar)
set(CMAKE_RANLIB x86_64-w64-mingw32-ranlib)
# Look for target libraries and headers in the MinGW sysroot, but run host
# programs (cmake, ninja, python, ...) from the normal PATH.
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
-57
View File
@@ -1,57 +0,0 @@
#!/usr/bin/env bash
# Installs the MinGW-w64 GCC 16 cross toolchain (UCRT) used to build VBS for
# Windows from Linux: https://github.com/AmanoTeam/mingw-gcc-cross (gcc-16).
#
# Usage: install-mingw.sh [PREFIX] (default /opt/mingw-gcc-cross)
set -euo pipefail
release=gcc-16
host=x86_64-unknown-linux-gnu
url="https://github.com/AmanoTeam/mingw-gcc-cross/releases/download/${release}/${host}.tar.xz"
prefix="${1:-/opt/mingw-gcc-cross}"
compiler="${prefix}/bin/x86_64-w64-mingw32-ucrt-g++"
# cc1plus links against the GMP/MPFR/MPC/isl/zstd copies shipped in the
# toolchain, so the host loader needs the prefix on its search path.
export LD_LIBRARY_PATH="${prefix}/lib:${prefix}/lib64:${LD_LIBRARY_PATH:-}"
if [ -n "${GITHUB_ENV:-}" ]; then
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> "${GITHUB_ENV}"
fi
self_check() {
local probe
probe="$(mktemp -d)"
printf 'int main() { return 0; }\n' > "${probe}/probe.cpp"
if ! "${compiler}" -c "${probe}/probe.cpp" -o "${probe}/probe.o"; then
echo "the MinGW-w64 toolchain at '${prefix}' cannot compile:" >&2
"${compiler}" -v -c "${probe}/probe.cpp" -o "${probe}/probe.o" 2>&1 | tail -n 20 >&2 ||
true
ls -la "${prefix}/libexec/gcc/x86_64-w64-mingw32/"*/cc1plus >&2 || true
df -h "${prefix}" >&2 || true
rm -rf "${probe}"
exit 1
fi
rm -rf "${probe}"
echo "MinGW-w64 toolchain OK: $("${compiler}" --version | head -n1)"
}
if [ -x "${compiler}" ]; then
echo "using the existing MinGW-w64 toolchain at ${prefix}"
self_check
exit 0
fi
sudo=""
if [ "$(id -u)" -ne 0 ]; then sudo="sudo"; fi
tmp="$(mktemp -d)"
trap 'rm -rf "${tmp}"' EXIT
if command -v curl >/dev/null 2>&1; then
curl -fsSL "${url}" -o "${tmp}/toolchain.tar.xz"
else
wget -qO "${tmp}/toolchain.tar.xz" "${url}"
fi
${sudo} rm -rf "${prefix}"
${sudo} mkdir -p "${prefix}"
${sudo} tar -xJf "${tmp}/toolchain.tar.xz" -C "${prefix}" --strip-components=1
echo "toolchain file: ${prefix}/usr/local/share/mingw/cmake/x86_64-w64-mingw32-ucrt.cmake"
self_check
+5 -41
View File
@@ -64,29 +64,6 @@ jobs:
fi fi
bash .gitea/scripts/install-ninja.sh bash .gitea/scripts/install-ninja.sh
git --version git --version
- name: Install the development requirements
run: |
# The optional backends (OpenSSL, SQLite3) are opportunistic: a runner that
# provides the GCC 16 toolchain already satisfies the mandatory requirements.
if ! command -v apt-get >/dev/null 2>&1; then
echo "apt-get is not available; using the toolchain provided by the runner"
exit 0
fi
sudo=""
if [ "$(id -u)" -ne 0 ]; then sudo="sudo"; fi
missing=""
for package in libssl-dev libsqlite3-dev pkg-config; do
if command -v dpkg >/dev/null 2>&1 && dpkg -s "${package}" >/dev/null 2>&1; then
continue
fi
missing="${missing} ${package}"
done
if [ -n "${missing}" ]; then
${sudo} apt-get update
${sudo} apt-get install -y ${missing}
else
echo "all development packages are already installed"
fi
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# 2A / 3A - Linux native # 2A / 3A - Linux native
@@ -257,21 +234,19 @@ jobs:
build_type: RelWithDebInfo build_type: RelWithDebInfo
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install the MinGW-w64 GCC 16 cross toolchain
run: bash .gitea/scripts/install-mingw.sh /opt/mingw-gcc-cross
- name: Configure - name: Configure
run: | run: |
cmake -S . -B "build/wine-${{ matrix.variant }}" -G Ninja \ cmake -S . -B "build/wine-${{ matrix.variant }}" -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=/opt/mingw-gcc-cross/usr/local/share/mingw/cmake/x86_64-w64-mingw32-ucrt.cmake \ -DCMAKE_TOOLCHAIN_FILE="$PWD/.gitea/cmake/mingw-w64-toolchain.cmake" \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- name: Build - name: Build
run: cmake --build "build/wine-${{ matrix.variant }}" --parallel 4 run: cmake --build "build/wine-${{ matrix.variant }}" --parallel 4
- name: Stage the MinGW runtime DLLs - name: Stage the MinGW runtime DLLs
run: | run: |
for lib in libstdc++.dll libgcc_s_seh.dll libwinpthread.dll; do for lib in libstdc++-6.dll libgcc_s_seh-1.dll libwinpthread-1.dll; do
if [ -f "/opt/mingw-gcc-cross/x86_64-w64-mingw32-ucrt/lib/${lib}" ]; then if [ -f "/usr/x86_64-w64-mingw32/bin/${lib}" ]; then
cp "/opt/mingw-gcc-cross/x86_64-w64-mingw32-ucrt/lib/${lib}" \ cp "/usr/x86_64-w64-mingw32/bin/${lib}" \
"build/wine-${{ matrix.variant }}/bin/" "build/wine-${{ matrix.variant }}/bin/"
fi fi
done done
@@ -311,19 +286,8 @@ jobs:
with: with:
name: vbs-wine-build-${{ matrix.variant }} name: vbs-wine-build-${{ matrix.variant }}
path: build/wine-${{ matrix.variant }} path: build/wine-${{ matrix.variant }}
- name: Install Wine - name: Check Wine
run: | run: |
sudo=""
if [ "$(id -u)" -ne 0 ]; then sudo="sudo"; fi
if ! command -v wine >/dev/null 2>&1; then
if command -v apt-get >/dev/null 2>&1; then
${sudo} apt-get update
${sudo} apt-get install -y wine64 || ${sudo} apt-get install -y wine
fi
fi
if ! command -v wine >/dev/null 2>&1 && command -v wine64 >/dev/null 2>&1; then
${sudo} ln -sf "$(command -v wine64)" /usr/local/bin/wine
fi
if ! command -v wine >/dev/null 2>&1; then if ! command -v wine >/dev/null 2>&1; then
echo "wine is required to run the Windows test executables" >&2 echo "wine is required to run the Windows test executables" >&2
exit 1 exit 1