Commit 8562f1f6 authored by illsilin's avatar illsilin
Browse files

remove sccache launchers if cant connect to redis

parent 09492fe5
...@@ -232,27 +232,12 @@ def cmake_build(Map conf=[:]){ ...@@ -232,27 +232,12 @@ def cmake_build(Map conf=[:]){
stunnel ../script/redis-cli.conf stunnel ../script/redis-cli.conf
../script/sccache_wrapper.sh --enforce_redis ../script/sccache_wrapper.sh --enforce_redis
""" """
setup_args = " -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache " + setup_args
}
def setup_cmd = conf.get("setup_cmd", "${cmake_envs} cmake ${setup_args} .. ")
// reduce parallelism when compiling, clang uses too much memory
def nt = nthreads()
def build_cmd = conf.get("build_cmd", "${build_envs} dumb-init make -j${nt} ${config_targets}")
def execute_cmd = conf.get("execute_cmd", "")
def cmd = conf.get("cmd", """
${setup_cmd}
${build_cmd}
${execute_cmd}
""")
echo cmd
if(check_host() && params.USE_SCCACHE && "${env.CK_SCCACHE}" != "null" && "${invocation_tag}" != "") {
try { try {
def cmd1 = conf.get("cmd1", """ def cmd1 = conf.get("cmd1", """
${redis_pre_setup_cmd} ${redis_pre_setup_cmd}
""") """)
sh cmd1 sh cmd1
setup_args = " -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache " + setup_args
} }
catch(Exception err){ catch(Exception err){
echo "could not connect to redis server: ${err.getMessage()}. will not use sccache." echo "could not connect to redis server: ${err.getMessage()}. will not use sccache."
...@@ -268,6 +253,21 @@ def cmake_build(Map conf=[:]){ ...@@ -268,6 +253,21 @@ def cmake_build(Map conf=[:]){
""") """)
sh cmd3 sh cmd3
} }
def setup_cmd = conf.get("setup_cmd", "${cmake_envs} cmake ${setup_args} .. ")
// reduce parallelism when compiling, clang uses too much memory
def nt = nthreads()
def build_cmd = conf.get("build_cmd", "${build_envs} dumb-init make -j${nt} ${config_targets}")
def execute_cmd = conf.get("execute_cmd", "")
def cmd = conf.get("cmd", """
${setup_cmd}
${build_cmd}
${execute_cmd}
""")
echo cmd
dir("build"){ dir("build"){
sh cmd sh cmd
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment