summaryrefslogtreecommitdiff
path: root/jenkins-helpers.sh
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2019-04-18 08:56:02 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2019-04-18 08:56:02 +0000
commit03e066a100b227e9136dd2b57162ccaf4d593412 (patch)
treed778dec18b81a09ceef912434165fb967940b462 /jenkins-helpers.sh
parentc5795b5724dc702ca2b52004112b5f4944c1c8b9 (diff)
jenkins-helpers.sh: Fix ccache pollution on high-executor-count nodes
Change-Id: Idc60ff9e1ce6a2db8a36a8c7352c1c132913156f
Diffstat (limited to 'jenkins-helpers.sh')
-rw-r--r--jenkins-helpers.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/jenkins-helpers.sh b/jenkins-helpers.sh
index f65b7198..5f68c9a1 100644
--- a/jenkins-helpers.sh
+++ b/jenkins-helpers.sh
@@ -712,8 +712,18 @@ print_volume_mounts ()
# Add ccache volume for tcwg_* jobs.
# These jobs depend on ccache for fast rebuilds of LLVM and GCC with
# the host compiler.
- job="$(echo $job | cut -d- -f 1)"
- volume_id=$(print_docker_name "$job$suffix")
+ # tcwg_* jobs use per-executor WORKSPACES, and ccache uses separate
+ # cache entries for different paths. Therefore we need to use
+ # separate caches for different $WORKSPACES. Otherwise we get
+ # a lot of cache polution on high-executor machines, e.g., for
+ # tcwg_bmk builds on tcwg-x86_64-dev-01 node.
+ local prefix
+ if [ x"${WORKSPACE+set}" = x"set" ]; then
+ prefix=$(basename $WORKSPACE)
+ else
+ prefix=$(echo $job | cut -d- -f 1)
+ fi
+ volume_id=$(print_docker_name "$prefix$suffix")
mounts+=(ccache-$volume_id:$HOME/.ccache)
;;
esac