build(windows): fix gcc15 compatibility (#3946)

This commit is contained in:
ReenigneArcher
2025-06-07 16:29:45 -04:00
committed by GitHub
parent 0de8cc864c
commit 1938385bf0
4 changed files with 55 additions and 33 deletions

View File

@@ -864,48 +864,61 @@ jobs:
- name: Update Windows dependencies
env:
gcc_version: "14.2.0-3"
MSYSTEM: "ucrt64"
TOOLCHAIN: "ucrt-x86_64"
shell: msys2 {0}
run: |
broken_deps=(
"mingw-w64-ucrt-x86_64-gcc"
"mingw-w64-ucrt-x86_64-gcc-libs"
# variables
declare -A pinned_deps
# dependencies
dependencies=(
"git"
"mingw-w64-${TOOLCHAIN}-cmake"
"mingw-w64-${TOOLCHAIN}-cppwinrt"
"mingw-w64-${TOOLCHAIN}-curl-winssl"
"mingw-w64-${TOOLCHAIN}-gcc"
"mingw-w64-${TOOLCHAIN}-graphviz"
"mingw-w64-${TOOLCHAIN}-MinHook"
"mingw-w64-${TOOLCHAIN}-miniupnpc"
"mingw-w64-${TOOLCHAIN}-nlohmann-json"
"mingw-w64-${TOOLCHAIN}-nodejs"
"mingw-w64-${TOOLCHAIN}-nsis"
"mingw-w64-${TOOLCHAIN}-onevpl"
"mingw-w64-${TOOLCHAIN}-openssl"
"mingw-w64-${TOOLCHAIN}-opus"
"mingw-w64-${TOOLCHAIN}-toolchain"
)
tarballs=""
for dep in "${broken_deps[@]}"; do
tarball="${dep}-${gcc_version}-any.pkg.tar.zst"
# do not modify below this line
# download and install working version
wget https://repo.msys2.org/mingw/ucrt64/${tarball}
ignore_packages=()
tarballs=""
for pkg in "${!pinned_deps[@]}"; do
ignore_packages+=("${pkg}")
version="${pinned_deps[$pkg]}"
tarball="${pkg}-${version}-any.pkg.tar.zst"
# download working version
wget "https://repo.msys2.org/mingw/${MSYSTEM}/${tarball}"
tarballs="${tarballs} ${tarball}"
done
# install broken dependencies
# Create the ignore string for pacman
ignore_list=$(IFS=,; echo "${ignore_packages[*]}")
# install pinned dependencies
if [ -n "$tarballs" ]; then
pacman -U --noconfirm ${tarballs}
fi
# install dependencies
dependencies=(
"git"
"mingw-w64-ucrt-x86_64-cmake"
"mingw-w64-ucrt-x86_64-cppwinrt"
"mingw-w64-ucrt-x86_64-curl-winssl"
"mingw-w64-ucrt-x86_64-graphviz"
"mingw-w64-ucrt-x86_64-MinHook"
"mingw-w64-ucrt-x86_64-miniupnpc"
"mingw-w64-ucrt-x86_64-nlohmann-json"
"mingw-w64-ucrt-x86_64-nodejs"
"mingw-w64-ucrt-x86_64-nsis"
"mingw-w64-ucrt-x86_64-onevpl"
"mingw-w64-ucrt-x86_64-openssl"
"mingw-w64-ucrt-x86_64-opus"
"mingw-w64-ucrt-x86_64-toolchain"
)
pacman -Syu --noconfirm --ignore="$(IFS=,; echo "${broken_deps[*]}")" "${dependencies[@]}"
# Only add --ignore if we have packages to ignore
if [ -n "$ignore_list" ]; then
pacman -Syu --noconfirm --ignore="${ignore_list}" "${dependencies[@]}"
else
pacman -Syu --noconfirm "${dependencies[@]}"
fi
- name: Install Doxygen
# GCC compiled doxygen has issues when running graphviz