gitlab-ci, build: Drop crossbuilds since they only make sense on Fedora

With grave on heart I am dropping crosbuilds. Always liked them but
actually our crossbuids on Debian are flawed on either GCC or Clang
(with linking either to UCRT or MSVCRT, I tested all possibilities).

The main problem is that Debian does not provide the runtime deps
(unlike Fedora) so we use from MSYS2. This fact tends to cause:
- Linking problems due to undefined references on compiler: #11756
- Clash between Windows runtime and Linux build-time deps: #12970

Worst, these bugs historically are rarely spotted or fixed at all.
Some of them took weeks and even months(!) to be reported by us and,
in the end, there is only one or two guys to do this: me and Jehan.
I do rather prefer to improve native builds than spending more and
more time on fixing crossbuilds without effectively using them.
This commit is contained in:
Bruno Lopes 2025-04-13 10:55:47 -03:00
parent 2ed959ed7c
commit ea89353fd7
No known key found for this signature in database
3 changed files with 29 additions and 315 deletions

View file

@ -52,7 +52,6 @@ workflow:
## In addition to the variables above, to force step-specific pipelines
## without waiting for commits and/or schedules, these you should set on GUI:
## - GIMP_CI_MESON_CLANG: trigger the Debian Clang build.
## - GIMP_CI_CROSSROAD_WIN64: trigger the crossroad build for Win 64-bit.
## - GIMP_CI_MSYS2_WIN_AARCH64: trigger the native MSYS2 build for Win Aarch64.
## - GIMP_CI_MSYS2_WIN64: trigger the native MSYS2 build for Win 64-bit.
## - GIMP_CI_MSYS2_WIN32: trigger the native MSYS2 build for Win 32-bit.
@ -211,33 +210,34 @@ deps-debian:
python3-gi
python3-gi-cairo" >> Dockerfile
- echo "RUN echo -e \"\e[0Ksection_end:0000000002:deps_install\r\e[0K\"" >> Dockerfile
# Build some deps
- if [[ ! "$CI_JOB_NAME" =~ 'cross' ]]; then
echo "FROM $CI_REGISTRY_IMAGE:build-debian-${DEB_VERSION}-${RUNNER}" > Dockerfile2;
echo "RUN echo -e \"\e[0Ksection_start:`date +%s`:environ[collapsed=true]\r\e[0KPreparing build environment\"" >> Dockerfile2;
export LIB_DIR="lib";
export LIB_SUBDIR=$([ "$(uname -m)" = 'aarch64' ] && echo "aarch64-linux-gnu/" || echo "x86_64-linux-gnu/");
echo "ENV PKG_CONFIG_PATH=\"${GIMP_PREFIX}/${LIB_DIR}/${LIB_SUBDIR}pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}\"" >> Dockerfile2;
echo "ENV XDG_DATA_DIRS=\"${GIMP_PREFIX}/share:/usr/share${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}\"" >> Dockerfile2;
echo "ENV CC=\"$CC\"" >> Dockerfile2;
echo "ENV CXX=\"$CXX\"" >> Dockerfile2;
echo "ENV CC_LD=\"$CC_LD\"" >> Dockerfile2;
echo "ENV CXX_LD=\"$CXX_LD\"" >> Dockerfile2;
echo "ENV CLICOLOR_FORCE=\"1\"" >> Dockerfile2;
echo "RUN echo -e \"\e[0Ksection_end:`date +%s`:environ\r\e[0K\"" >> Dockerfile2;
echo "RUN echo -e \"\e[0Ksection_start:`date +%s`:babl_build[collapsed=true]\r\e[0KBuilding babl\"" >> Dockerfile2;
echo "RUN git clone --branch \"\$([ \"$CI_COMMIT_TAG\" ] && echo \"\$(git ls-remote --tags --exit-code --refs https://gitlab.gnome.org/GNOME/babl.git | grep -oi \"BABL_[0-9]*_[0-9]*_[0-9]*\" | sort --version-sort | tail -1)\" || echo \"master\")\" --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/babl.git" $CI_PROJECT_DIR/babl >> Dockerfile2;
echo "RUN meson setup $CI_PROJECT_DIR/babl/_build-${RUNNER} $CI_PROJECT_DIR/babl -Dprefix=\"${GIMP_PREFIX}\" $PKGCONF_RELOCATABLE_OPTION" >> Dockerfile2;
echo "RUN ninja -C $CI_PROJECT_DIR/babl/_build-${RUNNER}" >> Dockerfile2;
echo "RUN ninja -C $CI_PROJECT_DIR/babl/_build-${RUNNER} install" >> Dockerfile2;
echo "RUN echo -e \"\e[0Ksection_end:`date +%s`:babl_build\r\e[0K\"" >> Dockerfile2;
echo "RUN echo -e \"\e[0Ksection_start:`date +%s`:gegl_build[collapsed=true]\r\e[0KBuilding gegl\"" >> Dockerfile2;
echo "RUN git clone --branch \"\$([ \"$CI_COMMIT_TAG\" ] && echo \"\$(git ls-remote --tags --exit-code --refs https://gitlab.gnome.org/GNOME/gegl.git | grep -oi \"GEGL_[0-9]*_[0-9]*_[0-9]*\" | sort --version-sort | tail -1)\" || echo \"master\")\" --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/gegl.git" $CI_PROJECT_DIR/gegl >> Dockerfile2;
echo "RUN meson setup $CI_PROJECT_DIR/gegl/_build-${RUNNER} $CI_PROJECT_DIR/gegl -Dprefix=\"${GIMP_PREFIX}\" $PKGCONF_RELOCATABLE_OPTION $WORKSHOP_OPTION" >> Dockerfile2;
echo "RUN ninja -C $CI_PROJECT_DIR/gegl/_build-${RUNNER}" >> Dockerfile2;
echo "RUN ninja -C $CI_PROJECT_DIR/gegl/_build-${RUNNER} install" >> Dockerfile2;
echo "RUN echo -e \"\e[0Ksection_end:`date +%s`:gegl_build\r\e[0K\"" >> Dockerfile2;
fi
# Prepare environ
- echo "FROM $CI_REGISTRY_IMAGE:build-debian-${DEB_VERSION}-${RUNNER}" > Dockerfile2;
- echo "RUN echo -e \"\e[0Ksection_start:`date +%s`:environ[collapsed=true]\r\e[0KPreparing build environment\"" >> Dockerfile2;
- export LIB_DIR="lib";
- export LIB_SUBDIR=$([ "$(uname -m)" = 'aarch64' ] && echo "aarch64-linux-gnu/" || echo "x86_64-linux-gnu/");
- echo "ENV PKG_CONFIG_PATH=\"${GIMP_PREFIX}/${LIB_DIR}/${LIB_SUBDIR}pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}\"" >> Dockerfile2;
- echo "ENV XDG_DATA_DIRS=\"${GIMP_PREFIX}/share:/usr/share${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}\"" >> Dockerfile2;
- echo "ENV CC=\"$CC\"" >> Dockerfile2;
- echo "ENV CXX=\"$CXX\"" >> Dockerfile2;
- echo "ENV CC_LD=\"$CC_LD\"" >> Dockerfile2;
- echo "ENV CXX_LD=\"$CXX_LD\"" >> Dockerfile2;
- echo "ENV CLICOLOR_FORCE=\"1\"" >> Dockerfile2;
- echo "RUN echo -e \"\e[0Ksection_end:`date +%s`:environ\r\e[0K\"" >> Dockerfile2;
# Build some dependencies
## Build babl
- echo "RUN echo -e \"\e[0Ksection_start:`date +%s`:babl_build[collapsed=true]\r\e[0KBuilding babl\"" >> Dockerfile2;
- echo "RUN git clone --branch \"\$([ \"$CI_COMMIT_TAG\" ] && echo \"\$(git ls-remote --tags --exit-code --refs https://gitlab.gnome.org/GNOME/babl.git | grep -oi \"BABL_[0-9]*_[0-9]*_[0-9]*\" | sort --version-sort | tail -1)\" || echo \"master\")\" --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/babl.git" $CI_PROJECT_DIR/babl >> Dockerfile2;
- echo "RUN meson setup $CI_PROJECT_DIR/babl/_build-${RUNNER} $CI_PROJECT_DIR/babl -Dprefix=\"${GIMP_PREFIX}\" $PKGCONF_RELOCATABLE_OPTION" >> Dockerfile2;
- echo "RUN ninja -C $CI_PROJECT_DIR/babl/_build-${RUNNER}" >> Dockerfile2;
- echo "RUN ninja -C $CI_PROJECT_DIR/babl/_build-${RUNNER} install" >> Dockerfile2;
- echo "RUN echo -e \"\e[0Ksection_end:`date +%s`:babl_build\r\e[0K\"" >> Dockerfile2;
## Build GEGL
- echo "RUN echo -e \"\e[0Ksection_start:`date +%s`:gegl_build[collapsed=true]\r\e[0KBuilding gegl\"" >> Dockerfile2;
- echo "RUN git clone --branch \"\$([ \"$CI_COMMIT_TAG\" ] && echo \"\$(git ls-remote --tags --exit-code --refs https://gitlab.gnome.org/GNOME/gegl.git | grep -oi \"GEGL_[0-9]*_[0-9]*_[0-9]*\" | sort --version-sort | tail -1)\" || echo \"master\")\" --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/gegl.git" $CI_PROJECT_DIR/gegl >> Dockerfile2;
- echo "RUN meson setup $CI_PROJECT_DIR/gegl/_build-${RUNNER} $CI_PROJECT_DIR/gegl -Dprefix=\"${GIMP_PREFIX}\" $PKGCONF_RELOCATABLE_OPTION $WORKSHOP_OPTION" >> Dockerfile2;
- echo "RUN ninja -C $CI_PROJECT_DIR/gegl/_build-${RUNNER}" >> Dockerfile2;
- echo "RUN ninja -C $CI_PROJECT_DIR/gegl/_build-${RUNNER} install" >> Dockerfile2;
- echo "RUN echo -e \"\e[0Ksection_end:`date +%s`:gegl_build\r\e[0K\"" >> Dockerfile2;
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:build-debian-${DEB_VERSION}-${RUNNER} --cache=true --cache-ttl=120h --image-fs-extract-retry 1 --verbosity=warn
- if [ -f 'Dockerfile2' ]; then /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile2 --destination build-debian-${DEB_VERSION}-${RUNNER}-temp --cache=false --no-push --verbosity=warn; fi
artifacts:
@ -301,7 +301,6 @@ gimp-debian:
variables:
MESON_OPTIONS: "-Dvector-icons=false"
VARIANT: "-raster"
- if: '$GIMP_CI_CROSSROAD_WIN64 != null'
- if: '$GIMP_CI_SOURCES != null'
- <<: *CI_RELEASE
parallel:
@ -412,62 +411,6 @@ gimp-flatpak-x64:
expire_in: 2 days
## WINDOWS 64-bit CI (cross-build crossroad) ##
.win-cross:
extends: .debian-x64
rules:
- <<: *CI_MERGE
when: never
- <<: *CI_COMMIT
when: never
- if: '$GIMP_CI_CROSSROAD_WIN64 != null'
variables:
MSYSTEM_PREFIX: clang64
#To match Debian Testing compiler with MSYS2 compiler resources
DEB_VERSION: testing
#To avoid noisy 'apt' warnings
DEBIAN_FRONTEND: noninteractive
TERM: dumb
deps-win-x64-cross:
extends: .win-cross
stage: !reference [deps-debian, stage]
image: !reference [deps-debian, image]
variables:
UMFPACK: libumfpack6
#https://gitlab.gnome.org/Infrastructure/Infrastructure/-/issues/1461
#cache:
#key: ${CI_JOB_NAME_SLUG}
#paths:
#- quasi-msys2/
before_script: []
script:
- bash build/windows/1_build-deps-quasimsys2.sh
artifacts:
paths:
- quasi-msys2/
- _install-$MSYSTEM_PREFIX-cross/
- babl/_build-$MSYSTEM_PREFIX-cross/meson-logs/meson-log.txt
- gegl/_build-$MSYSTEM_PREFIX-cross/meson-logs/meson-log.txt
expire_in: 2 hours
gimp-win-x64-cross:
extends: .win-cross
needs: ["deps-win-x64-cross", "gimp-debian-x64"]
stage: gimp
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
- bash build/windows/2_build-gimp-quasimsys2.sh
artifacts:
expose_as: 'Windows zip'
paths:
- gimp-clang64/
- _build-clang64-cross/meson-logs/meson-log.txt
- _build-clang64-cross/done-dll.list
expire_in: 2 days
## WINDOWS pipelines (native MSYS2) ##
.win:
extends: .default
@ -669,7 +612,7 @@ cppcheck:
- apt-get update
- apt-get install -y cppcheck
- cppcheck -q -j8 --enable=all --force --output-file=cppcheck.xml --xml --xml-version=2
-i _build -i _build-cross -i babl -i gegl -i _install -i .local -i .cache -i gimp-x64 .
-i _build -i babl -i gegl -i _install -i .local -i .cache -i gimp-x64 .
- mkdir report
- cppcheck-htmlreport --source-dir=. --title=gimp --file=cppcheck.xml --report-dir=report
artifacts:

View file

@ -1,132 +0,0 @@
#!/bin/sh
set -e
# SHELL ENV
if [ -z "$QUASI_MSYS2_ROOT" ]; then
if [ -z "$GITLAB_CI" ]; then
# Make the script work locally
if [ "$0" != 'build/windows/1_build-deps-quasimsys2.sh' ] && [ ${PWD/*\//} != 'windows' ]; then
echo -e '\033[31m(ERROR)\033[0m: Script called from wrong dir. Please, read: https://developer.gimp.org/core/setup/build/windows/'
exit 1
elif [ ${PWD/*\//} = 'windows' ]; then
cd ../..
fi
export GIT_DEPTH=1
export GIMP_DIR=$(echo "$PWD/")
cd $(dirname $PWD)
fi
## Install quasi-msys2 and its deps
# Beginning of install code block
if [ "$GITLAB_CI" ]; then
apt-get update -y >/dev/null
apt-get install -y --no-install-recommends \
clang \
lld \
llvm >/dev/null
apt-get install -y --no-install-recommends \
gawk \
gpg \
gpgv \
make \
sudo \
tar \
wget \
zstd >/dev/null
fi
# End of install code block
if [ ! -d 'quasi-msys2' ]; then
git clone --depth $GIT_DEPTH https://github.com/HolyBlackCat/quasi-msys2
fi
cd quasi-msys2
git pull
cd ..
## Install the required (pre-built) packages for babl, GEGL and GIMP
echo -e "\e[0Ksection_start:`date +%s`:deps_install[collapsed=true]\r\e[0KInstalling dependencies provided by MSYS2"
echo ${MSYSTEM_PREFIX^^} > quasi-msys2/msystem.txt
deps=$(cat ${GIMP_DIR}build/windows/all-deps-uni.txt | sed 's/toolchain/clang/g' |
sed "s/\${MINGW_PACKAGE_PREFIX}-/_/g" | sed 's/\\//g')
cd quasi-msys2
make install $deps || make install $deps
cd ..
sudo ln -nfs "$PWD/quasi-msys2/root/$MSYSTEM_PREFIX" /$MSYSTEM_PREFIX
## Manually build gio 'giomodule.cache' to fix fatal error about
## absent libgiognutls.dll that prevents generating loaders.cache
echo 'libgiognomeproxy.dll: gio-proxy-resolver
libgiognutls.dll: gio-tls-backend
libgiolibproxy.dll: gio-proxy-resolver
libgioopenssl.dll: gio-tls-backend' > /$MSYSTEM_PREFIX/lib/gio/modules/giomodule.cache
## Manually build pixbuf 'loaders.cache'
## (the reason for pixbuf is on '2_bundle-gimp-uni_base.sh' script)
echo '"lib\\gdk-pixbuf-2.0\\2.10.0\\loaders\\libpixbufloader-png.dll"
"png" 5 "gdk-pixbuf" "PNG" "LGPL"
"image/png" ""
"png" ""
"\211PNG\r\n\032\n" "" 100
"lib\\gdk-pixbuf-2.0\\2.10.0\\loaders\\pixbufloader_svg.dll"
"svg" 6 "gdk-pixbuf" "Scalable Vector Graphics" "LGPL"
"image/svg+xml" "image/svg" "image/svg-xml" "image/vnd.adobe.svg+xml" "text/xml-svg" "image/svg+xml-compressed" ""
"svg" "svgz" "svg.gz" ""
" <svg" "* " 100
" <!DOCTYPE svg" "* " 100
' > $(echo /$MSYSTEM_PREFIX/lib/gdk-pixbuf-*/*/)/loaders.cache
## Manually build glib 'gschemas.compiled'
## (the reason for glib schemas is on '2_bundle-gimp-uni_base.sh' script)
GLIB_PATH=$(echo /$MSYSTEM_PREFIX/share/glib-*/schemas/)
glib-compile-schemas --targetdir=$GLIB_PATH $GLIB_PATH >/dev/null 2>&1
echo -e "\e[0Ksection_end:`date +%s`:deps_install\r\e[0K"
# QUASI-MSYS2 ENV
echo -e "\e[0Ksection_start:`date +%s`:cross_environ[collapsed=true]\r\e[0KPreparing cross-build environment"
bash -c "source quasi-msys2/env/all.src && bash ${GIMP_DIR}build/windows/1_build-deps-quasimsys2.sh"
else
export GIMP_PREFIX="$PWD/_install-$(echo $MSYSTEM_PREFIX | sed 's|/||')-cross"
IFS=$'\n' VAR_ARRAY=($(cat ${GIMP_DIR}.gitlab-ci.yml | sed -n '/multi-os/,/GI_TYPELIB_PATH}\"/p' | sed 's/ - //' | sed '/#/d'))
IFS=$' \t\n'
for VAR in "${VAR_ARRAY[@]}"; do
if [[ ! "$VAR" =~ 'multiarch' ]]; then
unset LIB_SUBDIR
eval "$VAR" || continue
fi
done
echo -e "\e[0Ksection_end:`date +%s`:cross_environ\r\e[0K"
## Build babl and GEGL
self_build ()
{
echo -e "\e[0Ksection_start:`date +%s`:${1}_build[collapsed=true]\r\e[0KBuilding $1"
# Clone source only if not already cloned or downloaded
if [ ! -d "$1" ]; then
git clone --depth $GIT_DEPTH https://gitlab.gnome.org/gnome/$1
fi
cd $1
git pull
if [ ! -f "_build-$(echo $MSYSTEM_PREFIX | sed 's|/||')-cross/build.ninja" ]; then
meson setup _build-$(echo $MSYSTEM_PREFIX | sed 's|/||')-cross -Dprefix="$GIMP_PREFIX" $2
fi
cd _build-$(echo $MSYSTEM_PREFIX | sed 's|/||')-cross
ninja
ninja install
cd ../..
echo -e "\e[0Ksection_end:`date +%s`:${1}_build\r\e[0K"
}
self_build babl '-Denable-gir=false'
self_build gegl '-Dintrospection=false' '-Dworkshop=false'
fi # END OF QUASI-MSYS2 ENV

View file

@ -1,97 +0,0 @@
#!/bin/sh
set -e
# SHELL ENV
if [ -z "$QUASI_MSYS2_ROOT" ]; then
if [ -z "$GITLAB_CI" ]; then
# Make the script work locally
if [ "$0" != 'build/windows/2_build-gimp-quasimsys2.sh' ] && [ ${PWD/*\//} != 'windows' ]; then
echo -e '\033[31m(ERROR)\033[0m: Script called from wrong dir. Please, read: https://developer.gimp.org/core/setup/build/windows/'
exit 1
elif [ ${PWD/*\//} = 'windows' ]; then
cd ../..
fi
git submodule update --init
PARENT_DIR='../'
fi
# FIXME: We need native/Linux gimp-console.
# https://gitlab.gnome.org/GNOME/gimp/-/issues/6393
if [ "$1" ]; then
export BUILD_DIR="$1"
else
export BUILD_DIR=$(echo _build*$RUNNER)
fi
if [ ! -d "$BUILD_DIR" ]; then
echo -e "\033[31m(ERROR)\033[0m: Before running this script, first build GIMP natively in $BUILD_DIR"
fi
if [ "$GITLAB_CI" ]; then
eval "$(grep 'export GIMP_PREFIX' .gitlab-ci.yml | head -1 | sed 's/ - //')" || $true
elif [ -z "$GITLAB_CI" ] && [ -z "$GIMP_PREFIX" ]; then
export GIMP_PREFIX="$PWD/../_install"
fi
if [ ! -d "$GIMP_PREFIX" ]; then
echo -e "\033[31m(ERROR)\033[0m: Before running this script, first install GIMP natively in $GIMP_PREFIX"
fi
if [ ! -d "$BUILD_DIR" ] || [ ! -d "$GIMP_PREFIX" ]; then
echo 'Patches are very welcome: https://gitlab.gnome.org/GNOME/gimp/-/issues/6393'
exit 1
fi
if [ -z $GITLAB_CI ]; then
IFS=$'\n' VAR_ARRAY=($(cat .gitlab-ci.yml | sed -n '/multi-os/,/GI_TYPELIB_PATH}\"/p' | sed 's/ - //' | sed '/#/d'))
IFS=$' \t\n'
for VAR in "${VAR_ARRAY[@]}"; do
eval "$VAR" || continue
done
fi
if [ "$GITLAB_CI" ]; then
# Install quasi-msys2 deps again
# We take code from deps script to better maintenance
echo "$(cat build/windows/1_build-deps-quasimsys2.sh |
sed -n '/# Beginning of install/,/# End of install/p')" | bash
fi
## The required packages for GIMP are taken from the result of previous script
sudo ln -nfs "$PWD/${PARENT_DIR}quasi-msys2/root/$MSYSTEM_PREFIX" /$MSYSTEM_PREFIX
# QUASI-MSYS2 ENV
echo -e "\e[0Ksection_start:`date +%s`:cross_environ[collapsed=true]\r\e[0KPreparing cross-build environment"
bash -c "source ${PARENT_DIR}quasi-msys2/env/all.src && bash build/windows/2_build-gimp-quasimsys2.sh"
else
export GIMP_PREFIX="$PWD/${PARENT_DIR}_install-$(echo $MSYSTEM_PREFIX | sed 's|/||')-cross"
IFS=$'\n' VAR_ARRAY=($(cat .gitlab-ci.yml | sed -n '/multi-os/,/GI_TYPELIB_PATH}\"/p' | sed 's/ - //' | sed '/#/d'))
IFS=$' \t\n'
for VAR in "${VAR_ARRAY[@]}"; do
if [[ ! "$VAR" =~ 'multiarch' ]]; then
unset LIB_SUBDIR
eval "$VAR" || continue
fi
done
echo -e "\e[0Ksection_end:`date +%s`:cross_environ\r\e[0K"
## Build GIMP
echo -e "\e[0Ksection_start:`date +%s`:gimp_build[collapsed=true]\r\e[0KBuilding GIMP"
if [ ! -f "_build-$(echo $MSYSTEM_PREFIX | sed 's|/||')-cross/build.ninja" ]; then
meson setup _build-$(echo $MSYSTEM_PREFIX | sed 's|/||')-cross -Dprefix="$GIMP_PREFIX" -Dgi-docgen=disabled \
-Djavascript=disabled -Dvala=disabled -Dms-store=true
fi
cd _build-$(echo $MSYSTEM_PREFIX | sed 's|/||')-cross
ninja
echo -e "\e[0Ksection_end:`date +%s`:gimp_build\r\e[0K"
# Bundle GIMP
echo -e "\e[0Ksection_start:`date +%s`:gimp_bundle[collapsed=true]\r\e[0KCreating bundle"
ninja install &> ninja_install.log | rm ninja_install.log || cat ninja_install.log
cd ..
echo -e "\e[0Ksection_end:`date +%s`:gimp_bundle\r\e[0K"
fi # END OF QUASI-MSYS2 ENV