Skip to content

Commit

Permalink
[ci] add back ccache
Browse files Browse the repository at this point in the history
  • Loading branch information
jd28 committed Jul 7, 2024
1 parent 7ced136 commit 49fddad
Showing 1 changed file with 26 additions and 23 deletions.
49 changes: 26 additions & 23 deletions scripts/docker_prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ set -xe
# manylinux prep
if [[ -f "/etc/centos-release" ]]; then
rpm --import https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux
dnf config-manager --set-enabled powertools
dnf install epel-release -y
dnf install ccache -y

# sometimes the epel server is down. retry 5 times
for i in $(seq 1 5); do
Expand All @@ -15,19 +18,19 @@ if [[ -f "/etc/centos-release" ]]; then

[ $s -eq 0 ] || exit $s

# if [[ -d "/usr/lib64/ccache" ]]; then
# ln -s /usr/bin/ccache /usr/lib64/ccache/c++
# ln -s /usr/bin/ccache /usr/lib64/ccache/cc
# ln -s /usr/bin/ccache /usr/lib64/ccache/gcc
# ln -s /usr/bin/ccache /usr/lib64/ccache/g++
# export PATH="/usr/lib64/ccache:$PATH"
# elif [[ -d "/usr/lib/ccache" ]]; then
# ln -s /usr/bin/ccache /usr/lib/ccache/c++
# ln -s /usr/bin/ccache /usr/lib/ccache/cc
# ln -s /usr/bin/ccache /usr/lib/ccache/gcc
# ln -s /usr/bin/ccache /usr/lib/ccache/g++
# export PATH="/usr/lib/ccache:$PATH"
# fi
if [[ -d "/usr/lib64/ccache" ]]; then
ln -s /usr/bin/ccache /usr/lib64/ccache/c++
ln -s /usr/bin/ccache /usr/lib64/ccache/cc
ln -s /usr/bin/ccache /usr/lib64/ccache/gcc
ln -s /usr/bin/ccache /usr/lib64/ccache/g++
export PATH="/usr/lib64/ccache:$PATH"
elif [[ -d "/usr/lib/ccache" ]]; then
ln -s /usr/bin/ccache /usr/lib/ccache/c++
ln -s /usr/bin/ccache /usr/lib/ccache/cc
ln -s /usr/bin/ccache /usr/lib/ccache/gcc
ln -s /usr/bin/ccache /usr/lib/ccache/g++
export PATH="/usr/lib/ccache:$PATH"
fi

elif [[ -f "/etc/alpine-release" ]]; then
# musllinux prep
Expand All @@ -38,17 +41,17 @@ fi

# hack until https://github.com/pypa/cibuildwheel/issues/1030 is fixed
# Place ccache folder in /outputs
# HOST_CCACHE_DIR="/host${HOST_CCACHE_DIR:-/home/runner/work/rollnw/rollnw/.ccache}"
# if [ -d $HOST_CCACHE_DIR ]; then
# mkdir -p /output
# cp -R $HOST_CCACHE_DIR /output/.ccache
# fi
HOST_CCACHE_DIR="/host${HOST_CCACHE_DIR:-/home/runner/work/rollnw/rollnw/.ccache}"
if [ -d $HOST_CCACHE_DIR ]; then
mkdir -p /output
cp -R $HOST_CCACHE_DIR /output/.ccache
fi

# ls -la /output/
ls -la /output/

# ccache -o cache_dir="/output/.ccache"
# ccache -M 5 G # set cache size to 5 G
ccache -o cache_dir="/output/.ccache"
ccache -M 5 G # set cache size to 5 G

# Show ccache stats
# echo "Cache stats:"
# ccache -s
echo "Cache stats:"
ccache -s

0 comments on commit 49fddad

Please sign in to comment.