[ https://issues.apache.org/jira/browse/HADOOP-12662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15094427#comment-15094427 ]
Colin Patrick McCabe commented on HADOOP-12662: ----------------------------------------------- Thanks for working on this, [~drankye]. {code} 328 # Bundle a native library if requested. Exit 1 in case error happens. 329 # Usage: check_bundle_lib bundleOption libOption libPattern libDir 330 function check_bundle_lib() { {code} It seems like this should be named {{bundle_native_lib}} or something like that, rather than {{check_bundle_lib}}. It does more than just "checking," right? It actually performs the bundling. {code} 343 if [[ X"${libDir}" = X ]] || [[ ! -d ${libDir} ]]; then 344 echo "The required option $libOption isn't given or invalid. Bundling the lib failed" 345 exit 1 346 fi {code} As [~aw] pointed out, the 'X' construction isn't needed in bash. Suggest using this instead: {code} if [[ -z ${libDir} ]] || [[ ! -d ${libDir} ]]; then ... {code} {code} 404 if [[ X"${bundle.openssl.in.bin}" = X"true" ]]; then 405 if [[ X"${bundle.openssl}" = X"true" ]]; then {code} try using this instead (note the double equals sign): {code} 404 if [[ "${bundle.openssl.in.bin}" == "true" ]]; then 405 if [[ "${bundle.openssl}" == "true" ]]; then {code} +1 once those are addressed. Perhaps we should open a follow-on jira to split this out into a separate bash file, which would be a bit cleaner. > The build should fail if a -Dbundle option fails > ------------------------------------------------ > > Key: HADOOP-12662 > URL: https://issues.apache.org/jira/browse/HADOOP-12662 > Project: Hadoop Common > Issue Type: Improvement > Reporter: Kai Zheng > Assignee: Kai Zheng > Attachments: HADOOP-12662-v1.patch, HADOOP-12662-v2.patch, > HADOOP-12662-v3.patch, HADOOP-12662-v4.patch > > > Per some discussion with [~cmccabe], it would be good to refine and make it > consistent the behaviors in bundling native libraries when building dist > package. > For all native libraries to bundle, if the bundling option like > {{-Dbundle.snappy}} is specified, then the lib option like {{-Dsnappy.lib}} > will be checked and ensured to be there, but if not, it will then report > error and fail the building explicitly. > {{BUILDING.txt}} would also be updated to explicitly state this behavior. -- This message was sent by Atlassian JIRA (v6.3.4#6332)