[
https://issues.apache.org/jira/browse/IMPALA-8475?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16831078#comment-16831078
]
ASF subversion and git services commented on IMPALA-8475:
---------------------------------------------------------
Commit 61e7ff19f6afd080420af0af36591f6174906410 in impala's branch
refs/heads/master from Joe McDonnell
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=61e7ff1 ]
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 <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
> buildall.sh fails with undefined CMAKE_BUILD_TYPE_LIST on Centos
> ----------------------------------------------------------------
>
> Key: IMPALA-8475
> URL: https://issues.apache.org/jira/browse/IMPALA-8475
> Project: IMPALA
> Issue Type: Bug
> Components: Infrastructure
> Affects Versions: Impala 3.3.0
> Reporter: Joe McDonnell
> Assignee: Joe McDonnell
> Priority: Blocker
> Labels: broken-build
>
> A recent change added a bash array to keep track of which build types had
> been specified to buildall.sh. On Ubuntu, everything seems to work. On
> Centos, this is producing an error:
> {noformat}
> 15:23:15
> /data/jenkins/workspace/impala-asf-master-core/repos/Impala/buildall.sh: line
> 316: CMAKE_BUILD_TYPE_LIST[0]: unbound variable{noformat}
> Given that this is on a debug build, that should mean that the
> CMAKE_BUILD_TYPE_LIST is empty. The current theory is that Ubuntu and Centos
> treat [[ -v VARNAME ]] differently, so in the following code, we are entering
> the block even with an empty list:
> {code:java}
> if [[ -v CMAKE_BUILD_TYPE_LIST ]]; then
> if [[ ${#CMAKE_BUILD_TYPE_LIST[@]} -gt 1 ]]; then
> echo "ERROR: more than one CMake build type defined:
> ${CMAKE_BUILD_TYPE_LIST[@]}"
> exit 1
> fi
> CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE_LIST[0]}
> fi
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]