Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-1524259: Add option to build libsnowflakeclient as dynamic library #782

Open
wants to merge 67 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
b020c2d
Rebase from master to branch
sfc-gh-ext-simba-hx Aug 7, 2024
55fcb5c
update for Linux build
SimbaGithub Aug 8, 2024
8e8411c
copy the dynamic lib to deps-build folder
sfc-gh-ext-simba-jl Nov 26, 2024
9aa79b0
fix undefined reference error on linux
sfc-gh-ext-simba-jl Nov 26, 2024
09b7185
fix copy error on linux
sfc-gh-ext-simba-jl Nov 27, 2024
e95c698
fix mac build
sfc-gh-ext-simba-jl Nov 28, 2024
bfcc89b
Merge branch 'master' into SNOW-1524259-dynamic-library
sfc-gh-ext-simba-jl Jan 9, 2025
f5c24a3
Merge branch 'master' into SNOW-1524259-dynamic-library
sfc-gh-ext-simba-jl Jan 9, 2025
f562da7
update all export files and link tests to both static and dynamic lib…
sfc-gh-ext-simba-jl Jan 10, 2025
100791a
fix windows build error
sfc-gh-ext-simba-jl Jan 10, 2025
3860a1e
fix linux and mac dynamic lib build and fix windows dynamic lib tests
sfc-gh-ext-simba-jl Jan 14, 2025
e655135
Merge branch 'master' into SNOW-1524259-dynamic-library
sfc-gh-ext-simba-jl Jan 14, 2025
519196a
move test_unit_privatelink to TESTS_C_UNIT
sfc-gh-ext-simba-jl Jan 14, 2025
53a6957
remove thirdparty deps when dynamically linking the tests
sfc-gh-ext-simba-jl Jan 16, 2025
75698f8
fix the linking to snowflake_dynamic for tests
sfc-gh-ext-simba-jl Jan 16, 2025
fceed68
link dynamic test to dynamic lib only
sfc-gh-ext-simba-jl Jan 21, 2025
bd41551
fix dynamic test failure
sfc-gh-ext-simba-jl Jan 22, 2025
f3485f2
enable debug logging for windows test
sfc-gh-ext-simba-jl Jan 22, 2025
c421af2
fix running dynamic test on mac
sfc-gh-ext-simba-jl Jan 24, 2025
327d68b
fix mac test failure
sfc-gh-ext-simba-jl Jan 24, 2025
aed384e
disbable logging on windows
sfc-gh-ext-simba-jl Jan 24, 2025
eb61ddc
debug - disable two failing tests
sfc-gh-ext-simba-jl Jan 24, 2025
80a5c16
debug - enable test_large_result_set
sfc-gh-ext-simba-jl Jan 24, 2025
e1185d6
debug - enable test_crud and disable test_large_result_set
sfc-gh-ext-simba-jl Jan 24, 2025
da91611
debug - enable logging for test_crud
sfc-gh-ext-simba-jl Jan 25, 2025
b7b5a22
remove logging
sfc-gh-ext-simba-jl Jan 27, 2025
94dc044
Merge branch 'master' into SNOW-1524259-dynamic-library
sfc-gh-ext-simba-jl Jan 27, 2025
93cd64b
update cmake to restrict changes to dynamic lib only
sfc-gh-ext-simba-jl Jan 28, 2025
cc81459
Merge branch 'master' into SNOW-1524259-dynamic-library
sfc-gh-ext-simba-jl Jan 28, 2025
091eb16
Merge branch 'master' into SNOW-1524259-dynamic-library
sfc-gh-ext-simba-jl Jan 28, 2025
dacc4a6
Merge branch 'master' into SNOW-1524259-dynamic-library
sfc-gh-ext-simba-jl Jan 28, 2025
d006d16
remove ignore 4099 flag in dynamic linking test
sfc-gh-ext-simba-jl Jan 30, 2025
c7fe9a0
Merge branch 'master' into SNOW-1524259-dynamic-library
sfc-gh-ext-simba-jl Jan 30, 2025
1e6d91b
Merge branch 'SNOW-1524259-dynamic-library' of https://github.com/sno…
sfc-gh-ext-simba-jl Jan 30, 2025
d991291
revert changes in test cmakelist
sfc-gh-ext-simba-jl Jan 30, 2025
0cf2aa3
Merge branch 'master' into SNOW-1524259-dynamic-library
sfc-gh-ext-simba-jl Jan 31, 2025
b2e0fb1
Merge branch 'master' into SNOW-1524259-dynamic-library
sfc-gh-ext-simba-jl Feb 4, 2025
949ed6a
Merge branch 'master' into SNOW-1524259-dynamic-library
sfc-gh-ext-simba-jl Feb 6, 2025
ed6cd40
fix build error
sfc-gh-ext-simba-jl Feb 7, 2025
ab22a7d
remove ignore from cmake and fix test failure
sfc-gh-ext-simba-jl Feb 7, 2025
bc99755
use dllexport/visibility instead of exports
sfc-gh-ext-simba-jl Feb 8, 2025
73d89ac
Merge branch 'master' into SNOW-1524259-dynamic-library
sfc-gh-ext-simba-jl Feb 10, 2025
ca4e6bd
fix mac build and expose and hide functions as requested
sfc-gh-ext-simba-jl Feb 12, 2025
aa3248a
separate static/dynamic build and tests and update artifacts name
sfc-gh-ext-simba-jl Feb 15, 2025
7caae7c
fix windows test issue and linux/mac builds
sfc-gh-ext-simba-jl Feb 17, 2025
bb619fc
Merge branch 'master' into SNOW-1524259-dynamic-library
sfc-gh-ext-simba-jl Feb 18, 2025
7d05412
replace free() with SF_FREE() in tests
sfc-gh-ext-simba-jl Feb 19, 2025
be50fcf
Merge branch 'master' into SNOW-1524259-dynamic-library
sfc-gh-ext-simba-jl Feb 20, 2025
d48b765
add BUILDING_LIBSFC to restrict exporting public functions when build…
sfc-gh-ext-simba-jl Feb 21, 2025
c061a4f
Merge branch 'master' into SNOW-1524259-dynamic-library
sfc-gh-ext-simba-hx Mar 4, 2025
f58ccb6
Merge branch 'master' into SNOW-1524259-dynamic-library
sfc-gh-ext-simba-jl Mar 5, 2025
720c1ea
Merge branch 'master' into SNOW-1524259-dynamic-library
sfc-gh-ext-simba-jl Mar 11, 2025
3b48d54
fix test_async on windows debug dynamic build
sfc-gh-ext-simba-jl Mar 13, 2025
1158d77
fix linux and mac build
sfc-gh-ext-simba-jl Mar 13, 2025
1389ea5
rename helper function used in test
sfc-gh-ext-simba-jl Mar 13, 2025
e1cd3a5
Merge branch 'master' into SNOW-1524259-dynamic-library
sfc-gh-ext-simba-jl Mar 13, 2025
f383334
Merge branch 'master' into SNOW-1524259-dynamic-library
sfc-gh-ext-simba-jl Mar 13, 2025
95ff303
fix mac build
sfc-gh-ext-simba-jl Mar 13, 2025
214b7f3
Merge branch 'master' into SNOW-1524259-dynamic-library
sfc-gh-ext-simba-jl Mar 21, 2025
e680895
Merge branch 'master' into SNOW-1524259-dynamic-library
sfc-gh-ext-simba-jl Mar 27, 2025
ec905bf
Merge branch 'master' into SNOW-1524259-dynamic-library
sfc-gh-ext-simba-jl Mar 27, 2025
117e6bf
Merge branch 'master' into SNOW-1524259-dynamic-library
sfc-gh-ext-simba-jl Mar 31, 2025
50b4a5a
Merge branch 'master' into SNOW-1524259-dynamic-library
sfc-gh-dstempniak Apr 2, 2025
4837b26
Merge branch 'master' into SNOW-1524259-dynamic-library
sfc-gh-ext-simba-jl Apr 3, 2025
5034167
Merge branch 'master' into SNOW-1524259-dynamic-library
sfc-gh-ext-simba-jl Apr 3, 2025
a76cb69
Merge branch 'master' into SNOW-1524259-dynamic-library
sfc-gh-ext-simba-jl Apr 4, 2025
39f4b65
Merge branch 'master' into SNOW-1524259-dynamic-library
sfc-gh-ext-simba-jl Apr 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
matrix:
build_type: [ 'Debug', 'Release' ]
cloud_provider: [ 'AWS', 'AZURE', 'GCP' ]
link_type: [ 'Dynamic', 'Static' ]
steps:
- uses: actions/checkout@v4
- name: Restore cached deps
Expand All @@ -37,6 +38,7 @@ jobs:
shell: bash
env:
BUILD_TYPE: ${{ matrix.build_type }}
LINK_TYPE: ${{ matrix.link_type }}
run: ci/build_linux.sh
- name: Cache deps
id: cache-save-deps
Expand All @@ -54,6 +56,7 @@ jobs:
env:
BUILD_TYPE: ${{ matrix.build_type }}
CLOUD_PROVIDER: ${{ matrix.cloud_provider }}
LINK_TYPE: ${{ matrix.link_type }}
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
run: ci/test_linux.sh

Expand All @@ -67,6 +70,7 @@ jobs:
build_type: [ 'Debug', 'Release' ]
vs_version: [ 'VS16' ]
cloud_provider: [ 'AWS', 'AZURE', 'GCP' ]
link_type: [ 'Dynamic', 'Static' ]
steps:
- uses: actions/checkout@v4
- name: Install CMake
Expand All @@ -89,6 +93,7 @@ jobs:
PLATFORM: ${{ matrix.platform }}
BUILD_TYPE: ${{ matrix.build_type }}
VS_VERSION: ${{ matrix.vs_version }}
LINK_TYPE: ${{ matrix.link_type }}
run: ci\build_win.bat
- name: Cache deps
id: cache-save-deps
Expand All @@ -107,6 +112,7 @@ jobs:
PLATFORM: ${{ matrix.platform }}
BUILD_TYPE: ${{ matrix.build_type }}
VS_VERSION: ${{ matrix.vs_version }}
LINK_TYPE: ${{ matrix.link_type }}
CLOUD_PROVIDER: ${{ matrix.cloud_provider }}
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
run: ci\test_win.bat
Expand All @@ -120,6 +126,7 @@ jobs:
build_type: [ 'Debug', 'Release' ]
vs_version: [ 'VS17' ]
cloud_provider: [ 'AWS', 'AZURE', 'GCP' ]
link_type: [ 'Dynamic', 'Static' ]
steps:
- uses: actions/checkout@v4
- name: Install CMake
Expand All @@ -142,6 +149,7 @@ jobs:
PLATFORM: ${{ matrix.platform }}
BUILD_TYPE: ${{ matrix.build_type }}
VS_VERSION: ${{ matrix.vs_version }}
LINK_TYPE: ${{ matrix.link_type }}
run: ci\build_win.bat
- name: Cache deps
id: cache-save-deps
Expand All @@ -160,6 +168,7 @@ jobs:
PLATFORM: ${{ matrix.platform }}
BUILD_TYPE: ${{ matrix.build_type }}
VS_VERSION: ${{ matrix.vs_version }}
LINK_TYPE: ${{ matrix.link_type }}
CLOUD_PROVIDER: ${{ matrix.cloud_provider }}
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
run: ci\test_win.bat
Expand All @@ -171,6 +180,7 @@ jobs:
matrix:
build_type: [ 'Debug', 'Release' ]
cloud_provider: [ 'AWS', 'AZURE', 'GCP' ]
link_type: [ 'Dynamic', 'Static' ]
steps:
- uses: actions/checkout@v4
- name: Install Homebrew Bash
Expand All @@ -187,6 +197,7 @@ jobs:
shell: bash
env:
BUILD_TYPE: ${{ matrix.build_type }}
LINK_TYPE: ${{ matrix.link_type }}
run: ./ci/build_mac.sh
- name: Cache deps
id: cache-save-deps
Expand All @@ -200,6 +211,7 @@ jobs:
env:
BUILD_TYPE: ${{ matrix.build_type }}
CLOUD_PROVIDER: ${{ matrix.cloud_provider }}
LINK_TYPE: ${{ matrix.link_type }}
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
run: ci/test_mac.sh
build-test-codecov-aws:
Expand Down
126 changes: 108 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ include(cmake/flags.cmake)
# we don't need Dart and other tools.
enable_testing()

add_compile_definitions(LOG_USE_COLOR)
add_compile_definitions(BUILDING_LIBSFC LOG_USE_COLOR)

option(BUILD_TESTS "True if build tests" on)
option(MOCK "True if mock should be used" off)
Expand Down Expand Up @@ -430,18 +430,30 @@ if (MOCK)
message("libcmocka is located at " ${CMOCKA_LIB})
endif ()

add_library(snowflakeclient STATIC ${SOURCE_FILES} ${SOURCE_FILES_PUT_GET} ${SOURCE_FILES_CPP_WRAPPER})
target_compile_features(snowflakeclient PUBLIC cxx_std_17)
target_compile_features(snowflakeclient PUBLIC c_std_99)
if (UNIX)
target_compile_definitions(snowflakeclient PUBLIC _LARGEFILE64_SOURCE)
endif ()
if (NOT BUILD_SHARED_LIBS)
add_compile_definitions(LIBSFC_STATICLIB)
add_library(snowflakeclient STATIC ${SOURCE_FILES} ${SOURCE_FILES_PUT_GET} ${SOURCE_FILES_CPP_WRAPPER})
target_compile_features(snowflakeclient PUBLIC cxx_std_17)
target_compile_features(snowflakeclient PUBLIC c_std_99)
if (UNIX)
target_compile_definitions(snowflakeclient PUBLIC _LARGEFILE64_SOURCE)
endif ()

if (LINUX)
target_compile_options(snowflakeclient PUBLIC -pthread)
target_link_options(snowflakeclient PUBLIC -pthread)
endif ()
#set (CMAKE_CXX_STANDARD 11)
if (LINUX)
target_compile_options(snowflakeclient PUBLIC -pthread)
target_link_options(snowflakeclient PUBLIC -pthread)
endif ()
#set (CMAKE_CXX_STANDARD 11)
else()
if (WIN32)
add_library(snowflakeclient ${SOURCE_FILES} ${SOURCE_FILES_PUT_GET} ${SOURCE_FILES_CPP_WRAPPER})
else()
add_library(snowflakeclient ${SOURCE_FILES} ${SOURCE_FILES_PUT_GET} ${SOURCE_FILES_CPP_WRAPPER})
target_compile_definitions(snowflakeclient PUBLIC _LARGEFILE64_SOURCE)
endif()
target_compile_features(snowflakeclient PUBLIC cxx_std_17)
target_compile_features(snowflakeclient PUBLIC c_std_99)
endif()

if(LINUX)
link_directories(
Expand Down Expand Up @@ -491,15 +503,93 @@ elseif()
endif()
endif()

set(AWS_ALL_LIBS
${AWS_S3_LIB}
${AWS_CORE_LIB}
${AWS_CRT_CPP_LIB}
${AWS_C_EVENT_STREAM_LIB}
${AWS_C_CHECKSUMS_LIB}
${AWS_C_S3_LIB}
${AWS_C_AUTH_LIB}
${AWS_C_HTTP_LIB}
${AWS_C_COMPRESSION_LIB}
${AWS_C_IO_LIB}
${AWS_C_CAL_LIB}
${AWS_C_MQTT_LIB}
${AWS_S2N_LIB}
${AWS_C_COMMON_LIB}
${AWS_C_SDKUTILS_LIB}
)

if (LINUX)
# Linux
target_link_libraries(snowflakeclient rt dl z)
endif ()
if (APPLE)
# OSX. no librt is required.
target_link_libraries(snowflakeclient dl z)
set(ARROW_ALL_LIBS
${ARROW_ARROW_LIB}
${BOOST_FILESYSTEM_LIB} ${BOOST_REGEX_LIB} ${BOOST_SYSTEM_LIB}
${ARROW_BROTLIDEC_LIB} ${ARROW_BROTLIENC_LIB} ${ARROW_BROTLICOMMON_LIB}
${ARROW_DOUBLECONVERSION_LIB}
${ARROW_FLATBUFFERS_LIB}
${ARROW_GFLAGS_LIB}
${ARROW_GLOG_LIB}
${ARROW_JEMALLOCPIC_LIB}
${ARROW_LZ4_LIB} ${ARROW_LZO2_LIB}
${ARROW_SNAPPY_LIB}
${ARROW_ZSTD_LIB})
elseif (APPLE)
set(ARROW_ALL_LIBS
${ARROW_ARROW_LIB}
${BOOST_FILESYSTEM_LIB} ${BOOST_REGEX_LIB} ${BOOST_SYSTEM_LIB}
${ARROW_BROTLICOMMON_LIB} ${ARROW_BROTLIDEC_LIB} ${ARROW_BROTLIENC_LIB}
${ARROW_FLATBUFFERS_LIB}
${ARROW_GFLAGS_LIB}
${ARROW_GLOG_LIB}
${ARROW_JEMALLOCPIC_LIB}
${ARROW_LZ4_LIB} ${ARROW_LZO2_LIB}
${ARROW_SNAPPY_LIB}
${ARROW_ZSTD_LIB})
elseif (WIN32)
set(ARROW_ALL_LIBS
${ARROW_ARROW_LIB}
${BOOST_FILESYSTEM_LIB} ${BOOST_REGEX_LIB} ${BOOST_SYSTEM_LIB}
${ARROW_BROTLICOMMON_LIB} ${ARROW_BROTLIDEC_LIB} ${ARROW_BROTLIENC_LIB}
${ARROW_BZ2_LIB}
${ARROW_DOUBLECONVERSION_LIB}
${ARROW_EVENT_LIB} ${ARROW_EVENTCORE_LIB} ${ARROW_EVENTEXTRA_LIB}
${ARROW_FLATBUFFERS_LIB}
${ARROW_GFLAGS_LIB}
${ARROW_GLOG_LIB}
${ARROW_LZ4_LIB}
${ARROW_SNAPPY_LIB}
${ARROW_ZLIB_LIB} ${ARROW_ZSTD_LIB})
endif ()

if (NOT BUILD_SHARED_LIBS)
if (LINUX)
# Linux
target_link_libraries(snowflakeclient rt dl z)
endif ()
if (APPLE)
# OSX. no librt is required.
target_link_libraries(snowflakeclient dl z)
endif ()
else()
if (LINUX)
set(DYNAMICLIB_LINK_OPTS rt dl z ${CMOCKA_LIB} ${ARROW_ALL_LIBS} ${AZURE_STORAGE_LITE_LIB} ${AWS_ALL_LIBS} -Wl,--whole-archive ${OOB_LIB} ${CURL_LIB} ${SSL_LIB} ${CRYPTO_LIB} ${UUID_LIB}
pthread -Wl,--no-whole-archive -Wl,--as-needed -static-libgcc -static-libstdc++)
elseif (APPLE)
set(DYNAMICLIB_LINK_OPTS dl z pthread "-framework CoreFoundation -framework SystemConfiguration -framework CoreServices -framework security"
${CMOCKA_LIB} ${ARROW_ALL_LIBS} ${AZURE_STORAGE_LITE_LIB} ${AWS_ALL_LIBS} ${OOB_LIB} ${CURL_LIB} ${SSL_LIB} ${CRYPTO_LIB} ${UUID_LIB})
elseif (WIN32)
if (WIN32_DEBUG)
set(DYNAMICLIB_LINK_OPTS ${CMOCKA_LIB} ${ARROW_ALL_LIBS} ${AWS_ALL_LIBS} ${OOB_LIB} ${CURL_LIB} ${SSL_LIB} ${CRYPTO_LIB} ${ZLIB_LIB} ${AZURE_STORAGE_LITE_LIB}
Version.lib Userenv.lib Bcrypt.lib ucrtd.lib Secur32.lib Ncrypt.lib Shlwapi.lib)
else()
set(DYNAMICLIB_LINK_OPTS ${CMOCKA_LIB} ${AWS_ALL_LIBS} ${AZURE_STORAGE_LITE_LIB} ${ARROW_ALL_LIBS} ${CURL_LIB} ${OOB_LIB} ${SSL_LIB} ${CRYPTO_LIB} ${ZLIB_LIB}
Version.lib Userenv.lib Bcrypt.lib Secur32.lib Ncrypt.lib Shlwapi.lib)
endif()
endif()
target_link_libraries(snowflakeclient ${DYNAMICLIB_LINK_OPTS})
endif()

add_subdirectory(examples)

if (BUILD_TESTS)
Expand Down
6 changes: 4 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,14 @@ Linux and OSX

Windows
^^^^^^^^^^
Set environment variables: PLATFORM: [x64, x86], BUILD_TYPE: [Debug, Release], VS_VERSION: [VS15, VS16, VS17] and run the script.
Set environment variables: PLATFORM: [x64, x86], BUILD_TYPE: [Debug, Release], VS_VERSION: [VS15, VS16, VS17], LINK_TYPE: [Dynamic, Static] and run the script.

.. code-block:: bash

set platform=x64
set build_type=Release
set vs_version=VS17
set build_type=Static

.\scripts\build_dependencies.bat
.\scripts\build_libsnowflakeclient.bat
Expand Down Expand Up @@ -122,13 +123,14 @@ Linux and OSX
Windows
^^^^^^^^^^

Set environment variables: PLATFORM: [x64, x86], BUILD_TYPE: [Debug, Release], VS_VERSION: [VS15, VS16, VS17] and run the script.
Set environment variables: PLATFORM: [x64, x86], BUILD_TYPE: [Debug, Release], VS_VERSION: [VS15, VS16, VS17], LINK_TYPE: [Dynamic, Static] and run the script.

.. code-block:: bash

set platform=x64
set build_type=Release
set vs_version=VS17
set build_type=Static

.\scripts\run_tests.bat

Expand Down
10 changes: 6 additions & 4 deletions ci/build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ CI_BUILD_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SCRIPTS_DIR=$( cd "$CI_BUILD_DIR/../../scripts" && pwd )

[[ -z "$BUILD_TYPE" ]] && echo "Set BUILD_TYPE: [Debug, Release]" && exit 1
[[ -z "$LINK_TYPE" ]] && export LINK_TYPE=Static

if [[ -z "$UPLOAD_TO_S3" ]]; then
if [[ -z "$GITHUB_ACTIONS" ]] && [[ -n "$GIT_BRANCH" ]]; then
Expand All @@ -19,7 +20,7 @@ if [[ -z "$UPLOAD_TO_S3" ]]; then
fi
echo "UPLOAD_TO_S3=${UPLOAD_TO_S3}"

source $SCRIPTS_DIR/_init.sh -t $BUILD_TYPE "$@"
source $SCRIPTS_DIR/_init.sh -t $BUILD_TYPE -l $LINK_TYPE "$@"
source $SCRIPTS_DIR/utils.sh
init_git_variables

Expand Down Expand Up @@ -77,10 +78,11 @@ function build_component()
local component_name=$1
local component_script=$2
local build_type=$3
local other_args="$4"
local link_type=$4
local other_args="$5"

echo "=== build: $component_name ==="
"$component_script" -t "$build_type" "$other_args"
"$component_script" -t "$build_type" -l "$link_type" "$other_args"
local component_version=$("$component_script" -v)

if [[ "$UPLOAD_TO_S3" == "true" ]]; then
Expand Down Expand Up @@ -110,6 +112,6 @@ if [[ -n "$GITHUB_ACTIONS" ]]; then
rm -rf $SCRIPTS_DIR/../deps/*
fi

build_component libsnowflakeclient "$SCRIPTS_DIR/build_libsnowflakeclient.sh" "$target" "$@"
build_component libsnowflakeclient "$SCRIPTS_DIR/build_libsnowflakeclient.sh" "$target" "$linking" "$@"


1 change: 1 addition & 0 deletions ci/build_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ docker run \
-e GITHUB_REF \
-e CLIENT_CODE_COVERAGE \
-e USE_EXTRA_WARNINGS \
-e LINK_TYPE \
-w /mnt/host \
"${BUILD_IMAGE_NAME}" \
"/mnt/host/ci/build/build.sh"
Expand Down
4 changes: 3 additions & 1 deletion ci/build_win.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ goto :EOF
set build_type=%~2
set vs_version=%~3
set dynamic_runtime=%~4

call "%scriptdir%..\scripts\_init.bat" %platform% %build_type% %vs_version%
if %ERRORLEVEL% NEQ 0 goto :error
call :download_build_component zlib "%zlib_build_script%" "%dynamic_runtime%"
Expand All @@ -68,6 +69,7 @@ goto :EOF
if defined GITHUB_ACTIONS (
rd /S /Q %scriptdir%\..\deps
)

call :build_component libsnowflakeclient "%libsnowflakeclient_build_script%" "%dynamic_runtime%"
if %ERRORLEVEL% NEQ 0 goto :error
if defined GITHUB_ACTIONS (
Expand Down Expand Up @@ -140,7 +142,7 @@ goto :EOF
set dynamic_runtime=%~3

echo === build: %component_name% ===
call %build_script% :build %platform% %build_type% %vs_version% %dynamic_runtime% ON
call %build_script% :build %platform% %build_type% %vs_version% %dynamic_runtime% ON %link_type%
if %ERRORLEVEL% NEQ 0 goto :error

call %build_script% :get_version
Expand Down
4 changes: 3 additions & 1 deletion ci/test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ SCRIPTS_DIR=$( cd "$CI_TEST_DIR/../../scripts" && pwd )
set -o pipefail

[[ -z "$BUILD_TYPE" ]] && echo "Set BUILD_TYPE: [Debug, Release]" && exit 1
[[ -z "$LINK_TYPE" ]] && export LINK_TYPE=Static

source $SCRIPTS_DIR/_init.sh -t $BUILD_TYPE
source $SCRIPTS_DIR/_init.sh -t $BUILD_TYPE -l $LINK_TYPE
echo "CMAKE: $CMAKE, CTEST: $CTEST"
source $SCRIPTS_DIR/utils.sh

Expand All @@ -33,6 +34,7 @@ function test_component()
local build_type=$3

echo "build_type: $build_type"
echo "link_type: $LINK_TYPE"
local component_version=$("$component_script" -v)
local cmake_file_name=$(get_cmake_file_name $component_name $component_version $build_type)
local cmake_dir=cmake-build-$build_type
Expand Down
1 change: 1 addition & 0 deletions ci/test_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ docker run \
-e GITHUB_SHA \
-e RUNNER_TRACKING_ID \
-e CLIENT_CODE_COVERAGE \
-e LINK_TYPE \
-w /mnt/host \
"${TEST_IMAGE_NAME}" \
"/mnt/host/ci/test/test.sh"
Loading