Skip to content

Commit

Permalink
SNOW-301718 Build libsnowflakeclient dependencies with XP toolchain (#…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
sfc-gh-vreddy committed Apr 30, 2021
1 parent 38695fe commit 7201b87
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 10 deletions.
11 changes: 9 additions & 2 deletions ci/build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions scripts/build_azuresdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 $@
Expand Down
6 changes: 5 additions & 1 deletion scripts/build_oob.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_uuid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion scripts/build_zlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 15 additions & 3 deletions scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 7201b87

Please sign in to comment.