ci: replace the native Windows lane with a packaged Wine build
VoidBuildSystem CI / 1 · Requirements (push) Successful in 10s
VoidBuildSystem CI / 2B · Windows Wine build (relwithdebinfo) (push) Failing after 48s
VoidBuildSystem CI / 2B · Windows Wine build (debug) (push) Failing after 50s
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 3m18s
VoidBuildSystem CI / 2A · Linux build (sanitizers) (push) Successful in 3m36s
VoidBuildSystem CI / 2A · Linux build (relwithdebinfo) (push) Successful in 4m41s
VoidBuildSystem CI / 3A · Linux test (sanitizers) (push) Successful in 1m42s
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 / 3A · Linux test (debug) (push) Canceled after 8m56s
VoidBuildSystem CI / 3A · Linux test (relwithdebinfo) (push) Canceled after 8m57s

Drop the MSYS2/native Windows jobs (and their script): the Windows
lane now cross-compiles VBS with MinGW-w64 on the Linux runner, runs
the Windows test executables under Wine and packages the Windows
binaries, SDK and headers. The release takes the RelWithDebInfo
packages from the Linux and the Wine lanes.

The MinGW runtime DLLs are staged next to the executables so Wine can
load them, and the build job fails explicitly when the runner's
MinGW-w64 is older than GCC 16 (C++26 is required).
This commit is contained in:
faumaray committed 2026-12-06 06:33:48 +03:00
1 parent 756fbb9a6b
commit d5f2974cdd
3 files changed
+110 -279

No files matched your search

-122
View File
@@ -1,122 +0,0 @@
#!/usr/bin/env bash
# Native Windows lane for one variant, driven inside MSYS2 UCRT64.
#
# windows-native.sh build <variant> <build_type> configure + build
# windows-native.sh test <variant> <build_type> run CTest
# windows-native.sh package <variant> <build_type> package the build outputs
#
# Track C3 caveat: the VBS platform backends are Linux-only today and
# VoidLibrary does not qualify Archive/Configuration/Crypto/System for Windows
# yet (Void/Library issue #65), so this lane fails until that port lands.
set -euo pipefail
phase="${1:?phase (build or test)}"
variant="${2:?variant}"
build_type="${3:?build type}"
# The script is piped through `bash -s`, so $0 is "bash": locate the checkout
# through GITHUB_WORKSPACE (set by the runner) instead of the script path.
workspace="${GITHUB_WORKSPACE:-$(pwd)}"
if command -v cygpath >/dev/null 2>&1; then
workspace="$(cygpath -u "${workspace}")"
# The runner gives every job a different workspace directory while build
# artifacts embed absolute paths. Work through one stable junction per
# run+variant so the build, test and package jobs share identical paths and
# artifacts can be reused instead of rebuilt. /tmp is the MSYS2 temp dir,
# which persists across the jobs of a run.
stable_win="$(cygpath -w "/tmp/vbs-ci/${GITHUB_RUN_ID:-local}/${variant}")"
stable="$(cygpath -u "${stable_win}")"
mkdir -p "$(dirname "${stable}")"
cmd //c "rmdir \"${stable_win}\"" >/dev/null 2>&1 || true
junction_output="$(cmd //c "mklink /J \"${stable_win}\" \"$(cygpath -w "${workspace}")\"" 2>&1 || true)"
if [ -d "${stable}" ]; then
workspace="${stable}"
else
echo "warning: cannot create the stable junction '${stable_win}': ${junction_output}" >&2
fi
fi
cd "${workspace}"
echo "workspace: $(pwd)"
build="build/windows-${variant}"
# Make sure the UCRT64 environment provides the build tools.
if ! command -v cmake >/dev/null 2>&1 || ! command -v ninja >/dev/null 2>&1; then
if command -v pacman >/dev/null 2>&1; then
pacman -S --noconfirm --needed \
mingw-w64-ucrt-x86_64-cmake \
mingw-w64-ucrt-x86_64-ninja \
mingw-w64-ucrt-x86_64-gcc
fi
fi
cxx_flags=""
linker_flags=""
if [ "${variant}" = "sanitizers" ]; then
cxx_flags="-fsanitize=address,undefined -fno-omit-frame-pointer"
linker_flags="-fsanitize=address,undefined"
fi
configure() {
cmake -S . -B "${build}" -G Ninja \
-DCMAKE_BUILD_TYPE="${build_type}" \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_CXX_FLAGS="${cxx_flags}" \
-DCMAKE_EXE_LINKER_FLAGS="${linker_flags}" \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
}
# Reuses a restored build only when it was generated at this exact path;
# otherwise drops it (a CMake cache cannot be moved) and configures fresh.
prepare_build() {
if [ -f "${build}/CMakeCache.txt" ]; then
cached_root="$(sed -n 's/^CMAKE_HOME_DIRECTORY:INTERNAL=//p' "${build}/CMakeCache.txt" | head -n1)"
current_root="$(cygpath -m "$(pwd)" 2>/dev/null || pwd)"
cached_lower="$(printf '%s' "${cached_root}" | tr '[:upper:]' '[:lower:]')"
current_lower="$(printf '%s' "${current_root}" | tr '[:upper:]' '[:lower:]')"
if [ -n "${cached_root}" ] && [ "${cached_lower}" != "${current_lower}" ]; then
echo "discarding a build generated at '${cached_root}' (now '${current_root}')"
rm -rf "${build}"
fi
fi
if [ ! -f "${build}/CMakeCache.txt" ]; then
configure
fi
}
case "${phase}" in
build)
configure
cmake --build "${build}" --parallel 4
;;
test)
prepare_build
cmake --build "${build}" --parallel 4
ctest --test-dir "${build}" --output-on-failure --no-tests=error
;;
package)
prepare_build
cmake --build "${build}" --parallel 4
out="dist-windows-${variant}"
label="${VBS_RELEASE_TAG:-}"
if [ -z "${label}" ]; then
case "${GITHUB_REF_NAME:-}" in
v*) label="${GITHUB_REF_NAME}" ;;
*) label="dev-$(printf '%s' "${GITHUB_SHA:-local}" | cut -c1-7)" ;;
esac
fi
stage="$(mktemp -d)"
mkdir -p "${stage}/bin" "${stage}/include" "${stage}/lib" "${out}"
cp "${build}"/bin/*.exe "${stage}/bin/" 2>/dev/null || true
cp -r include/Void "${stage}/include/"
find "${build}" -maxdepth 1 -name 'libVoidBuild_Sdk.a' -exec cp {} "${stage}/lib/" \;
cp README.md LICENSE "${stage}/"
tar -czf "${out}/vbs-${label}-windows-x86_64-${variant}.tar.gz" -C "${stage}" .
ls -l "${out}/"
;;
*)
echo "unknown phase '${phase}' (expected build, test or package)" >&2
exit 2
;;
esac