gitlab-ci, build: Move to Clang in Windows (native)

This makes possible to use the Universal C library provided by Microsoft.
This commit is contained in:
Bruno Lopes 2024-03-04 14:47:14 -03:00
parent 5542748779
commit e89bca35c7
3 changed files with 28 additions and 27 deletions

View file

@ -813,7 +813,7 @@ deps-win-x64:
stage: dependencies
variables:
BUILD_TYPE: "CI_NATIVE"
MSYSTEM: "MINGW64"
MSYSTEM: "CLANG64"
CHERE_INVOKING: "yes"
tags:
- win32-ps
@ -841,13 +841,15 @@ gimp-win-x64:
stage: gimp
variables:
BUILD_TYPE: "CI_NATIVE"
MSYSTEM: "MINGW64"
MSYSTEM: "CLANG64"
CHERE_INVOKING: "yes"
tags:
- win32-ps
before_script:
- C:\msys64\usr\bin\pacman --noconfirm -Syyuu
script:
# Temporary patch until we use the LLVM 18.
- git apply ./build/windows/patches/0001-clang-rc-files-fix.patch
- C:\msys64\usr\bin\bash -lc "bash -x ./build/windows/gitlab-ci/2_build-gimp-msys2.sh"
artifacts:
name: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHORT_SHA}"
@ -872,7 +874,7 @@ packaging-win-x64:
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*5. Windows Installer.*/'
stage: packaging
variables:
MSYSTEM: "MINGW64"
MSYSTEM: "CLANG64"
CHERE_INVOKING: "yes"
tags:
- win32-ps

View file

@ -34,21 +34,28 @@ DEPS_LIST=$(cat ${GIMP_DIR}build/windows/gitlab-ci/all-deps-uni.txt)
DEPS_LIST=$(sed "s/\${MINGW_PACKAGE_PREFIX}-/${MINGW_PACKAGE_PREFIX}-/g" <<< $DEPS_LIST)
DEPS_LIST=$(sed 's/\\//g' <<< $DEPS_LIST)
retry=3
while [ $retry -gt 0 ]; do
timeout --signal=KILL 3m pacman --noconfirm -S --needed git \
base-devel \
${MINGW_PACKAGE_PREFIX}-toolchain \
$DEPS_LIST && break
echo "MSYS2 pacman timed out. Trying again."
taskkill //t //F //IM "pacman.exe"
rm -f c:/msys64/var/lib/pacman/db.lck
: $((--retry))
done
if [[ "$MSYSTEM_CARCH" == "aarch64" ]]; then
retry=3
while [ $retry -gt 0 ]; do
timeout --signal=KILL 3m pacman --noconfirm -S --needed git \
base-devel \
${MINGW_PACKAGE_PREFIX}-toolchain \
$DEPS_LIST && break
echo "MSYS2 pacman timed out. Trying again."
taskkill //t //F //IM "pacman.exe"
rm -f c:/msys64/var/lib/pacman/db.lck
: $((--retry))
done
if [ $retry -eq 0 ]; then
echo "MSYS2 pacman repeatedly failed. See: https://github.com/msys2/MSYS2-packages/issues/4340"
exit 1
if [ $retry -eq 0 ]; then
echo "MSYS2 pacman repeatedly failed. See: https://github.com/msys2/MSYS2-packages/issues/4340"
exit 1
fi
else
pacman --noconfirm -S --needed git \
base-devel \
${MINGW_PACKAGE_PREFIX}-toolchain \
$DEPS_LIST
fi
# End of install

View file

@ -1,16 +1,8 @@
#!/bin/bash
if [[ "$MSYSTEM" == "CLANGARM64" ]]; then
# Apparently -v is unknown argument for clangarm64 version of objcopy.exe.
export OBJCOPY_OPTIONS=""
else
export OBJCOPY_OPTIONS="-v"
fi
# Generate .debug
find . \( -iname '*.dll' -or -iname '*.exe' -or -iname '*.pyd' \) -type f -exec objcopy ${OBJCOPY_OPTIONS} --only-keep-debug '{}' '{}'.debug \;
find . \( -iname '*.dll' -or -iname '*.exe' -or -iname '*.pyd' \) -type f -exec objcopy ${OBJCOPY_OPTIONS} --add-gnu-debuglink='{}'.debug '{}' --strip-unneeded \;
find . \( -iname '*.dll' -or -iname '*.exe' -or -iname '*.pyd' \) -type f -exec objcopy --only-keep-debug '{}' '{}'.debug \;
find . \( -iname '*.dll' -or -iname '*.exe' -or -iname '*.pyd' \) -type f -exec objcopy --add-gnu-debuglink='{}'.debug '{}' --strip-unneeded \;
# Copy .debug to .debug folder
dbgList=$(find . -iname '*.debug') && dbgArray=($dbgList)