diff options
author | Mike Blumenkrantz <zmike@samsung.com> | 2018-07-10 18:43:55 -0400 |
---|---|---|
committer | Stefan Schmidt <s.schmidt@samsung.com> | 2018-07-26 08:55:58 +0200 |
commit | 005ba932344bbf4eb022df96ea24be67093324c0 (patch) | |
tree | 1296b517b2ec640ffe43cd54d468f4333076f474 /.ci | |
parent | 45988ac6c0c8ca661601dcd9fdf10171a13568c7 (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
Diffstat (limited to '.ci')
-rw-r--r-- | .ci/ccache.conf | 7 | ||||
-rwxr-xr-x | .ci/ci-ccache-stats.sh | 9 | ||||
-rwxr-xr-x | .ci/ci-configure.sh | 11 | ||||
-rwxr-xr-x | .ci/ci-make-distcheck.sh | 5 | ||||
-rwxr-xr-x | .ci/ci-osx-deps.sh | 2 | ||||
-rwxr-xr-x | .ci/ci-setup-ccache.sh | 12 | ||||
-rwxr-xr-x | .ci/docker-ccache-setup.sh | 11 |
7 files changed, 52 insertions, 5 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 @@ | |||
1 | max_size = 500M | ||
2 | compression = true | ||
3 | compression_level = 1 | ||
4 | sloppiness = time_macros,include_file_mtime,include_file_ctime,file_macro | ||
5 | run_second_cpp = false | ||
6 | hash_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 | |||
3 | set -e | ||
4 | |||
5 | if [ "$DISTRO" != "" ] ; then | ||
6 | docker exec $(cat $HOME/cid) ccache -s | ||
7 | else | ||
8 | ccache -s | ||
9 | fi | ||
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 | ||
53 | else | 56 | else |
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 |
67 | fi | 72 | fi |
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 | |||
7 | fi | 7 | fi |
8 | 8 | ||
9 | if [ "$DISTRO" != "" ] ; then | 9 | if [ "$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 | ||
11 | else | 14 | else |
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 | ||
3 | brew update | 3 | brew update |
4 | brew unlink python | 4 | brew unlink python |
5 | brew install gettext check bullet dbus fontconfig freetype fribidi gst-plugins-good gstreamer luajit openssl webp libsndfile glib libspectre libraw librsvg poppler lz4 pulseaudio | 5 | brew 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 | |||
3 | set -e | ||
4 | |||
5 | if [ "$DISTRO" != "" ] ; then | ||
6 | docker exec $(cat $HOME/cid) sh -c ".ci/docker-ccache-setup.sh $1" | ||
7 | docker exec $(cat $HOME/cid) ccache -pz | ||
8 | else | ||
9 | cp .ci/ccache.conf ~/.ccache | ||
10 | ccache -o base_dir="$(pwd)" | ||
11 | ccache -pz | ||
12 | fi | ||
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 | |||
3 | CI_BUILD_TYPE="$1" | ||
4 | |||
5 | cp .ci/ccache.conf ~/.ccache | ||
6 | |||
7 | if [ "$1" = "release-ready" ] ; then | ||
8 | ccache -o base_dir="$(pwd)/$(grep '^PACKAGE_STRING' config.log|cut -d\' -f2|tr ' ' -)" | ||
9 | else | ||
10 | ccache -o base_dir=$(pwd) | ||
11 | fi | ||