aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Fält <simo.falt@qt.io>2022-08-05 09:47:45 +0300
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-08-12 13:38:17 +0000
commit419bf6785311dca47ad1d7201e6aecea1687a7ab (patch)
tree0d1da651fd32def000868b836b3342df0462528d
parentae4687d5bc256ea69aac3d8c73815ec3ae2c0791 (diff)
Add wrapper for sccache command in Linux and macOS
The sccache tends to fail every now and then. Adding a wrapper which calls build tools directly if first call with sccacche fails. Task-number: COIN-740 Change-Id: Ic03cf991da585d1569387118183763497ea73b72 Reviewed-by: Toni Saario <toni.saario@qt.io> (cherry picked from commit e8495fc86e81f79aac5837b261e8395133c13631) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rwxr-xr-xcoin/provisioning/common/unix/sccache.sh7
-rwxr-xr-xcoin/provisioning/common/unix/sccache_wrapper14
2 files changed, 21 insertions, 0 deletions
diff --git a/coin/provisioning/common/unix/sccache.sh b/coin/provisioning/common/unix/sccache.sh
index 7adfed32..f20db84d 100755
--- a/coin/provisioning/common/unix/sccache.sh
+++ b/coin/provisioning/common/unix/sccache.sh
@@ -62,4 +62,11 @@ function installSccache {
# disable sccache server from shutting down after being idle
SetEnvVar "SCCACHE_IDLE_TIMEOUT" "0"
+
+ # copy sccache wrapper and place as a first in PATH
+ mkdir -p $HOME/sccache_wrapper
+ cp ${BASH_SOURCE%/*}/sccache_wrapper $HOME/sccache_wrapper/sccache
+ chmod 755 $HOME/sccache_wrapper/sccache
+ SetEnvVar "PATH" "$HOME/sccache_wrapper:\$PATH"
+
}
diff --git a/coin/provisioning/common/unix/sccache_wrapper b/coin/provisioning/common/unix/sccache_wrapper
new file mode 100755
index 00000000..52e39513
--- /dev/null
+++ b/coin/provisioning/common/unix/sccache_wrapper
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+# Call real sccache with original arguments
+# sccache /opt/android/android-ndk-r23b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=aarch64-none ......
+real_sccache=/usr/local/sccache/sccache
+$real_sccache "$@"
+retval=$?
+
+if test $retval -ne 0
+then
+ echo "Sccache command failed, re-try calling build tool directly"
+ "$@"
+ retval=$?
+fi
+exit $retval