[projects/cleanbuild] use ccache
glen
glen at pld-linux.org
Thu Dec 15 00:00:06 CET 2016
commit 73d3710b064b14ab9e439c50a34f4cec86e83ba7
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Thu Dec 15 00:35:00 2016 +0200
use ccache
.dockerignore | 1 +
Dockerfile | 4 +++-
docker-builder.sh | 12 +++++++-----
rpmmacros | 5 +++++
4 files changed, 16 insertions(+), 6 deletions(-)
---
diff --git a/.dockerignore b/.dockerignore
index 9845981..e50661e 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,3 +1,4 @@
cache/
+ccache/
poldekconf/
rpm/
diff --git a/Dockerfile b/Dockerfile
index db95495..be259c7 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -6,7 +6,7 @@ RUN set -x \
# first upgrade to latest
&& poldek --upgrade-dist \
# install build deps
- && poldek -u rpm-build perl-modules pwdutils coreutils util-linux git-core gawk sudo \
+ && poldek -u rpm-build perl-modules pwdutils coreutils util-linux git-core gawk sudo ccache-wrapper \
# this will setup builder user
&& poldek -u pld-builder-chroot \
# for builder -R
@@ -23,5 +23,7 @@ USER builder
WORKDIR /home/services/builder
+COPY rpmmacros .rpmmacros
+
# Use sleep to run forever
CMD ["sleep", "infinity"]
diff --git a/docker-builder.sh b/docker-builder.sh
index 8fbfd95..73889fd 100755
--- a/docker-builder.sh
+++ b/docker-builder.sh
@@ -6,14 +6,15 @@ image=pld/cleanbuild
name=cleanbuild-$package
-# cleanup
-docker kill $name && docker rm $name || :
-
-#topdir=$(rpm -E %_topdir)
dir=$(pwd)
topdir=$dir/rpm
cache=$dir/cache
home=/home/services/builder
+buildsize="4G"
+
+# cleanup first
+docker kill $name && docker rm $name || :
+
install -d $topdir/bin $cache/poldek
# start the container
@@ -21,7 +22,8 @@ docker run --name=$name -d \
-v $topdir:$home/rpm \
-v $dir:$home/cleanbuild \
-v $cache/poldek:/var/cache/poldek \
- --tmpfs $home/rpm/BUILD:rw,exec,nosuid,size=2G \
+ -v $dir/ccache/$package:/home/services/builder/.ccache \
+ --tmpfs $home/rpm/BUILD:rw,exec,nosuid,size=$buildsize \
$image
if [ ! -d $topdir/packages ]; then
diff --git a/rpmmacros b/rpmmacros
new file mode 100644
index 0000000..7eb4e99
--- /dev/null
+++ b/rpmmacros
@@ -0,0 +1,5 @@
+
+%ccache_prefix %{_libdir}/ccache/
+
+%__cc %{?ccache_prefix}%{_target_platform}-gcc
+%__cxx %{?ccache_prefix}%{_target_platform}-g++
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/cleanbuild.git/commitdiff/73d3710b064b14ab9e439c50a34f4cec86e83ba7
More information about the pld-cvs-commit
mailing list