build, gitlab-ci: break the native Windows build into 2 jobs.

One for dependencies, one for GIMP.
This commit is contained in:
Jehan 2021-05-05 01:00:39 +02:00
parent ffd732c444
commit 6c91e7f964
5 changed files with 125 additions and 55 deletions

View File

@ -184,20 +184,41 @@ gimp-clang-debian:
- ninja -C _build
- ninja -C _build test
## WINDOWS 64-bit CI ##
## WINDOWS 64-bit CI (native MSYS2) ##
gimp-native-win64:
deps-win64-native:
stage: dependencies
variables:
MSYSTEM: "MINGW64"
CHERE_INVOKING: "yes"
tags:
- win32-ps
cache:
paths:
- _install/
script:
- C:\msys64\usr\bin\pacman --noconfirm -Syyuu
- C:\msys64\usr\bin\bash -lc "bash -x ./build/windows/gitlab-ci/build-deps-msys2.sh"
artifacts:
name: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}"
when: always
expire_in: 2 hours
paths:
- _install
needs: []
gimp-win64-native:
stage: gimp
variables:
MSYSTEM: "MINGW64"
CHERE_INVOKING: "yes"
tags:
- win32-ps
script:
- C:\msys64\usr\bin\pacman --noconfirm -Syyuu
- C:\msys64\usr\bin\bash -lc "bash -x ./build/windows/build-msys2.sh"
- C:\msys64\usr\bin\bash -lc "bash -x ./build/windows/gitlab-ci/build-gimp-msys2.sh"
artifacts:
name: "GIMP-Win-native-${CI_COMMIT_SHORT_SHA}"
name: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}"
when: always
expire_in: 2 days
paths:
@ -205,7 +226,9 @@ gimp-native-win64:
cache:
paths:
- _ccache/
needs: []
needs: ["deps-win64-native"]
## WINDOWS 64-bit CI (cross-build crossroad) ##
deps-win64:
rules:
@ -230,7 +253,7 @@ deps-win64:
- pip3 install zstandard
script:
- export PATH="`pwd`/.local/bin:$PATH"
- crossroad w64 gimp --run="build/windows/crossbuild-gitlab-ci/build-deps.sh"
- crossroad w64 gimp --run="build/windows/gitlab-ci/build-deps-crossroad.sh"
artifacts:
name: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}"
when: always
@ -271,7 +294,7 @@ gimp-win64:
- _build/
- gimp-prefix/
## WINDOWS 32-bit CI ##
## WINDOWS 32-bit CI (cross-build crossroad) ##
deps-win32:
rules:
@ -293,7 +316,7 @@ deps-win32:
- pip3 install zstandard
script:
- export PATH="`pwd`/.local/bin:$PATH"
- crossroad w32 gimp --run="build/windows/crossbuild-gitlab-ci/build-deps.sh"
- crossroad w32 gimp --run="build/windows/gitlab-ci/build-deps-crossroad.sh"
artifacts:
name: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}"
when: always
@ -425,28 +448,28 @@ win64-nightly:
- glib-compile-schemas --targetdir=${GIMP_DISTRIB}/share/glib-2.0/schemas ${GIMP_DISTRIB}/share/glib-2.0/schemas
# Package needed DLLs only
- python3 build/windows/crossbuild-gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB}
- python3 build/windows/crossbuild-gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-console-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB}
- python3 build/windows/crossbuild-gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-test-clipboard-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB}
- python3 build/windows/crossbuild-gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimptool-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB}
- python3 build/windows/gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB}
- python3 build/windows/gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-console-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB}
- python3 build/windows/gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-test-clipboard-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB}
- python3 build/windows/gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimptool-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB}
- for dll in ${GIMP_DISTRIB}/lib/babl-0.1/*.dll; do
python3 build/windows/crossbuild-gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
done
- for dll in ${GIMP_DISTRIB}/lib/gegl-0.4/*.dll; do
python3 build/windows/crossbuild-gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
done
- for dll in ${GIMP_DISTRIB}/lib/gio/modules/*.dll; do
python3 build/windows/crossbuild-gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
done
- for dll in ${GIMP_DISTRIB}/lib/gdk-pixbuf-2.0/2.10.0/loaders/*.dll; do
python3 build/windows/crossbuild-gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
done
- for dll in ${GIMP_DISTRIB}/lib/gimp/2.99/modules/*.dll; do
python3 build/windows/crossbuild-gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
done
- for dll in ${GIMP_DISTRIB}/lib/gimp/2.99/plug-ins/*/*.exe; do
python3 build/windows/crossbuild-gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
done
needs: ["gimp-win64"]
@ -509,27 +532,27 @@ win32-nightly:
- glib-compile-schemas --targetdir=${GIMP_DISTRIB}/share/glib-2.0/schemas ${GIMP_DISTRIB}/share/glib-2.0/schemas
# Package needed DLLs only.
- python3 build/windows/crossbuild-gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB}
- python3 build/windows/crossbuild-gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-console-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB}
- python3 build/windows/crossbuild-gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-test-clipboard-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB}
- python3 build/windows/crossbuild-gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimptool-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB}
- python3 build/windows/gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB}
- python3 build/windows/gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-console-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB}
- python3 build/windows/gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-test-clipboard-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB}
- python3 build/windows/gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimptool-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB}
- for dll in ${GIMP_DISTRIB}/lib/babl-0.1/*.dll; do
python3 build/windows/crossbuild-gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
done
- for dll in ${GIMP_DISTRIB}/lib/gegl-0.4/*.dll; do
python3 build/windows/crossbuild-gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
done
- for dll in ${GIMP_DISTRIB}/lib/gio/modules/*.dll; do
python3 build/windows/crossbuild-gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
done
- for dll in ${GIMP_DISTRIB}/lib/gdk-pixbuf-2.0/2.10.0/loaders/*.dll; do
python3 build/windows/crossbuild-gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
done
- for dll in ${GIMP_DISTRIB}/lib/gimp/2.99/modules/*.dll; do
python3 build/windows/crossbuild-gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
done
- for dll in ${GIMP_DISTRIB}/lib/gimp/2.99/plug-ins/*/*.exe; do
python3 build/windows/crossbuild-gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
done
needs: ["gimp-win32", "deps-win64"]

View File

@ -0,0 +1,72 @@
#!/bin/bash
set -e
if [[ "$MSYSTEM" == "MINGW32" ]]; then
export MSYS2_ARCH="i686"
else
export MSYS2_ARCH="x86_64"
fi
# Why do we even have to remove these manually? The whole thing is
# messed up, but it looks like the Gitlab runner fails to clean properly
# (it spews a bunch of "failed to remove" warnings at runner start, then
# ends with a "error: failed to commit transaction (conflicting files)"
# listing the various files it failed to remove).
# Might be tied to: https://gitlab.com/gitlab-org/gitlab-runner/-/issues/1839
rm -f /c/msys64/mingw64/bin/libpcre-1.dll
rm -f /c/msys64/mingw64/bin/libgio-2.0-0.dll
rm -f /c/msys64/mingw64/bin/libglib-2.0-0.dll
rm -f /c/msys64/mingw64/bin/libgmodule-2.0-0.dll
rm -f /c/msys64/mingw64/bin/libgobject-2.0-0.dll
rm -f /c/msys64/mingw64/bin/libpng16-16.dll
rm -f /c/msys64/mingw64/bin/gdk-pixbuf-pixdata.exe
rm -f /c/msys64/mingw64/bin/libgdk_pixbuf-2.0-0.dll
rm -f /c/msys64/mingw64/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.dll
# Update everything
pacman --noconfirm -Suy
# Install the required packages
pacman --noconfirm -S --needed \
base-devel \
mingw-w64-$MSYS2_ARCH-toolchain \
mingw-w64-$MSYS2_ARCH-meson \
\
mingw-w64-$MSYS2_ARCH-cairo \
mingw-w64-$MSYS2_ARCH-gobject-introspection \
mingw-w64-$MSYS2_ARCH-json-glib \
mingw-w64-$MSYS2_ARCH-lcms2 \
mingw-w64-$MSYS2_ARCH-lensfun \
mingw-w64-$MSYS2_ARCH-libspiro \
mingw-w64-$MSYS2_ARCH-maxflow \
mingw-w64-$MSYS2_ARCH-openexr \
mingw-w64-$MSYS2_ARCH-pango \
mingw-w64-$MSYS2_ARCH-suitesparse \
mingw-w64-$MSYS2_ARCH-vala
export GIT_DEPTH=1
export GIMP_PREFIX=`realpath ./_install`
export PATH="$GIMP_PREFIX/bin:$PATH"
export PKG_CONFIG_PATH="${GIMP_PREFIX}/lib/pkgconfig:$PKG_CONFIG_PATH"
export PKG_CONFIG_PATH="${GIMP_PREFIX}/share/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="${GIMP_PREFIX}/lib:${LD_LIBRARY_PATH}"
export ACLOCAL_FLAGS="-I/c/msys64/mingw64/share/aclocal"
export XDG_DATA_DIRS="${GIMP_PREFIX}/share:/mingw64/share/"
git clone --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/babl.git _babl
git clone --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/gegl.git _gegl
mkdir _babl/_build
cd _babl/_build
meson -Dprefix="${GIMP_PREFIX}" -Dwith-docs=false ..
ninja
ninja install
mkdir ../../_gegl/_build
cd ../../_gegl/_build
meson -Dprefix="${GIMP_PREFIX}" -Ddocs=false \
-Dcairo=enabled -Dumfpack=enabled \
-Dopenexr=enabled -Dworkshop=true ..
ninja
ninja install

View File

@ -32,11 +32,7 @@ pacman --noconfirm -S --needed \
base-devel \
mingw-w64-$MSYS2_ARCH-toolchain \
mingw-w64-$MSYS2_ARCH-ccache \
mingw-w64-$MSYS2_ARCH-pkg-config \
mingw-w64-$MSYS2_ARCH-meson \
\
mingw-w64-$MSYS2_ARCH-asciidoc \
mingw-w64-$MSYS2_ARCH-adwaita-icon-theme \
mingw-w64-$MSYS2_ARCH-appstream-glib \
mingw-w64-$MSYS2_ARCH-atk \
mingw-w64-$MSYS2_ARCH-cairo \
@ -55,10 +51,8 @@ pacman --noconfirm -S --needed \
mingw-w64-$MSYS2_ARCH-lcms2 \
mingw-w64-$MSYS2_ARCH-lensfun \
mingw-w64-$MSYS2_ARCH-libarchive \
mingw-w64-$MSYS2_ARCH-libepoxy \
mingw-w64-$MSYS2_ARCH-libheif \
mingw-w64-$MSYS2_ARCH-libmypaint \
mingw-w64-$MSYS2_ARCH-libraw \
mingw-w64-$MSYS2_ARCH-libspiro \
mingw-w64-$MSYS2_ARCH-libwebp \
mingw-w64-$MSYS2_ARCH-libwmf \
@ -68,15 +62,14 @@ pacman --noconfirm -S --needed \
mingw-w64-$MSYS2_ARCH-openexr \
mingw-w64-$MSYS2_ARCH-pango \
mingw-w64-$MSYS2_ARCH-poppler \
mingw-w64-$MSYS2_ARCH-poppler-data \
mingw-w64-$MSYS2_ARCH-python3-gobject \
mingw-w64-$MSYS2_ARCH-SDL2 \
mingw-w64-$MSYS2_ARCH-shared-mime-info \
mingw-w64-$MSYS2_ARCH-suitesparse \
mingw-w64-$MSYS2_ARCH-vala \
mingw-w64-$MSYS2_ARCH-xpm-nox
export GIT_DEPTH=1
export GIMP_PREFIX=`realpath ~/_install`
export GIMP_PREFIX=`realpath ./_install`
export PATH="$GIMP_PREFIX/bin:$PATH"
export PKG_CONFIG_PATH="${GIMP_PREFIX}/lib/pkgconfig:$PKG_CONFIG_PATH"
export PKG_CONFIG_PATH="${GIMP_PREFIX}/share/pkgconfig:$PKG_CONFIG_PATH"
@ -84,24 +77,6 @@ export LD_LIBRARY_PATH="${GIMP_PREFIX}/lib:${LD_LIBRARY_PATH}"
export ACLOCAL_FLAGS="-I/c/msys64/mingw64/share/aclocal"
export XDG_DATA_DIRS="${GIMP_PREFIX}/share:/mingw64/share/"
git clone --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/babl.git _babl
git clone --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/gegl.git _gegl
mkdir _babl/_build
cd _babl/_build
meson -Dprefix="${GIMP_PREFIX}" -Dwith-docs=false ..
ninja
ninja install
mkdir ../../_gegl/_build
cd ../../_gegl/_build
meson -Dprefix="${GIMP_PREFIX}" -Ddocs=false ..
ninja
ninja install
cd ../..
# Build
mkdir -p _ccache
export CCACHE_BASEDIR="$(pwd)"
export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"