Skip to content

Commit

Permalink
install-deps: save and restore user's XDG_CACHE_HOME
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
rosinL committed Apr 18, 2024
1 parent a7639cb commit a173421
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions install-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,9 @@ fi
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
#
Expand All @@ -551,6 +554,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

Expand Down

0 comments on commit a173421

Please sign in to comment.