From 43ac0cc3fd89251b6f403fb9178a66f4509c8203 Mon Sep 17 00:00:00 2001 From: The-going <48602507+The-going@users.noreply.github.com> Date: Sun, 15 Jan 2023 19:15:26 +0300 Subject: [PATCH] CCACHE_TEMPDIR="/tmp/ccache-tmp" if /tmp is mounted as tmpfs --- lib/functions/main/config-prepare.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/functions/main/config-prepare.sh b/lib/functions/main/config-prepare.sh index d8595ffb72..a3d2782340 100644 --- a/lib/functions/main/config-prepare.sh +++ b/lib/functions/main/config-prepare.sh @@ -54,6 +54,10 @@ function prepare_and_config_main_build_single() { # private ccache directory to avoid permission issues when using build script with "sudo" # see https://ccache.samba.org/manual.html#_sharing_a_cache for alternative solution [[ $PRIVATE_CCACHE == yes ]] && export CCACHE_DIR=$SRC/cache/ccache + # Check if /tmp is mounted as tmpfs make a temporary ccache folder there for faster operation. + if [ "$(findmnt --noheadings --output FSTYPE --target "/tmp" --uniq)" == "tmpfs" ]; then + export CCACHE_TEMPDIR="/tmp/ccache-tmp" + fi else