ci(windows): use the prebuilt MinGW-w64 GCC 16 UCRT cross toolchain
VoidBuildSystem CI / 1 · Requirements (push) Successful in 9s
VoidBuildSystem CI / 2B · Windows Wine build (relwithdebinfo) (push) Failing after 32s
VoidBuildSystem CI / 2B · Windows Wine build (debug) (push) Failing after 32s
VoidBuildSystem CI / 3B · Windows Wine test (debug) (push) Skipped
VoidBuildSystem CI / 3B · Windows Wine test (relwithdebinfo) (push) Skipped
VoidBuildSystem CI / 4B · Windows package (debug) (push) Skipped
VoidBuildSystem CI / 4B · Windows package (relwithdebinfo) (push) Skipped
VoidBuildSystem CI / 2A · Linux build (debug) (push) Successful in 2m39s
VoidBuildSystem CI / 2A · Linux build (sanitizers) (push) Successful in 3m27s
VoidBuildSystem CI / 2A · Linux build (relwithdebinfo) (push) Successful in 5m44s
VoidBuildSystem CI / 3A · Linux test (debug) (push) Canceled after 0s
VoidBuildSystem CI / 3A · Linux test (relwithdebinfo) (push) Canceled after 0s
VoidBuildSystem CI / 3A · Linux test (sanitizers) (push) Canceled after 0s
VoidBuildSystem CI / 4A · Linux package (debug) (push) Canceled after 0s
VoidBuildSystem CI / 4A · Linux package (relwithdebinfo) (push) Canceled after 0s
VoidBuildSystem CI / 4A · Linux package (sanitizers) (push) Canceled after 0s
VoidBuildSystem CI / 5 · Release (push) Skipped
VoidBuildSystem CI / 1 · Requirements (push) Successful in 9s
VoidBuildSystem CI / 2B · Windows Wine build (relwithdebinfo) (push) Failing after 32s
VoidBuildSystem CI / 2B · Windows Wine build (debug) (push) Failing after 32s
VoidBuildSystem CI / 3B · Windows Wine test (debug) (push) Skipped
VoidBuildSystem CI / 3B · Windows Wine test (relwithdebinfo) (push) Skipped
VoidBuildSystem CI / 4B · Windows package (debug) (push) Skipped
VoidBuildSystem CI / 4B · Windows package (relwithdebinfo) (push) Skipped
VoidBuildSystem CI / 2A · Linux build (debug) (push) Successful in 2m39s
VoidBuildSystem CI / 2A · Linux build (sanitizers) (push) Successful in 3m27s
VoidBuildSystem CI / 2A · Linux build (relwithdebinfo) (push) Successful in 5m44s
VoidBuildSystem CI / 3A · Linux test (debug) (push) Canceled after 0s
VoidBuildSystem CI / 3A · Linux test (relwithdebinfo) (push) Canceled after 0s
VoidBuildSystem CI / 3A · Linux test (sanitizers) (push) Canceled after 0s
VoidBuildSystem CI / 4A · Linux package (debug) (push) Canceled after 0s
VoidBuildSystem CI / 4A · Linux package (relwithdebinfo) (push) Canceled after 0s
VoidBuildSystem CI / 4A · Linux package (sanitizers) (push) Canceled after 0s
VoidBuildSystem CI / 5 · Release (push) Skipped
The runner only ships apt's MinGW-w64 GCC 10, which cannot compile C++26 reflection. install-mingw.sh now downloads AmanoTeam's mingw-gcc-cross gcc-16 release (x86_64 Linux host, GCC 16.2.1 with -freflection) into /opt and the Wine build uses its CMake toolchain file. The _WIN32_WINNT/NTDDI_VERSION target level is set for Windows so MinGW headers declare the APIs VoidLibrary uses (e.g. DUPLICATE_EXTENTS_DATA). Verified locally: all Windows targets build with this toolchain, vbs runs under Wine and the SDK suite passes 17/17.
This commit is contained in:
1 parent
951b55f67e
commit
67b89c7d3a
4 files changed
+35
-96
No files matched your search
@@ -1,14 +0,0 @@
|
|||||||
# Cross-compiles VoidBuildSystem for 64-bit Windows with MinGW-w64.
|
|
||||||
# Used by the Wine CI lane: the executables are run under Wine 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)
|
|
||||||
|
|
||||||
# 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)
|
|
||||||
@@ -1,85 +1,33 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Ensures a C++26-capable MinGW-w64 cross compiler (GCC >= 16).
|
# 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).
|
||||||
#
|
#
|
||||||
# Tries, in order: the toolchain already on PATH, the project's Nix
|
# Usage: install-mingw.sh [PREFIX] (default /opt/mingw-gcc-cross)
|
||||||
# environment (`dev cpp-gcc -p pkgsCross.mingwW64.stdenv.cc`), and the
|
|
||||||
# distribution package. Fails explicitly when none provides GCC 16.
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
minimum=16
|
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_major() {
|
if [ -x "${prefix}/bin/x86_64-w64-mingw32-ucrt-g++" ]; then
|
||||||
local compiler="${1:-x86_64-w64-mingw32-g++}"
|
echo "using the existing MinGW-w64 toolchain at ${prefix}"
|
||||||
command -v "${compiler}" >/dev/null 2>&1 || {
|
else
|
||||||
echo 0
|
|
||||||
return
|
|
||||||
}
|
|
||||||
# MinGW prints e.g. "10-win32": keep only the leading major number.
|
|
||||||
"${compiler}" -dumpversion 2>/dev/null | sed -nE 's/^([0-9]+).*/\1/p' | head -n1 ||
|
|
||||||
echo 0
|
|
||||||
}
|
|
||||||
|
|
||||||
compatible() {
|
|
||||||
[ "${1:-0}" -ge "${minimum}" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
report() {
|
|
||||||
local major
|
|
||||||
major="$(compiler_major)"
|
|
||||||
if compatible "${major}"; then
|
|
||||||
echo "using MinGW-w64 $(x86_64-w64-mingw32-g++ --version | head -n1)"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
if report; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# The project environment provides the cross toolchain through its dev shell.
|
|
||||||
if command -v dev >/dev/null 2>&1; then
|
|
||||||
echo "trying the project dev environment for MinGW-w64 GCC ${minimum}+"
|
|
||||||
nix_path="$(dev cpp-gcc -p pkgsCross.mingwW64.stdenv.cc -c sh -c 'printf %s "$PATH"' \
|
|
||||||
2>/dev/null | tr -d '\r' | tail -n1 || true)"
|
|
||||||
if [ -n "${nix_path:-}" ]; then
|
|
||||||
export PATH="${nix_path}:${PATH}"
|
|
||||||
hash -r
|
|
||||||
fi
|
|
||||||
if report; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Nix, when the runner has it.
|
|
||||||
if command -v nix >/dev/null 2>&1; then
|
|
||||||
echo "trying nix for MinGW-w64 GCC ${minimum}+"
|
|
||||||
if nix shell --command true nixpkgs#pkgsCross.mingwW64.stdenv.cc >/dev/null 2>&1; then
|
|
||||||
nix_path="$(nix shell --command sh -c 'printf %s "$PATH"' \
|
|
||||||
nixpkgs#pkgsCross.mingwW64.stdenv.cc 2>/dev/null | tail -n1 || true)"
|
|
||||||
if [ -n "${nix_path:-}" ]; then
|
|
||||||
export PATH="${nix_path}:${PATH}"
|
|
||||||
hash -r
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if report; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Distribution package (may be older than GCC 16).
|
|
||||||
if command -v apt-get >/dev/null 2>&1; then
|
|
||||||
sudo=""
|
sudo=""
|
||||||
if [ "$(id -u)" -ne 0 ]; then sudo="sudo"; fi
|
if [ "$(id -u)" -ne 0 ]; then sudo="sudo"; fi
|
||||||
${sudo} apt-get update || true
|
tmp="$(mktemp -d)"
|
||||||
${sudo} apt-get install -y mingw-w64 || true
|
trap 'rm -rf "${tmp}"' EXIT
|
||||||
hash -r
|
if command -v curl >/dev/null 2>&1; then
|
||||||
if report; then
|
curl -fsSL "${url}" -o "${tmp}/toolchain.tar.xz"
|
||||||
exit 0
|
else
|
||||||
|
wget -qO "${tmp}/toolchain.tar.xz" "${url}"
|
||||||
fi
|
fi
|
||||||
|
mkdir -p "${tmp}/toolchain"
|
||||||
|
tar -xJf "${tmp}/toolchain.tar.xz" -C "${tmp}/toolchain" --strip-components=1
|
||||||
|
${sudo} rm -rf "${prefix}"
|
||||||
|
${sudo} mkdir -p "${prefix}"
|
||||||
|
${sudo} cp -a "${tmp}/toolchain/." "${prefix}/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "MinGW-w64 GCC ${minimum} or newer is required to build VBS for Windows" >&2
|
"${prefix}/bin/x86_64-w64-mingw32-ucrt-g++" --version | head -n1
|
||||||
echo "(C++26 reflection); found $(compiler_major). Install it on the runner image" >&2
|
echo "toolchain file: ${prefix}/usr/local/share/mingw/cmake/x86_64-w64-mingw32-ucrt.cmake"
|
||||||
echo "or provide it through the project's dev environment." >&2
|
|
||||||
exit 1
|
|
||||||
@@ -254,22 +254,22 @@ jobs:
|
|||||||
build_type: RelWithDebInfo
|
build_type: RelWithDebInfo
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install the MinGW-w64 cross toolchain
|
- name: Install the MinGW-w64 GCC 16 cross toolchain
|
||||||
run: bash .gitea/scripts/install-mingw.sh
|
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="$PWD/.gitea/cmake/mingw-w64-toolchain.cmake" \
|
-DCMAKE_TOOLCHAIN_FILE=/opt/mingw-gcc-cross/usr/local/share/mingw/cmake/x86_64-w64-mingw32-ucrt.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++-6.dll libgcc_s_seh-1.dll libwinpthread-1.dll; do
|
for lib in libstdc++.dll libgcc_s_seh.dll libwinpthread.dll; do
|
||||||
resolved="$(x86_64-w64-mingw32-g++ -print-file-name="${lib}")"
|
if [ -f "/opt/mingw-gcc-cross/x86_64-w64-mingw32-ucrt/lib/${lib}" ]; then
|
||||||
if [ -f "${resolved}" ]; then
|
cp "/opt/mingw-gcc-cross/x86_64-w64-mingw32-ucrt/lib/${lib}" \
|
||||||
cp "${resolved}" "build/wine-${{ matrix.variant }}/bin/"
|
"build/wine-${{ matrix.variant }}/bin/"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
- name: Upload the build
|
- name: Upload the build
|
||||||
|
|||||||
@@ -19,6 +19,11 @@ option(VBS_BUILD_TESTS "Build declaration SDK and native engine test suites" ON)
|
|||||||
option(VBS_BUILD_BENCHMARKS "Build reproducible VBS benchmark harness" ON)
|
option(VBS_BUILD_BENCHMARKS "Build reproducible VBS benchmark harness" ON)
|
||||||
set(VBS_VOID_SOURCE_DIR "" CACHE PATH "Development-only VoidLibrary source override (bypasses pin)")
|
set(VBS_VOID_SOURCE_DIR "" CACHE PATH "Development-only VoidLibrary source override (bypasses pin)")
|
||||||
set(VBS_VOID_REVISION "de1fdcda72ddd6ac069fba433b13f643327efa3f")
|
set(VBS_VOID_REVISION "de1fdcda72ddd6ac069fba433b13f643327efa3f")
|
||||||
|
if(WIN32)
|
||||||
|
# Target Windows 10 APIs: MinGW headers only declare e.g. DUPLICATE_EXTENTS_DATA
|
||||||
|
# (used by VoidLibrary's reflink copy) at a modern _WIN32_WINNT/NTDDI_VERSION.
|
||||||
|
add_compile_definitions(_WIN32_WINNT=0x0A00 NTDDI_VERSION=0x0A000000)
|
||||||
|
endif()
|
||||||
include(cmake/VoidDependency.cmake)
|
include(cmake/VoidDependency.cmake)
|
||||||
vbs_add_void_dependency()
|
vbs_add_void_dependency()
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user