You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ta...@apache.org on 2020/03/03 17:16:30 UTC
[impala] 05/05: santizer and -release flags should cause
buildall.sh to exit
This is an automated email from the ASF dual-hosted git repository.
tarmstrong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
commit 50f981a142fe6220e7e8b8e2a44f6614a1d0b507
Author: Sahil Takiar <ta...@gmail.com>
AuthorDate: Mon Mar 2 13:27:06 2020 -0800
santizer and -release flags should cause buildall.sh to exit
Currently, if any sanitizer (or clang-tidy) flag is added to buildall.sh
and the -release flag is added, then buildall.sh will silently ignore
the -release flag. Impala does not support adding sanitizer flags to
debug/release builds. Sanitizers, release, and debug builds are all
distinct and use their own set of compile flags.
This patch changes the behavior of buildall.sh so that if -release and
any sanitizer flag is specified, the build exits with the error:
"ERROR: more than one CMake build type defined: RELEASE TSAN"
Testing:
* './buildall.sh -skiptests -noclean -tsan -release' fails (as expected)
* './buildall.sh -skiptests -noclean -tsan' passes
* './buildall.sh -notests -noclean -codecoverage -release' passes
Change-Id: Ide0c2017d4e5abbf6fcb25c890d241bbcee8422e
Reviewed-on: http://gerrit.cloudera.org:8080/15341
Reviewed-by: Tim Armstrong <ta...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
buildall.sh | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/buildall.sh b/buildall.sh
index a756069..b2182a0 100755
--- a/buildall.sh
+++ b/buildall.sh
@@ -279,7 +279,7 @@ Examples of common tasks:
done
declare -a CMAKE_BUILD_TYPE_LIST
-# Adjust CMAKE_BUILD_TYPE for ASAN and code coverage, if necessary.
+# Adjust CMAKE_BUILD_TYPE for code coverage, if necessary.
if [[ ${CODE_COVERAGE} -eq 1 ]]; then
case ${CMAKE_BUILD_TYPE} in
Debug)
@@ -290,13 +290,16 @@ if [[ ${CODE_COVERAGE} -eq 1 ]]; then
;;
esac
fi
+
+# If the -release flag is specified, add RELEASE to the CMAKE_BUILD_TYPE_LIST so that
+# the build exits if both -release and a sanitizer flag are specified. This does not
+# apply when -codecoverage is specified because code coverage is not a distinct build
+# type, it just controls if additional build flags are added.
+if [[ ${CODE_COVERAGE} -ne 1 && ${CMAKE_BUILD_TYPE} = "Release" ]]; then
+ CMAKE_BUILD_TYPE_LIST+=(RELEASE)
+fi
+
if [[ ${BUILD_ASAN} -eq 1 ]]; then
- # The next check also catches cases where CODE_COVERAGE=1, which is not supported
- # together with BUILD_ASAN=1.
- if [[ "${CMAKE_BUILD_TYPE}" != "Debug" ]]; then
- echo "Address sanitizer build not supported for build type: ${CMAKE_BUILD_TYPE}"
- exit 1
- fi
CMAKE_BUILD_TYPE_LIST+=(ADDRESS_SANITIZER)
fi
if [[ ${BUILD_TIDY} -eq 1 ]]; then