summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2018-07-10 18:43:55 -0400
committerStefan Schmidt <s.schmidt@samsung.com>2018-07-26 08:55:58 +0200
commit005ba932344bbf4eb022df96ea24be67093324c0 (patch)
tree1296b517b2ec640ffe43cd54d468f4333076f474
parent45988ac6c0c8ca661601dcd9fdf10171a13568c7 (diff)
ci: add ccache support
this enables and implements full support for ccache on travis builds fix T7126 Differential Revision: https://phab.enlightenment.org/D6605 =also includes previously-submitted patches= ci: split out ccache config setup into separate script this provides a more unified place to set ccache options also enable ccache compression to cut down on cache upload/download overhead ref D6613 ci: zero ccache stats before build and add some comments for options used zeroing the stats before each build will provide more insight into the cache performance for each build ref D6621 ci: break out ccache stat printing into separate script continue to make travis.yml more readable ref D6622 ci: add more ccache config options to improve cache direct hits ci: disable second cpp run for ccache this should avoid running cpp twice for files https://ccache.samba.org/manual.html#_the_preprocessor_mode
-rw-r--r--.ci/ccache.conf7
-rwxr-xr-x.ci/ci-ccache-stats.sh9
-rwxr-xr-x.ci/ci-configure.sh11
-rwxr-xr-x.ci/ci-make-distcheck.sh5
-rwxr-xr-x.ci/ci-osx-deps.sh2
-rwxr-xr-x.ci/ci-setup-ccache.sh12
-rwxr-xr-x.ci/docker-ccache-setup.sh11
-rw-r--r--.travis.yml16
8 files changed, 66 insertions, 7 deletions
diff --git a/.ci/ccache.conf b/.ci/ccache.conf
new file mode 100644
index 0000000000..e9913800ca
--- /dev/null
+++ b/.ci/ccache.conf
@@ -0,0 +1,7 @@
1max_size = 500M
2compression = true
3compression_level = 1
4sloppiness = time_macros,include_file_mtime,include_file_ctime,file_macro
5run_second_cpp = false
6hash_dir = false
7
diff --git a/.ci/ci-ccache-stats.sh b/.ci/ci-ccache-stats.sh
new file mode 100755
index 0000000000..76b270488c
--- /dev/null
+++ b/.ci/ci-ccache-stats.sh
@@ -0,0 +1,9 @@
1#!/bin/sh
2
3set -e
4
5if [ "$DISTRO" != "" ] ; then
6 docker exec $(cat $HOME/cid) ccache -s
7else
8 ccache -s
9fi
diff --git a/.ci/ci-configure.sh b/.ci/ci-configure.sh
index 28897dafcc..86e280ec5f 100755
--- a/.ci/ci-configure.sh
+++ b/.ci/ci-configure.sh
@@ -49,7 +49,10 @@ if [ "$DISTRO" != "" ] ; then
49 if [ "$1" = "release-ready" ]; then 49 if [ "$1" = "release-ready" ]; then
50 OPTS="$OPTS $RELEASE_READY_LINUX_COPTS" 50 OPTS="$OPTS $RELEASE_READY_LINUX_COPTS"
51 fi 51 fi
52 docker run --env MAKEFLAGS="-j5" --env EIO_MONITOR_POLL=1 -v `pwd`:/src -w /src stefanschmidt1/ci-support-files:$DISTRO ./autogen.sh $OPTS 52 docker exec $(cat $HOME/cid) sh -c 'rm -f ~/.ccache/ccache.conf'
53 docker exec --env MAKEFLAGS="-j5" --env EIO_MONITOR_POLL=1 --env CC="ccache gcc" \
54 --env CXX="ccache g++" --env CFLAGS="-fdirectives-only" --env CXXFLAGS="-fdirectives-only" \
55 $(cat $HOME/cid) ./autogen.sh $OPTS
53else 56else
54 OSX_COPTS="--disable-cxx-bindings" 57 OSX_COPTS="--disable-cxx-bindings"
55 58
@@ -57,11 +60,13 @@ else
57 mkdir -p ~/Library/LaunchAgents 60 mkdir -p ~/Library/LaunchAgents
58 ln -sfv /usr/local/opt/d-bus/*.plist ~/Library/LaunchAgents 61 ln -sfv /usr/local/opt/d-bus/*.plist ~/Library/LaunchAgents
59 launchctl load ~/Library/LaunchAgents/org.freedesktop.dbus-session.plist 62 launchctl load ~/Library/LaunchAgents/org.freedesktop.dbus-session.plist
60 export PATH="$(brew --prefix gettext)/bin:$PATH" 63 export PATH="/usr/local/opt/ccache/libexec:$(brew --prefix gettext)/bin:$PATH"
61 64
62 export CFLAGS="-I/usr/local/opt/openssl/include $CFLAGS" 65 export CFLAGS="-I/usr/local/opt/openssl/include -frewrite-includes $CFLAGS"
66 export LDFLAGS="-L/usr/local/opt/openssl/lib $LDFLAGS"
63 export LDFLAGS="-L/usr/local/opt/openssl/lib $LDFLAGS" 67 export LDFLAGS="-L/usr/local/opt/openssl/lib $LDFLAGS"
64 68
65 # Normal build test of all targets 69 # Normal build test of all targets
70 rm -f ~/.ccache/ccache.conf
66 ./autogen.sh $OSX_COPTS 71 ./autogen.sh $OSX_COPTS
67fi 72fi
diff --git a/.ci/ci-make-distcheck.sh b/.ci/ci-make-distcheck.sh
index 144b95782e..a00de9911c 100755
--- a/.ci/ci-make-distcheck.sh
+++ b/.ci/ci-make-distcheck.sh
@@ -7,7 +7,10 @@ if [ "$1" != "release-ready" ] ; then
7fi 7fi
8 8
9if [ "$DISTRO" != "" ] ; then 9if [ "$DISTRO" != "" ] ; then
10 docker exec --env MAKEFLAGS="-j5" --env EIO_MONITOR_POLL=1 $(cat $HOME/cid) make distcheck 10 docker exec --env MAKEFLAGS="-j5" --env EIO_MONITOR_POLL=1 --env CC="ccache gcc" \
11 --env CXX="ccache g++" \
12 --env CFLAGS="-fdirectives-only" --env CXXFLAGS="-fdirectives-only" \
13 $(cat $HOME/cid) make distcheck
11else 14else
12 export PATH="/usr/local/opt/ccache/libexec:$(brew --prefix gettext)/bin:$PATH" 15 export PATH="/usr/local/opt/ccache/libexec:$(brew --prefix gettext)/bin:$PATH"
13 make 16 make
diff --git a/.ci/ci-osx-deps.sh b/.ci/ci-osx-deps.sh
index 859842624e..95872f82f3 100755
--- a/.ci/ci-osx-deps.sh
+++ b/.ci/ci-osx-deps.sh
@@ -2,4 +2,4 @@
2 2
3brew update 3brew update
4brew unlink python 4brew unlink python
5brew install gettext check bullet dbus fontconfig freetype fribidi gst-plugins-good gstreamer luajit openssl webp libsndfile glib libspectre libraw librsvg poppler lz4 pulseaudio 5brew install gettext check bullet dbus fontconfig freetype fribidi gst-plugins-good gstreamer luajit openssl webp libsndfile glib libspectre libraw librsvg poppler lz4 pulseaudio ccache
diff --git a/.ci/ci-setup-ccache.sh b/.ci/ci-setup-ccache.sh
new file mode 100755
index 0000000000..0a5087883f
--- /dev/null
+++ b/.ci/ci-setup-ccache.sh
@@ -0,0 +1,12 @@
1#!/bin/sh
2
3set -e
4
5if [ "$DISTRO" != "" ] ; then
6 docker exec $(cat $HOME/cid) sh -c ".ci/docker-ccache-setup.sh $1"
7 docker exec $(cat $HOME/cid) ccache -pz
8else
9 cp .ci/ccache.conf ~/.ccache
10 ccache -o base_dir="$(pwd)"
11 ccache -pz
12fi
diff --git a/.ci/docker-ccache-setup.sh b/.ci/docker-ccache-setup.sh
new file mode 100755
index 0000000000..748e743bf9
--- /dev/null
+++ b/.ci/docker-ccache-setup.sh
@@ -0,0 +1,11 @@
1#!/bin/sh
2
3CI_BUILD_TYPE="$1"
4
5cp .ci/ccache.conf ~/.ccache
6
7if [ "$1" = "release-ready" ] ; then
8 ccache -o base_dir="$(pwd)/$(grep '^PACKAGE_STRING' config.log|cut -d\' -f2|tr ' ' -)"
9else
10 ccache -o base_dir=$(pwd)
11fi
diff --git a/.travis.yml b/.travis.yml
index 817e4f177f..f3ba713f01 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,5 @@
1language: c 1language: c
2 2cache: ccache
3sudo: required 3sudo: required
4dist: trusty 4dist: trusty
5 5
@@ -11,6 +11,8 @@ env:
11 global: 11 global:
12 - MAKEFLAGS="-j5" 12 - MAKEFLAGS="-j5"
13 - EIO_MONITOR_POLL=1 13 - EIO_MONITOR_POLL=1
14 - CC="ccache gcc"
15 - CXX="ccache g++"
14 matrix: 16 matrix:
15 - 17 -
16 - DISTRO=Ubuntu1804 18 - DISTRO=Ubuntu1804
@@ -70,12 +72,15 @@ before_script:
70 - | 72 - |
71 if [[ "$TRAVIS_OS_NAME" == "linux" ]] ; then 73 if [[ "$TRAVIS_OS_NAME" == "linux" ]] ; then
72 docker version 74 docker version
73 docker run --cidfile $HOME/cid -t -d -v `pwd`:/src -w /src stefanschmidt1/ci-support-files:$DISTRO bash 75 docker run --cidfile $HOME/cid -t -d -v `pwd`:/src -v $HOME/.ccache:/root/.ccache -w /src stefanschmidt1/ci-support-files:$DISTRO bash
74 cat $HOME/cid 76 cat $HOME/cid
75 fi 77 fi
76 78
79 - .ci/ci-ccache-stats.sh
80
77script: 81script:
78 - .ci/ci-configure.sh "$CI_BUILD_TYPE" 82 - .ci/ci-configure.sh "$CI_BUILD_TYPE"
83 - .ci/ci-setup-ccache.sh "$CI_BUILD_TYPE"
79 - .ci/ci-make.sh "$CI_BUILD_TYPE" 84 - .ci/ci-make.sh "$CI_BUILD_TYPE"
80 - .ci/ci-make-checkbuild.sh "$CI_BUILD_TYPE" 85 - .ci/ci-make-checkbuild.sh "$CI_BUILD_TYPE"
81 - .ci/ci-make-examples.sh "$CI_BUILD_TYPE" 86 - .ci/ci-make-examples.sh "$CI_BUILD_TYPE"
@@ -91,6 +96,13 @@ script:
91 elif [[ "$CI_BUILD_TYPE" != "release-ready" ]] ; then 96 elif [[ "$CI_BUILD_TYPE" != "release-ready" ]] ; then
92 docker exec --env MAKEFLAGS="-j5" --env EIO_MONITOR_POLL=1 $(cat $HOME/cid) .ci/build-efl-app.sh 97 docker exec --env MAKEFLAGS="-j5" --env EIO_MONITOR_POLL=1 $(cat $HOME/cid) .ci/build-efl-app.sh
93 fi 98 fi
99before_cache:
100 - .ci/ci-ccache-stats.sh
101 - |
102 if [[ "$TRAVIS_OS_NAME" == "linux" ]] ; then
103 sudo chown travis:travis $HOME/.ccache
104 else
105 fi
94 106
95after_success: 107after_success:
96 - | 108 - |