Skip to content

Commit

Permalink
Merge branch 'master' into SNOW-1526335-ocsp-fail-open
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-ext-simba-hx authored Oct 10, 2024
2 parents 723fd4e + 5ccc311 commit d425e4a
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 54 deletions.
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ set(OPENSSL_VERSION_NUMBER 0x11100000L)
# Generates compile_commands.json file for clangd to parse.
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

if ($ENV{XP_BUILD})
message("-- Building libsnowflakeclient for XP")
add_definitions(-DLIBSFCLI_FOR_XP)
endif ()

if (MOCK)
set(MOCK_OBJECT_WRAPPER_FLAGS -Wl,--wrap=http_perform)
add_definitions(-DMOCK_ENABLED)
Expand Down
10 changes: 2 additions & 8 deletions ci/build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@ function download_build_component()
else
rm -rf $DEPENDENCY_DIR/$component_name

if [[ ! -z "$XP_BUILD" ]] ; then
src_path="$DEP_URL_PREFIX/snowflakeclient_for_xp/$component_name"
else
src_path="$DEP_URL_PREFIX/$component_name"
fi
src_path="$DEP_URL_PREFIX/$component_name"

if ! aws s3 cp --only-show-errors $src_path/$zip_file_name $ARTIFACTS_DIR; then
echo "=== build: $component_name ==="
Expand Down Expand Up @@ -68,9 +64,7 @@ function build_component()
"$component_script" -t "$build_type" "$other_args"
local component_version=$("$component_script" -v)
if [[ -z "$GITHUB_ACTIONS" ]] && [[ -n "$GIT_BRANCH" ]]; then
if [[ -z $XP_BUILD ]] ; then #upload to jenkins if not XP build
upload_to_sfc_jenkins $component_name $component_version $build_type
fi
upload_to_sfc_jenkins $component_name $component_version $build_type
if [[ "$GIT_BRANCH" == "origin/master" || "$GIT_BRANCH" == "master" ]]; then
upload_to_sfc_dev1_data $component_name $component_version $build_type
fi
Expand Down
4 changes: 0 additions & 4 deletions cpp/logger/SFLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,5 @@ std::string Snowflake::Client::SFLogger::getMaskedMsgVA(const char* fmt, va_list
}
}

#ifdef LIBSFCLI_FOR_XP
return std::string(buf.data());
#else
return SecretDetector::maskSecrets(std::string(buf.data()));
#endif
}
18 changes: 0 additions & 18 deletions scripts/_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,6 @@ else
export CTEST="$(which ctest)"
fi

# for XP_BUILD try gcc82 first
if [[ -n "$XP_BUILD" ]] ; then
if which gcc-82 >& /dev/null; then
GCC="$(which gcc-82)"
GXX="$(which g++-82)"
elif which gcc82 >& /dev/null; then
GCC="$(which gcc82)"
GXX="$(which g++82)"
elif which gcc-8 >& /dev/null; then
GCC="$(which gcc-8)"
GXX="$(which g++-8)"
elif which gcc8 >& /dev/null; then
GCC="$(which gcc8)"
GXX="$(which g++8)"
fi
fi

# Otherwise try gcc52 first and default to gcc.
if [[ -z "$GCC" || -z "$GXX" ]]; then
if which gcc-52 >& /dev/null; then
GCC="$(which gcc-52)"
Expand Down
18 changes: 3 additions & 15 deletions scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,7 @@ function upload_to_sfc_dev1_data()
local build_type=$3

local zip_file_name=$(get_zip_file_name $component_name $component_version $build_type)
if [[ ! -z "$XP_BUILD" ]] ; then
aws s3 cp --only-show-errors $UTILS_DIR/../artifacts/$zip_file_name $DEP_URL_PREFIX/snowflakeclient_for_xp/$component_name/
else
aws s3 cp --only-show-errors $UTILS_DIR/../artifacts/$zip_file_name $DEP_URL_PREFIX/$component_name/
fi
aws s3 cp --only-show-errors $UTILS_DIR/../artifacts/$zip_file_name $DEP_URL_PREFIX/$component_name/
}

function upload_to_sfc_jenkins()
Expand All @@ -130,11 +126,7 @@ 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)
if [[ ! -z "$XP_BUILD" ]] ; then
local target_path=$REP_URL_PREFIX/snowflakeclient_for_xp/$component_name/$PLATFORM/$git_branch_base_name/$GIT_COMMIT/
else
local target_path=$REP_URL_PREFIX/$component_name/$PLATFORM/$git_branch_base_name/$GIT_COMMIT/
fi
local target_path=$REP_URL_PREFIX/$component_name/$PLATFORM/$git_branch_base_name/$GIT_COMMIT/
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 @@ -159,11 +151,7 @@ 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)
if [[ ! -z "$XP_BUILD" ]] ; then
local source_path=$REP_URL_PREFIX/snowflakeclient_for_xp/$component_name/$PLATFORM/$git_branch_base_name/$GIT_COMMIT
else
local source_path=$REP_URL_PREFIX/$component_name/$PLATFORM/$git_branch_base_name/$GIT_COMMIT
fi
local source_path=$REP_URL_PREFIX/$component_name/$PLATFORM/$git_branch_base_name/$GIT_COMMIT
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
16 changes: 12 additions & 4 deletions tests/test_connect_negative.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,19 @@ void test_chunk_downloading_timeout(void** unused) {
sfstmt = snowflake_stmt(sf);

snowflake_set_attribute(sf, SF_CON_NETWORK_TIMEOUT, &timeout);
status = snowflake_query(sfstmt, sql_buf, 0);
if (status != SF_STATUS_SUCCESS) {
dump_error(&(sfstmt->error));
// sometime this could get timeout
for (int i = 0; i < 3; i++)
{
status = snowflake_query(sfstmt, sql_buf, 0);
if (status == SF_STATUS_SUCCESS) {
break;
}
}
if (status != SF_STATUS_SUCCESS)
{
fprintf(stderr, "test_chunk_downloading_timeout: query timeout after retry, skip.\n");
return;
}
assert_int_equal(status, SF_STATUS_SUCCESS);

unsigned long start_time = (unsigned long)time(NULL);
// we could have some rows returned in query response so fetch
Expand Down

0 comments on commit d425e4a

Please sign in to comment.