[gimp/wip/Jehan/native-win64-build: 7/9] build: do not build Windows dependencies with ccache.




commit 853b3016cf26eed998ee8b392f2f3a09eb77105c
Author: Jehan <jehan girinstud io>
Date:   Mon May 3 20:01:29 2021 +0200

    build: do not build Windows dependencies with ccache.
    
    The build rules were highly inspired by other projects on GNOME's
    Gitlab. All of them used to build with ccache. It worked fine for the
    main build, but completely broke GObject Introspection build on both
    babl and GEGL. And the worse thing is that meson was absolutely not
    displaying the error, just saying it failed (even in verbose mode). A
    lot of time wasted trying to debug.
    
    Therefore let's get rid of ccache, but only for babl and GEGL. Keep it
    for GIMP itself as it works fine there.
    
    Other minor changes:
    
    * Build from the build dir, rather than source. The other way around
      works too, but I actually find commands simpler this way.
    * Adding artifacts.

 .gitlab-ci.yml               |  9 +++++++++
 build/windows/build-msys2.sh | 32 ++++++++++++++++++--------------
 2 files changed, 27 insertions(+), 14 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 90e7b0584e..467088d223 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -196,6 +196,15 @@ gimp-native-win64:
   script:
     - C:\msys64\usr\bin\pacman --noconfirm -Syyuu
     - C:\msys64\usr\bin\bash -lc "bash -x ./build/windows/build-msys2.sh"
+  artifacts:
+    name: "GIMP-Win-native-${CI_COMMIT_SHORT_SHA}"
+    when: always
+    expire_in: 2 days
+    paths:
+    - _install
+  cache:
+    paths:
+    - _ccache/
   needs: []
 
 deps-win64:
diff --git a/build/windows/build-msys2.sh b/build/windows/build-msys2.sh
index 8e37b2e01f..90a66adee5 100644
--- a/build/windows/build-msys2.sh
+++ b/build/windows/build-msys2.sh
@@ -75,11 +75,6 @@ pacman --noconfirm -S --needed \
     mingw-w64-$MSYS2_ARCH-vala \
     mingw-w64-$MSYS2_ARCH-xpm-nox
 
-mkdir -p _ccache
-export CCACHE_BASEDIR="$(pwd)"
-export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
-export CC="ccache gcc"
-
 export GIT_DEPTH=1
 export GIMP_PREFIX=`realpath ~/_install`
 export PATH="$GIMP_PREFIX/bin:$PATH"
@@ -92,17 +87,26 @@ 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
 
-cd _babl
-meson -Dprefix="${GIMP_PREFIX}" -Dwith-docs=false _build
-ninja -v -C _build
-ninja -C _build install
-cd ../_gegl
-meson -Dprefix="${GIMP_PREFIX}" -Ddocs=false _build
-ninja -C _build
-ninja -C _build install
-cd ..
+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"
+export CC="ccache gcc"
+
 ccache --zero-stats
 ccache --show-stats
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]