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>
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}/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
if [ "${ENABLE_RAMDISK}" = "on" ]; then
mkdir -p $BASEDIR/build/usr/src
mount --bind /proc $BASEDIR/build/proc
mount --bind /sys $BASEDIR/build/sys
mount --bind $BASEDIR/cache $BASEDIR/build/usr/src/cache
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
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