gitlab-ci: Reenable ccache but disable it during the initial meson call

There where some problems (??) with ccache not detecting changes during meson
checks. Setting CCACHE_DISABLE during the meson execution makes ccache not use
the cache and pass things directly to the compiler.
This commit is contained in:
Christoph Reiter 2018-04-11 12:18:55 +02:00
parent d448be007e
commit c542115906
3 changed files with 36 additions and 11 deletions

View File

@ -2,25 +2,28 @@ stages:
- build - build
- flatpak - flatpak
gtk: .cache-paths: &cache-paths
paths:
- _ccache/
- subprojects/gdk-pixbuf/
- subprojects/glib/
- subprojects/graphene/
- subprojects/libepoxy/
- subprojects/pango/
fedora-x86_64:
image: ebassi/gitlab-gtk:latest image: ebassi/gitlab-gtk:latest
stage: build stage: build
before_script:
- export CCACHE_DISABLE=true_
script: script:
- bash -x ./.gitlab-ci/test-docker.sh - bash -x ./.gitlab-ci/test-docker.sh
cache:
paths:
- subprojects/gdk-pixbuf/
- subprojects/glib/
- subprojects/graphene/
- subprojects/libepoxy/
- subprojects/pango/
artifacts: artifacts:
when: on_failure when: on_failure
name: "gtk-${CI_COMMIT_REF_NAME}" name: "gtk-${CI_COMMIT_REF_NAME}"
paths: paths:
- "${CI_PROJECT_DIR}/_build/meson-logs" - "${CI_PROJECT_DIR}/_build/meson-logs"
cache:
key: "$CI_JOB_NAME"
<<: *cache-paths
.mingw-defaults: &mingw-defaults .mingw-defaults: &mingw-defaults
stage: build stage: build
@ -29,8 +32,11 @@ gtk:
script: script:
- C:\msys64\usr\bin\pacman --noconfirm -Syyuu - C:\msys64\usr\bin\pacman --noconfirm -Syyuu
- C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2.sh" - C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2.sh"
cache:
key: "%CI_JOB_NAME%"
<<: *cache-paths
mingw32: msys2-mingw32:
variables: variables:
MSYSTEM: "MINGW32" MSYSTEM: "MINGW32"
CHERE_INVOKING: "yes" CHERE_INVOKING: "yes"

View File

@ -4,16 +4,25 @@ set -e
srcdir=$(pwd) srcdir=$(pwd)
mkdir -p _ccache
export CCACHE_BASEDIR="$(pwd)"
export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
ccache --zero-stats
ccache --show-stats
export CCACHE_DISABLE=true
meson \ meson \
-Dx11-backend=true \ -Dx11-backend=true \
-Dwayland-backend=true \ -Dwayland-backend=true \
-Dbroadway-backend=true \ -Dbroadway-backend=true \
-Dvulkan=yes \ -Dvulkan=yes \
_build $srcdir _build $srcdir
unset CCACHE_DISABLE
cd _build cd _build
ninja ninja
ccache --show-stats
xvfb-run -a -s "-screen 0 1024x768x24" \ xvfb-run -a -s "-screen 0 1024x768x24" \
meson test \ meson test \

View File

@ -16,6 +16,7 @@ pacman --noconfirm -S --needed \
base-devel \ base-devel \
git \ git \
mingw-w64-$MSYS2_ARCH-toolchain \ mingw-w64-$MSYS2_ARCH-toolchain \
mingw-w64-$MSYS2_ARCH-ccache \
mingw-w64-$MSYS2_ARCH-pkg-config \ mingw-w64-$MSYS2_ARCH-pkg-config \
mingw-w64-$MSYS2_ARCH-gobject-introspection \ mingw-w64-$MSYS2_ARCH-gobject-introspection \
mingw-w64-$MSYS2_ARCH-meson \ mingw-w64-$MSYS2_ARCH-meson \
@ -32,11 +33,20 @@ pacman --noconfirm -S --needed \
mingw-w64-$MSYS2_ARCH-gst-plugins-bad \ mingw-w64-$MSYS2_ARCH-gst-plugins-bad \
mingw-w64-$MSYS2_ARCH-shared-mime-info mingw-w64-$MSYS2_ARCH-shared-mime-info
mkdir -p _ccache
export CCACHE_BASEDIR="$(pwd)"
export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
# Build # Build
ccache --zero-stats
ccache --show-stats
export CCACHE_DISABLE=true
meson \ meson \
-Denable-x11-backend=false \ -Denable-x11-backend=false \
-Denable-wayland-backend=false \ -Denable-wayland-backend=false \
-Denable-win32-backend=true \ -Denable-win32-backend=true \
_build _build
unset CCACHE_DISABLE
ninja -C _build ninja -C _build
ccache --show-stats