This is an automated email from the ASF dual-hosted git repository.

sorber pushed a commit to branch 6.2.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 7447a5742ee031c707e3dc7ab117098209007ab9
Author: James Peach <[email protected]>
AuthorDate: Mon Jun 20 16:28:50 2016 -0700

    TS-4566: Try harder to exclude LuaJIT from static analysis.
    
    (cherry picked from commit 71b13803b50cf0545f47af0118a9668b1e3a4c2a)
---
 ci/jenkins/bin/clang-analyzer.sh | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/ci/jenkins/bin/clang-analyzer.sh b/ci/jenkins/bin/clang-analyzer.sh
index 7d5c9fc..454a2cb 100755
--- a/ci/jenkins/bin/clang-analyzer.sh
+++ b/ci/jenkins/bin/clang-analyzer.sh
@@ -23,6 +23,8 @@
 
 # Where are our LLVM tools?
 LLVM_BASE=${LLVM:-/opt/llvm}
+NPROCS=${NPROCS:-$(getconf _NPROCESSORS_ONLN)}
+NOCLEAN=${NOCLEAN:-}
 
 # Options
 options="--status-bugs --keep-empty"
@@ -45,13 +47,26 @@ test ! -z "${WORKSPACE}" && cd "${WORKSPACE}/src"
 output="/tmp"
 test -d "/home/jenkins/clang-analyzer" && output="/home/jenkins/clang-analyzer"
 
+# Tell scan-build to use clang as the underlying compiler to actually build
+# source. If you don't do this, it will default to GCC.
+export CCC_CC=${LLVM_BASE}/bin/clang
+export CCC_CXX=${LLVM_BASE}/bin/clang++
+
 autoreconf -fi
-#scan-build ./configure ${configure}
-./configure ${configure} CC=${LLVM_BASE}/bin/clang CXX=${LLVM_BASE}/bin/clang++
-${LLVM_BASE}/bin/scan-build ${checkers} ${options} -o ${output} 
--html-title="ATS master branch"  ${ATS_MAKE} -j4
+scan-build ./configure ${configure}
+
+# Since we don't want the analyzer to look at LuaJIT, build it first
+# without scan-build. The subsequent make will then skip it.
+${ATS_MAKE} -j $NPROCS -C lib all-local V=1 Q=
+
+${LLVM_BASE}/bin/scan-build ${checkers} ${options} -o ${output} 
--html-title="ATS master branch"  ${ATS_MAKE} -j $NPROCS V=1 Q=
 status=$?
 
-${ATS_MAKE} distclean
+# Clean the work area unless NOCLEAN is set. This is jsut for debugging when 
you
+# need to see what the generated build did.
+if [ ! -z "$NOCLEAN" ]; then
+  ${ATS_MAKE} distclean
+fi
 
 # Cleanup old reports (save the last 10 reports), but only for the CI
 if [ "/tmp" !=  "$output" ]; then

-- 
To stop receiving notification emails like this one, please contact
"[email protected]" <[email protected]>.

Reply via email to