CCACHE_TEMPDIR="/tmp/ccache-tmp" if /tmp is mounted as tmpfs

This commit is contained in:
The-going 2023-01-15 19:15:26 +03:00
parent 3188514771
commit 43ac0cc3fd

View File

@ -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