From 7201b87539d31c01e044eedbedc4e0b95e40ebc3 Mon Sep 17 00:00:00 2001 From: viswa <66025379+sfc-gh-vreddy@users.noreply.github.com> Date: Tue, 30 Mar 2021 10:25:34 -0700 Subject: [PATCH] SNOW-301718 Build libsnowflakeclient dependencies with XP toolchain (#301) SNOW-301714 prevent mixing up of XP artifacts with ODBC SNOW-301727 upload xp artifacts to a different stage Description Libsnowflakeclient for XP built using gcc/g++82 compiler toolchain Testing For ODBC tested on Jenkins and Github actions XP build will be tested separately --- ci/build/build.sh | 11 +++++++++-- scripts/build_azuresdk.sh | 10 ++++++++-- scripts/build_oob.sh | 6 +++++- scripts/build_uuid.sh | 2 +- scripts/build_zlib.sh | 6 +++++- scripts/utils.sh | 18 +++++++++++++++--- 6 files changed, 43 insertions(+), 10 deletions(-) diff --git a/ci/build/build.sh b/ci/build/build.sh index b391661238..edae515f0d 100755 --- a/ci/build/build.sh +++ b/ci/build/build.sh @@ -31,7 +31,12 @@ function download_build_component() echo "Skip download or build." else rm -rf $DEPENDENCY_DIR/$component_name - if ! aws s3 cp --only-show-errors s3://sfc-dev1-data/dependency/$component_name/$zip_file_name $ARTIFACTS_DIR; then + if [[ ! -z "$XP_BUILD" ]] ; then + src_path="s3://sfc-dev1-data/dependency/snowflakeclient_for_xp/$component_name" + else + src_path="s3://sfc-dev1-data/dependency/$component_name" + fi + if ! aws s3 cp --only-show-errors $src_path/$zip_file_name $ARTIFACTS_DIR; then echo "=== build: $component_name ===" "$component_script" -t "$build_type" if [[ "$GIT_BRANCH" == "origin/master" ]]; then @@ -61,7 +66,9 @@ function build_component() "$component_script" -t "$build_type" "$other_args" local component_version=$("$component_script" -v) if [[ -z "$GITHUB_ACTIONS" ]] && [[ -n "$GIT_BRANCH" ]]; then - upload_to_sfc_jenkins $component_name $component_version $build_type + if [[ -z $XP_BUILD ]] ; then #upload to jenkins if not XP build + upload_to_sfc_jenkins $component_name $component_version $build_type + fi if [[ "$GIT_BRANCH" == "origin/master" ]]; then upload_to_sfc_dev1_data $component_name $component_version $build_type fi diff --git a/scripts/build_azuresdk.sh b/scripts/build_azuresdk.sh index 0213c7530b..1b45c48050 100755 --- a/scripts/build_azuresdk.sh +++ b/scripts/build_azuresdk.sh @@ -12,8 +12,14 @@ set -o pipefail AZURE_VERSION=0.1.18 -export CC="/usr/lib64/ccache/gcc52 -g" -export CXX="/usr/lib64/ccache/g++52 -g" +#If its not for XP use gcc52 +if [[ -z "$XP_BUILD" ]] ; then + export CC="/usr/lib64/ccache/gcc52" + export CXX="/usr/lib64/ccache/g++52" +else + export CC="gcc82" + export CXX="g++82" +fi DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source $DIR/_init.sh $@ diff --git a/scripts/build_oob.sh b/scripts/build_oob.sh index 496dfcf801..5cdf388747 100755 --- a/scripts/build_oob.sh +++ b/scripts/build_oob.sh @@ -36,7 +36,11 @@ cd $OOB_SOURCE_DIR export CURL_DIR=curl-7.68.0 if [[ "$PLATFORM" == "linux" ]]; then # Linux 64 bit - export CC=gcc52 + if [[ -z "$XP_BUILD" ]] ; then + export CC=gcc52 + else + export CC=gcc82 + fi export AR=ar export AROPTIONS=rcs make distclean clean > /dev/null || true diff --git a/scripts/build_uuid.sh b/scripts/build_uuid.sh index 7f38b85f64..517d2906f3 100755 --- a/scripts/build_uuid.sh +++ b/scripts/build_uuid.sh @@ -43,7 +43,7 @@ if [[ "$PLATFORM" == "linux" ]]; then # Make sure the compiled binary is position independent as ODBC is a shared library export CFLAGS="-fPIC" export AL_OPTS="-I/usr/share/aclocal" - ./configure --disable-all-programs --enable-libuuid --prefix=$DEPENDENCY_DIR/uuid || true + ./configure --disable-bash-completion --disable-all-programs --enable-libuuid --prefix=$DEPENDENCY_DIR/uuid || true echo "Compiling UUID source" make install || true elif [[ "$PLATFORM" == "darwin" ]]; then diff --git a/scripts/build_zlib.sh b/scripts/build_zlib.sh index cde631ffda..97f1f6134c 100755 --- a/scripts/build_zlib.sh +++ b/scripts/build_zlib.sh @@ -35,7 +35,11 @@ cd $SOURCE_DIR if [[ "$PLATFORM" == "linux" ]]; then # Linux 64 bit - export CC=gcc52 + if [[ -z "$XP_BUILD" ]] ; then + export CC=gcc52 + else + export CC=gcc82 + fi export CFLAGS="-fPIC" make -f Makefile.in distclean > /dev/null || true ./configure ${zlib_config_opts[@]} > /dev/null || true diff --git a/scripts/utils.sh b/scripts/utils.sh index 0351022c59..e5020c3f02 100755 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -85,7 +85,11 @@ function upload_to_sfc_dev1_data() local build_type=$3 local zip_file_name=$(get_zip_file_name $component_name $component_version $build_type) - aws s3 cp --only-show-errors $UTILS_DIR/../artifacts/$zip_file_name s3://sfc-dev1-data/dependency/$component_name/ + if [[ ! -z "$XP_BUILD" ]] ; then + aws s3 cp --only-show-errors $UTILS_DIR/../artifacts/$zip_file_name s3://sfc-dev1-data/dependency/snowflakeclient_for_xp/$component_name/ + else + aws s3 cp --only-show-errors $UTILS_DIR/../artifacts/$zip_file_name s3://sfc-dev1-data/dependency/$component_name/ + fi } function upload_to_sfc_jenkins() @@ -97,7 +101,11 @@ function upload_to_sfc_jenkins() local git_branch_base_name=$(echo $GIT_BRANCH | awk -F/ '{print $2}') local zip_file_name=$(get_zip_file_name $component_name $component_version $build_type) - local target_path=s3://sfc-jenkins/repository/$component_name/$PLATFORM/$git_branch_base_name/$GIT_COMMIT/ + if [[ ! -z "$XP_BUILD" ]] ; then + local target_path=s3://sfc-jenkins/repository/snowflakeclient_for_xp/$component_name/$PLATFORM/$git_branch_base_name/$GIT_COMMIT/ + else + local target_path=s3://sfc-jenkins/repository/$component_name/$PLATFORM/$git_branch_base_name/$GIT_COMMIT/ + fi echo "=== uploading artifacts/$zip_file_name to $target_path" aws s3 cp --only-show-errors $UTILS_DIR/../artifacts/$zip_file_name $target_path local cmake_file_name=$(get_cmake_file_name $component_name $component_version $build_type) @@ -122,7 +130,11 @@ function download_from_sfc_jenkins() mkdir -p $UTILS_DIR/../artifacts echo "$component_name $component_version $build_type" local zip_file_name=$(get_zip_file_name $component_name $component_version $build_type) - local source_path=s3://sfc-jenkins/repository/$component_name/$PLATFORM/$git_branch_base_name/$GIT_COMMIT + if [[ ! -z "$XP_BUILD" ]] ; then + local source_path=s3://sfc-jenkins/repository/snowflakeclient_for_xp/$component_name/$PLATFORM/$git_branch_base_name/$GIT_COMMIT + else + local source_path=s3://sfc-jenkins/repository/$component_name/$PLATFORM/$git_branch_base_name/$GIT_COMMIT + fi echo "=== downloading $zip_file_name from $source_path/" aws s3 cp --only-show-errors $source_path/$zip_file_name $UTILS_DIR/../artifacts/ local cmake_file_name=$(get_cmake_file_name $component_name $component_version $build_type)