From f8b589eea6bd1d10faafd69c070b3b8c2c5f0b5d Mon Sep 17 00:00:00 2001 From: luo rixin Date: Tue, 16 Apr 2024 15:18:06 +0800 Subject: [PATCH] install-deps: save and restore user's XDG_CACHE_HOME Since ccache 4.0, ccache use $XDG_CACHE_HOME/ccache to keep compile cache if XDG_CACHE_HOME is set. In this case $XDG_CACHE_HOME is overwrite, ccache will use $XDG_CACHE_HOME/ccache(ccache will create the dir if not exsit) to store compile cache, but $XDG_CACHE_HOME will be removed next round running, leading to ccache contests are always removed. So save and restore user's XDG_CACHE_HOME. Fixes: https://tracker.ceph.com/issues/65175 Signed-off-by: luo rixin (cherry picked from commit a17342147d4411211ecf646730987d2633dabb6e) --- install-deps.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/install-deps.sh b/install-deps.sh index eb773c3eb40c1..70f5971e56e76 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -565,6 +565,9 @@ function preload_wheels_for_tox() { if $for_make_check; then mkdir -p install-deps-cache top_srcdir=$(pwd) + if [ -n "$XDG_CACHE_HOME" ]; then + ORIGINAL_XDG_CACHE_HOME=$XDG_CACHE_HOME + fi export XDG_CACHE_HOME=$top_srcdir/install-deps-cache wip_wheelhouse=wheelhouse-wip # @@ -575,6 +578,11 @@ if $for_make_check; then done rm -rf $top_srcdir/install-deps-python3 rm -rf $XDG_CACHE_HOME + if [ -n "$ORIGINAL_XDG_CACHE_HOME" ]; then + XDG_CACHE_HOME=$ORIGINAL_XDG_CACHE_HOME + else + unset XDG_CACHE_HOME + fi type git > /dev/null || (echo "Dashboard uses git to pull dependencies." ; false) fi -- 2.39.5