Commit 84404a26 authored by Kai Engert's avatar Kai Engert

Bug 1366761, Add automatic checks for new ABI changes to automation/buildbot-slave/build.sh, r=me

parent 92a80477
......@@ -19,6 +19,9 @@ proc_args()
"--test-nss")
TEST_NSS=1
;;
"--check-abi")
CHECK_ABI=1
;;
"--build-jss")
BUILD_JSS=1
;;
......@@ -40,6 +43,7 @@ proc_args()
echo " --build-jss"
echo " --test-nss"
echo " --test-jss"
echo " --check-abi"
exit 1
;;
esac
......@@ -215,6 +219,78 @@ test_nss()
return ${RET}
}
check_abi()
{
print_log "######## NSS ABI CHECK - ${BITS} bits - ${OPT} ########"
rm -rf ${HGDIR}/baseline
mkdir ${HGDIR}/baseline
hg clone ${HGDIR}/nspr ${HGDIR}/baseline/nspr
hg clone ${HGDIR}/nss ${HGDIR}/baseline/nss
BASE_PR=`cat ${HGDIR}/nss/automation/abi-check/previous-nspr-release`
BASE_S=`cat ${HGDIR}/nss/automation/abi-check/previous-nss-release`
print_log "######## creating temporary HG clones ########"
cd ${HGDIR}/baseline/nspr
hg update $BASE_PR
if [ $? -ne 0 ]; then
echo "invalid tag in automation/abi-check/previous-nspr-release"
return 1
fi
cd ../..
cd ${HGDIR}/baseline/nss
hg update $BASE_S
if [ $? -ne 0 ]; then
echo "invalid tag in automation/abi-check/previous-nss-release"
return 1
fi
cd ../..
print_log "######## building older NSPR/NSS ########"
print_log "$ pushd ${HGDIR}/baseline/nss"
pushd ${HGDIR}/baseline/nss
print_log "$ ${MAKE} ${NSS_BUILD_TARGET}"
#${MAKE} ${NSS_BUILD_TARGET} 2>&1 | tee -a ${LOG_ALL} | grep ${GREP_BUFFER} "^${MAKE}"
${MAKE} ${NSS_BUILD_TARGET} 2>&1 | tee -a ${LOG_ALL}
RET=$?
print_result "NSS - build - ${BITS} bits - ${OPT}" ${RET} 0
if [ ${RET} -ne 0 ]; then
tail -100 ${LOG_ALL}
return ${RET}
fi
print_log "$ popd"
popd
ABI_REPORT=${OUTPUTDIR}/abi-diff.txt
rm -f ${ABI_REPORT}
PREVDIST=${HGDIR}/baseline/dist
NEWDIST=${HGDIR}/dist
ALL_SOs="libfreebl3.so libfreeblpriv3.so libnspr4.so libnss3.so libnssckbi.so libnssdbm3.so libnsssysinit.so libnssutil3.so libplc4.so libplds4.so libsmime3.so libsoftokn3.so libssl3.so"
for SO in ${ALL_SOs}; do
if [ ! -f nss/automation/abi-check/expected-report-$SO.txt ]; then
touch nss/automation/abi-check/expected-report-$SO.txt
fi
abidiff --hd1 $PREVDIST/public/ --hd2 $NEWDIST/public \
$PREVDIST/*/lib/$SO $NEWDIST/*/lib/$SO \
> nss/automation/abi-check/new-report-$SO.txt
diff -u nss/automation/abi-check/expected-report-$SO.txt \
nss/automation/abi-check/new-report-$SO.txt >> ${ABI_REPORT}
done
if [ -s ${ABI_REPORT} ]; then
print_log "FAILED: there are new unexpected ABI changes"
cat ${ABI_REPORT}
return 1
fi
return 0
}
test_jss()
{
print_log "######## JSS - tests - ${BITS} bits - ${OPT} ########"
......@@ -288,6 +364,11 @@ build_and_test()
[ $? -eq 0 ] || return 1
fi
if [ -n "${CHECK_ABI}" ]; then
check_abi
[ $? -eq 0 ] || return 1
fi
if [ -n "${BUILD_JSS}" ]; then
create_objdir_dist_link
build_jss
......@@ -360,6 +441,7 @@ main()
{
VALID=0
RET=1
FAIL=0
for BITS in 32 64; do
echo ${RUN_BITS} | grep ${BITS} > /dev/null
......@@ -372,7 +454,10 @@ main()
set_env
run_all
RET=$?
print_log "### result of run_all is ${RET}"
print_log "### result of run_all is ${RET}"
if [ ${RET} -ne 0 ]; then
FAIL=${RET}
fi
done
done
......@@ -381,7 +466,7 @@ main()
return 1
fi
return ${RET}
return ${FAIL}
}
#function killallsub()
......@@ -409,6 +494,8 @@ echo "tinderbox args: $0 $@"
proc_args "$@"
main
#RET=$?
RET=$?
print_log "### result of main is ${RET}"
#rm $IS_RUNNING_FILE
#exit ${RET}
exit ${RET}
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