]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
make.sh: Have a ccache for each architecture
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 29 May 2019 14:28:45 +0000 (15:28 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 29 May 2019 14:28:45 +0000 (15:28 +0100)
It does not make much sense to mix architectures into a single
ccache:

* There is never going to be a match
* The cache gets bigger and therefore slower
* If both architectures are being compiled one after the other and
  the cache hits its maximum size, cached but still needed content
  will be dropped
* Only both can be deleted together

This small change splits this into multiple caches. One per
architecture. Therefore we should be more efficient on builders
that build for multiple architectures.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
make.sh

diff --git a/make.sh b/make.sh
index e9630d335f640e805bfc499df9347b6121264d54..f2904df08ededa8011b114bebb073193f2ec5872 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -469,7 +469,7 @@ prepareenv() {
        mkdir -p "${BASEDIR}/build${TOOLS_DIR}" 2>/dev/null
        mkdir -p $BASEDIR/build/{etc,usr/src} 2>/dev/null
        mkdir -p $BASEDIR/build/{dev/{shm,pts},proc,sys}
-       mkdir -p $BASEDIR/{cache,ccache} 2>/dev/null
+       mkdir -p $BASEDIR/{cache,ccache/${BUILD_ARCH}} 2>/dev/null
 
        if [ "${ENABLE_RAMDISK}" = "on" ]; then
                mkdir -p $BASEDIR/build/usr/src
@@ -488,7 +488,7 @@ prepareenv() {
        mount --bind /proc           $BASEDIR/build/proc
        mount --bind /sys            $BASEDIR/build/sys
        mount --bind $BASEDIR/cache  $BASEDIR/build/usr/src/cache
-       mount --bind $BASEDIR/ccache $BASEDIR/build/usr/src/ccache
+       mount --bind $BASEDIR/ccache/${BUILD_ARCH} $BASEDIR/build/usr/src/ccache
        mount --bind $BASEDIR/config $BASEDIR/build/usr/src/config
        mount --bind $BASEDIR/doc    $BASEDIR/build/usr/src/doc
        mount --bind $BASEDIR/html   $BASEDIR/build/usr/src/html