You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by jo...@apache.org on 2019/05/01 15:46:37 UTC

[impala] 03/04: IMPALA-8475: Fix unbound CMAKE_BUILD_TYPE_LIST in buildall.sh

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

joemcdonnell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit 61e7ff19f6afd080420af0af36591f6174906410
Author: Joe McDonnell <jo...@cloudera.com>
AuthorDate: Tue Apr 30 16:31:04 2019 -0700

    IMPALA-8475: Fix unbound CMAKE_BUILD_TYPE_LIST in buildall.sh
    
    A recent change introduced a shell array CMAKE_BUILD_TYPE_LIST.
    For debug builds, it is empty, because no build types are passed
    into buildall.sh. This is a problem on Centos, because the
    condition [[ -v CMAKE_BUILD_TYPE_LIST ]] is true for an empty
    array on Centos. This causes us to execute code meant for
    non-empty arrays and trigger an unbound variable error.
    
    This changes the condition to [[ -n "${CMAKE_BUILD_TYPE_LIST:+1}" ]],
    which returns true only if the array is not empty.
    
    Testing:
     - Ran buildall.sh on Centos 7 and Ubuntu 16.04.
    
    Change-Id: Ifd3b1af05af780d1a91cc781afff84b56f5aeb59
    Reviewed-on: http://gerrit.cloudera.org:8080/13204
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 buildall.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/buildall.sh b/buildall.sh
index 125fbcb..8eab21d 100755
--- a/buildall.sh
+++ b/buildall.sh
@@ -308,7 +308,7 @@ fi
 if [[ ${BUILD_TSAN} -eq 1 ]]; then
   CMAKE_BUILD_TYPE_LIST+=(TSAN)
 fi
-if [[ -v CMAKE_BUILD_TYPE_LIST ]]; then
+if [[ -n "${CMAKE_BUILD_TYPE_LIST:+1}" ]]; then
   if [[ ${#CMAKE_BUILD_TYPE_LIST[@]} -gt 1 ]]; then
     echo "ERROR: more than one CMake build type defined: ${CMAKE_BUILD_TYPE_LIST[@]}"
     exit 1