Skip to content

Commit a173421

Browse files
committed
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 <[email protected]>
1 parent a7639cb commit a173421

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

install-deps.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,9 @@ fi
541541
if $for_make_check; then
542542
mkdir -p install-deps-cache
543543
top_srcdir=$(pwd)
544+
if [ -n "$XDG_CACHE_HOME" ]; then
545+
ORIGINAL_XDG_CACHE_HOME=$XDG_CACHE_HOME
546+
fi
544547
export XDG_CACHE_HOME=$top_srcdir/install-deps-cache
545548
wip_wheelhouse=wheelhouse-wip
546549
#
@@ -551,6 +554,11 @@ if $for_make_check; then
551554
done
552555
rm -rf $top_srcdir/install-deps-python3
553556
rm -rf $XDG_CACHE_HOME
557+
if [ -n "$ORIGINAL_XDG_CACHE_HOME" ]; then
558+
XDG_CACHE_HOME=$ORIGINAL_XDG_CACHE_HOME
559+
else
560+
unset XDG_CACHE_HOME
561+
fi
554562
type git > /dev/null || (echo "Dashboard uses git to pull dependencies." ; false)
555563
fi
556564

0 commit comments

Comments
 (0)