From c451233c8021cc56c5747d3eeaed223e75d125dd Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Mon, 23 Mar 2026 17:47:19 -0700 Subject: [PATCH 01/29] Set up static build of ODBC FlightSQL driver --- .github/workflows/cpp_extra.yml | 7 ++++--- cpp/src/arrow/flight/sql/odbc/CMakeLists.txt | 12 +++--------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index 199c7e2d49f..9632da5ef8d 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -525,8 +525,8 @@ jobs: permissions: packages: write env: - ARROW_BUILD_SHARED: ON - ARROW_BUILD_STATIC: OFF + ARROW_BUILD_SHARED: OFF + ARROW_BUILD_STATIC: ON ARROW_BUILD_TESTS: ON ARROW_BUILD_TYPE: release # Turn Arrow CSV off to disable `find_package(Arrow)` check on MSVC CI. @@ -536,10 +536,11 @@ jobs: ARROW_FLIGHT_SQL_ODBC: ON ARROW_FLIGHT_SQL_ODBC_INSTALLER: ON ARROW_HOME: /usr + ARROW_USE_STATIC_CRT: ON CMAKE_GENERATOR: Ninja CMAKE_INSTALL_PREFIX: /usr VCPKG_BINARY_SOURCES: 'clear;nugettimeout,600;nuget,GitHub,readwrite' - VCPKG_DEFAULT_TRIPLET: x64-windows + VCPKG_DEFAULT_TRIPLET: x64-windows-static steps: - name: Disable Crash Dialogs run: | diff --git a/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt index 4227873706f..a619cfaecd3 100644 --- a/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt @@ -70,10 +70,8 @@ set(ARROW_FLIGHT_SQL_ODBC_STATIC_INSTALL_INTERFACE_LIBS "") set(ARROW_FLIGHT_SQL_ODBC_SHARED_PRIVATE_LINK_LIBS "") if(WIN32) set(ARROW_FLIGHT_SQL_ODBC_DEPENDENCIES arrow_flight_sql) - set(ARROW_FLIGHT_SQL_ODBC_SHARED_LINK_LIBS arrow_flight_sql_shared arrow_odbc_spi_impl) + set(ARROW_FLIGHT_SQL_ODBC_SHARED_LINK_LIBS arrow_odbc_spi_impl) set(ARROW_FLIGHT_SQL_ODBC_STATIC_LINK_LIBS arrow_flight_sql_static) - list(APPEND ARROW_FLIGHT_SQL_ODBC_SHARED_INSTALL_INTERFACE_LIBS - ArrowFlight::arrow_flight_sql_shared) list(APPEND ARROW_FLIGHT_SQL_ODBC_STATIC_INSTALL_INTERFACE_LIBS ArrowFlight::arrow_flight_sql_static) list(APPEND ARROW_FLIGHT_SQL_ODBC_SHARED_PRIVATE_LINK_LIBS ODBC::ODBC ${ODBCINST}) @@ -135,15 +133,11 @@ if(ARROW_FLIGHT_SQL_ODBC_INSTALLER) # GH-47876 TODO: set up `arrow_flight_sql_odbc` component for macOS Installer # GH-47877 TODO: set up `arrow_flight_sql_odbc` component for Linux Installer if(WIN32) - # Install ODBC and its Arrow dependencies + # Install ODBC driver install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION bin COMPONENT arrow_flight_sql_odbc) - install(TARGETS arrow_shared - arrow_compute_shared - arrow_flight_shared - arrow_flight_sql_shared - arrow_flight_sql_odbc_shared + install(TARGETS arrow_flight_sql_odbc_shared RUNTIME_DEPENDENCIES PRE_EXCLUDE_REGEXES "api-ms-.*" From 1bb495c7e44aa735646b4e7e5a1eb8126642616e Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Mon, 23 Mar 2026 18:36:54 -0700 Subject: [PATCH 02/29] Set CMAKE_MSVC_RUNTIME_LIBRARY --- cpp/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index a77ed39eac8..ea8f3d64760 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -226,6 +226,11 @@ set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) # cmake options include(DefineOptions) +# Set MSVC runtime library (CMP0091 NEW policy) +if(MSVC AND ARROW_USE_STATIC_CRT) + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") +endif() + if(ARROW_BUILD_SHARED AND NOT ARROW_POSITION_INDEPENDENT_CODE) message(WARNING "Can't disable position-independent code to build shared libraries, enabling" ) From 2e4597ef37fbee16ff016d5625b5113f9677b895 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Mon, 23 Mar 2026 18:37:10 -0700 Subject: [PATCH 03/29] mimalloc doesn't respect link mode --- .github/workflows/cpp_extra.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index 9632da5ef8d..1be2ce4439b 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -536,6 +536,7 @@ jobs: ARROW_FLIGHT_SQL_ODBC: ON ARROW_FLIGHT_SQL_ODBC_INSTALLER: ON ARROW_HOME: /usr + ARROW_MIMALLOC: OFF ARROW_USE_STATIC_CRT: ON CMAKE_GENERATOR: Ninja CMAKE_INSTALL_PREFIX: /usr From a4cf5eeeea758f1e9e4a554696b44651e2e95b38 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Tue, 24 Mar 2026 21:06:02 -0700 Subject: [PATCH 04/29] wip --- cpp/src/arrow/flight/sql/odbc/CMakeLists.txt | 46 +++++++++++++++---- .../flight/sql/odbc/odbc_impl/CMakeLists.txt | 18 ++++++-- .../flight/sql/odbc/tests/CMakeLists.txt | 10 +++- 3 files changed, 58 insertions(+), 16 deletions(-) diff --git a/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt index a619cfaecd3..3d905128305 100644 --- a/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt @@ -68,7 +68,17 @@ set(ARROW_FLIGHT_SQL_ODBC_DEPENDENCIES "") set(ARROW_FLIGHT_SQL_ODBC_SHARED_INSTALL_INTERFACE_LIBS "") set(ARROW_FLIGHT_SQL_ODBC_STATIC_INSTALL_INTERFACE_LIBS "") set(ARROW_FLIGHT_SQL_ODBC_SHARED_PRIVATE_LINK_LIBS "") -if(WIN32) +if(WIN32 AND ARROW_BUILD_STATIC) + # Static Arrow deps on Windows — self-contained ODBC DLL + set(ARROW_FLIGHT_SQL_ODBC_SHARED_LINK_LIBS arrow_flight_sql_static arrow_odbc_spi_impl) + set(ARROW_FLIGHT_SQL_ODBC_STATIC_LINK_LIBS arrow_flight_sql_static) + list(APPEND ARROW_FLIGHT_SQL_ODBC_SHARED_INSTALL_INTERFACE_LIBS + ArrowFlight::arrow_flight_sql_static) + list(APPEND ARROW_FLIGHT_SQL_ODBC_STATIC_INSTALL_INTERFACE_LIBS + ArrowFlight::arrow_flight_sql_static) + list(APPEND ARROW_FLIGHT_SQL_ODBC_SHARED_PRIVATE_LINK_LIBS ODBC::ODBC ${ODBCINST}) +elseif(WIN32) + # Dynamic Arrow deps on Windows (current behavior) set(ARROW_FLIGHT_SQL_ODBC_DEPENDENCIES arrow_flight_sql) set(ARROW_FLIGHT_SQL_ODBC_SHARED_LINK_LIBS arrow_odbc_spi_impl) set(ARROW_FLIGHT_SQL_ODBC_STATIC_LINK_LIBS arrow_flight_sql_static) @@ -133,18 +143,34 @@ if(ARROW_FLIGHT_SQL_ODBC_INSTALLER) # GH-47876 TODO: set up `arrow_flight_sql_odbc` component for macOS Installer # GH-47877 TODO: set up `arrow_flight_sql_odbc` component for Linux Installer if(WIN32) - # Install ODBC driver install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION bin COMPONENT arrow_flight_sql_odbc) - install(TARGETS arrow_flight_sql_odbc_shared - RUNTIME_DEPENDENCIES - PRE_EXCLUDE_REGEXES - "api-ms-.*" - "ext-ms-.*" - POST_EXCLUDE_REGEXES - ".*system32/.*\\.dll" - RUNTIME DESTINATION bin COMPONENT arrow_flight_sql_odbc) + if(ARROW_BUILD_STATIC) + # Static build: only install the self-contained ODBC DLL + install(TARGETS arrow_flight_sql_odbc_shared + RUNTIME_DEPENDENCIES + PRE_EXCLUDE_REGEXES + "api-ms-.*" + "ext-ms-.*" + POST_EXCLUDE_REGEXES + ".*system32/.*\\.dll" + RUNTIME DESTINATION bin COMPONENT arrow_flight_sql_odbc) + else() + # Dynamic build: install ODBC DLL + Arrow dependency DLLs + install(TARGETS arrow_shared + arrow_compute_shared + arrow_flight_shared + arrow_flight_sql_shared + arrow_flight_sql_odbc_shared + RUNTIME_DEPENDENCIES + PRE_EXCLUDE_REGEXES + "api-ms-.*" + "ext-ms-.*" + POST_EXCLUDE_REGEXES + ".*system32/.*\\.dll" + RUNTIME DESTINATION bin COMPONENT arrow_flight_sql_odbc) + endif() set(CPACK_WIX_EXTRA_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/install/windows/arrow-flight-sql-odbc.wxs") diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt index 5a16c0361f3..dc6c5fe9781 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt @@ -133,9 +133,17 @@ endif() if(WIN32) find_package(ODBC REQUIRED) target_include_directories(arrow_odbc_spi_impl PUBLIC ${ODBC_INCLUDE_DIR}) - target_link_libraries(arrow_odbc_spi_impl - PUBLIC arrow_flight_sql_shared arrow_compute_shared Boost::locale - ${ODBCINST}) + if(ARROW_BUILD_STATIC) + target_link_libraries(arrow_odbc_spi_impl + PUBLIC arrow_flight_sql_static + arrow_compute_static + Boost::locale + ${ODBCINST}) + else() + target_link_libraries(arrow_odbc_spi_impl + PUBLIC arrow_flight_sql_shared arrow_compute_shared Boost::locale + ${ODBCINST}) + endif() else() # Unix target_include_directories(arrow_odbc_spi_impl SYSTEM BEFORE PUBLIC ${ODBC_INCLUDE_DIR}) @@ -163,7 +171,9 @@ target_link_libraries(arrow_odbc_spi_impl_cli arrow_odbc_spi_impl) # On Windows, dynamic linking ODBC is supported. # On unix systems, static linking ODBC is supported, thus the library linking is static. -if(WIN32) +if(WIN32 AND ARROW_TEST_LINKAGE STREQUAL "static") + set(ODBC_SPI_IMPL_TEST_LINK_LIBS arrow_flight_testing_static) +elseif(WIN32) set(ODBC_SPI_IMPL_TEST_LINK_LIBS arrow_flight_testing_shared) else() # unix diff --git a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt index e0e562f2d25..69dbd438e39 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt @@ -57,8 +57,14 @@ set(ARROW_FLIGHT_SQL_ODBC_TEST_LIBS ${ODBCINST} ${ODBC_LIBRARIES} ${SQLite3_LIBR # On unix systems, static linking ODBC is supported, thus tests link libraries statically. set(ARROW_FLIGHT_SQL_ODBC_TEST_EXTRA_LINK_LIBS "") set(ARROW_FLIGHT_SQL_ODBC_TEST_STATIC_LINK_LIBS "") -if(WIN32) - # arrow_odbc_spi_impl is required on Windows due to dynamic linking +if(WIN32 AND ARROW_TEST_LINKAGE STREQUAL "static") + # Static Windows tests + list(APPEND ARROW_FLIGHT_SQL_ODBC_TEST_STATIC_LINK_LIBS + arrow_odbc_spi_impl + ${ARROW_FLIGHT_SQL_ODBC_TEST_LIBS} + ${ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS}) +elseif(WIN32) + # Dynamic Windows tests (current behavior) list(APPEND ARROW_FLIGHT_SQL_ODBC_TEST_EXTRA_LINK_LIBS arrow_odbc_spi_impl ${ARROW_FLIGHT_SQL_ODBC_TEST_LIBS}) else() From 1dfc3dcabc76f7c9db1ba84239dca825ae5893df Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Tue, 24 Mar 2026 21:06:14 -0700 Subject: [PATCH 05/29] Revert "Set CMAKE_MSVC_RUNTIME_LIBRARY" This reverts commit 819f2fcce4e59a558e4588c505d74a34404412a0. --- cpp/CMakeLists.txt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index ea8f3d64760..a77ed39eac8 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -226,11 +226,6 @@ set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) # cmake options include(DefineOptions) -# Set MSVC runtime library (CMP0091 NEW policy) -if(MSVC AND ARROW_USE_STATIC_CRT) - set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") -endif() - if(ARROW_BUILD_SHARED AND NOT ARROW_POSITION_INDEPENDENT_CODE) message(WARNING "Can't disable position-independent code to build shared libraries, enabling" ) From 0f913c04ab650ce9a05e2ca06cfd24c30fa51d50 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Wed, 25 Mar 2026 12:34:40 -0700 Subject: [PATCH 06/29] Update cpp_extra.yml --- .github/workflows/cpp_extra.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index 1be2ce4439b..7649fbc22f6 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -525,23 +525,24 @@ jobs: permissions: packages: write env: - ARROW_BUILD_SHARED: OFF + ARROW_BUILD_SHARED: ON ARROW_BUILD_STATIC: ON ARROW_BUILD_TESTS: ON ARROW_BUILD_TYPE: release - # Turn Arrow CSV off to disable `find_package(Arrow)` check on MSVC CI. + # Turn Arrow CSV off to disable `find_package(Arrow)` check on MSVC CI. # GH-49050 TODO: enable `find_package(Arrow)` check on MSVC CI. ARROW_CSV: OFF ARROW_DEPENDENCY_SOURCE: VCPKG + ARROW_DEPENDENCY_USE_SHARED: OFF ARROW_FLIGHT_SQL_ODBC: ON ARROW_FLIGHT_SQL_ODBC_INSTALLER: ON ARROW_HOME: /usr ARROW_MIMALLOC: OFF - ARROW_USE_STATIC_CRT: ON + ARROW_USE_STATIC_CRT: OFF CMAKE_GENERATOR: Ninja CMAKE_INSTALL_PREFIX: /usr VCPKG_BINARY_SOURCES: 'clear;nugettimeout,600;nuget,GitHub,readwrite' - VCPKG_DEFAULT_TRIPLET: x64-windows-static + VCPKG_DEFAULT_TRIPLET: x64-windows-static-md steps: - name: Disable Crash Dialogs run: | From e8df2cde5f02a594dc1a6cbd59a60552741d82f3 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Wed, 25 Mar 2026 12:42:19 -0700 Subject: [PATCH 07/29] Update cpp_extra.yml --- .github/workflows/cpp_extra.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index 7649fbc22f6..3047d30f898 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -529,6 +529,8 @@ jobs: ARROW_BUILD_STATIC: ON ARROW_BUILD_TESTS: ON ARROW_BUILD_TYPE: release + ARROW_TEST_LINKAGE: static + ARROW_CMAKE_ARGS: -DVCPKG_TARGET_TRIPLET=x64-windows-static-md # Turn Arrow CSV off to disable `find_package(Arrow)` check on MSVC CI. # GH-49050 TODO: enable `find_package(Arrow)` check on MSVC CI. ARROW_CSV: OFF @@ -542,7 +544,6 @@ jobs: CMAKE_GENERATOR: Ninja CMAKE_INSTALL_PREFIX: /usr VCPKG_BINARY_SOURCES: 'clear;nugettimeout,600;nuget,GitHub,readwrite' - VCPKG_DEFAULT_TRIPLET: x64-windows-static-md steps: - name: Disable Crash Dialogs run: | From bfd7e7d2cb51387cfc40089e999bb8747f04ebe2 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Thu, 26 Mar 2026 16:24:15 -0700 Subject: [PATCH 08/29] testing --- cpp/src/arrow/compute/CMakeLists.txt | 8 ++++++++ cpp/src/arrow/compute/kernels/CMakeLists.txt | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/cpp/src/arrow/compute/CMakeLists.txt b/cpp/src/arrow/compute/CMakeLists.txt index 6c530a76e18..3582541a268 100644 --- a/cpp/src/arrow/compute/CMakeLists.txt +++ b/cpp/src/arrow/compute/CMakeLists.txt @@ -35,6 +35,10 @@ if(ARROW_TESTING) # Even though this is still just an object library we still need to "link" our # dependencies so that include paths are configured correctly target_link_libraries(arrow_compute_core_testing PUBLIC ${ARROW_GTEST_GMOCK}) + # When using static test linkage, define ARROW_STATIC so test_util_internal.cc doesn't expect DLL imports + if(ARROW_TEST_LINKAGE STREQUAL "static") + target_compile_definitions(arrow_compute_core_testing PRIVATE ARROW_STATIC) + endif() endif() # Define arrow_compute_testing object library for test files requiring extra kernels. @@ -46,6 +50,10 @@ if(ARROW_TESTING AND ARROW_COMPUTE) target_link_libraries(arrow_compute_testing PUBLIC $ PUBLIC ${ARROW_GTEST_GTEST}) + # When using static test linkage, define ARROW_STATIC so test_env.cc doesn't expect DLL imports + if(ARROW_TEST_LINKAGE STREQUAL "static") + target_compile_definitions(arrow_compute_testing PRIVATE ARROW_STATIC) + endif() endif() set(ARROW_COMPUTE_TEST_PREFIX "arrow-compute") diff --git a/cpp/src/arrow/compute/kernels/CMakeLists.txt b/cpp/src/arrow/compute/kernels/CMakeLists.txt index 15955b5ef88..ae1da2368a5 100644 --- a/cpp/src/arrow/compute/kernels/CMakeLists.txt +++ b/cpp/src/arrow/compute/kernels/CMakeLists.txt @@ -26,6 +26,10 @@ if(ARROW_TESTING) # Even though this is still just an object library we still need to "link" our # dependencies so that include paths are configured correctly target_link_libraries(arrow_compute_kernels_testing PUBLIC ${ARROW_GTEST_GMOCK}) + # When using static test linkage, define ARROW_STATIC so test_util_internal.cc doesn't expect DLL imports + if(ARROW_TEST_LINKAGE STREQUAL "static") + target_compile_definitions(arrow_compute_kernels_testing PRIVATE ARROW_STATIC) + endif() endif() add_arrow_test(scalar_cast_test From 5603106208e54c7259cebfa09fd52864968ef89d Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 27 Mar 2026 09:24:23 -0700 Subject: [PATCH 09/29] last set of fixes --- cpp/src/arrow/compute/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/src/arrow/compute/CMakeLists.txt b/cpp/src/arrow/compute/CMakeLists.txt index 3582541a268..c9dea0d6937 100644 --- a/cpp/src/arrow/compute/CMakeLists.txt +++ b/cpp/src/arrow/compute/CMakeLists.txt @@ -37,7 +37,7 @@ if(ARROW_TESTING) target_link_libraries(arrow_compute_core_testing PUBLIC ${ARROW_GTEST_GMOCK}) # When using static test linkage, define ARROW_STATIC so test_util_internal.cc doesn't expect DLL imports if(ARROW_TEST_LINKAGE STREQUAL "static") - target_compile_definitions(arrow_compute_core_testing PRIVATE ARROW_STATIC) + target_compile_definitions(arrow_compute_core_testing PRIVATE ARROW_STATIC ARROW_COMPUTE_STATIC) endif() endif() @@ -52,7 +52,7 @@ if(ARROW_TESTING AND ARROW_COMPUTE) PUBLIC ${ARROW_GTEST_GTEST}) # When using static test linkage, define ARROW_STATIC so test_env.cc doesn't expect DLL imports if(ARROW_TEST_LINKAGE STREQUAL "static") - target_compile_definitions(arrow_compute_testing PRIVATE ARROW_STATIC) + target_compile_definitions(arrow_compute_testing PRIVATE ARROW_STATIC ARROW_COMPUTE_STATIC) endif() endif() From 3320df2585db942e223d38975bc2db66fc577d70 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Sun, 29 Mar 2026 11:07:16 -0700 Subject: [PATCH 10/29] Update cpp_extra.yml --- .github/workflows/cpp_extra.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index 3047d30f898..26b726c612e 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -618,6 +618,15 @@ jobs: shell: cmd run: | call "cpp\src\arrow\flight\sql\odbc\tests\install_odbc.cmd" ${{ github.workspace }}\build\cpp\%ARROW_BUILD_TYPE%\arrow_flight_sql_odbc.dll + - name: Upload test executable and dependencies for debugging + if: always() + uses: actions/upload-artifact@v7 + with: + name: arrow-flight-sql-odbc-test-debug + path: | + build/cpp/${{ env.ARROW_BUILD_TYPE }}/arrow-flight-sql-odbc-test.exe + build/cpp/${{ env.ARROW_BUILD_TYPE }}/*.dll + if-no-files-found: warn - name: Test shell: cmd run: | From b9fa5fb914f2b71828692a45166e511fed968eb7 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Mon, 30 Mar 2026 12:56:10 -0700 Subject: [PATCH 11/29] more testing --- .github/workflows/cpp_extra.yml | 39 ++++++++++++++++++- .../flight/sql/odbc/tests/CMakeLists.txt | 3 +- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index 26b726c612e..119b727d8c9 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -545,14 +545,30 @@ jobs: CMAKE_INSTALL_PREFIX: /usr VCPKG_BINARY_SOURCES: 'clear;nugettimeout,600;nuget,GitHub,readwrite' steps: - - name: Disable Crash Dialogs + - name: Configure Crash Dumps run: | + # Disable crash dialog UI but enable dump collection reg add ` "HKCU\SOFTWARE\Microsoft\Windows\Windows Error Reporting" ` /v DontShowUI ` /t REG_DWORD ` /d 1 ` /f + # Enable local crash dumps + reg add ` + "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" ` + /v DumpFolder ` + /t REG_EXPAND_SZ ` + /d "%LOCALAPPDATA%\CrashDumps" ` + /f + reg add ` + "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" ` + /v DumpType ` + /t REG_DWORD ` + /d 2 ` + /f + # Create dumps directory + New-Item -ItemType Directory -Force -Path "$env:LOCALAPPDATA\CrashDumps" | Out-Null - name: Checkout Arrow uses: actions/checkout@v6 with: @@ -614,6 +630,11 @@ jobs: call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 set VCPKG_ROOT=%VCPKG_ROOT_KEEP% bash -c "ci/scripts/cpp_build.sh $(pwd) $(pwd)/build" + - name: List vcpkg packages for debugging + shell: bash + run: | + echo "=== Installed vcpkg packages (protobuf, grpc, abseil) ===" + vcpkg list | grep -E 'protobuf|grpc|abseil' || echo "No matching packages found" - name: Register Flight SQL ODBC Driver shell: cmd run: | @@ -636,6 +657,22 @@ jobs: # Convert VCPKG Windows path to MSYS path for /f "usebackq delims=" %%I in (`bash -c "cygpath -u \"$VCPKG_ROOT_KEEP\""` ) do set VCPKG_ROOT=%%I bash -c "ci/scripts/cpp_test.sh $(pwd) $(pwd)/build" + - name: Collect crash dumps + if: failure() + shell: bash + run: | + echo "=== Collecting crash dumps from Windows Error Reporting ===" + mkdir -p crash-dumps + # Windows dumps go to %LOCALAPPDATA%\CrashDumps + cp "$LOCALAPPDATA/CrashDumps/"*.dmp crash-dumps/ 2>/dev/null || echo "No crash dumps found" + ls -lh crash-dumps/ || echo "Crash dumps directory is empty" + - name: Upload crash dumps + if: failure() + uses: actions/upload-artifact@v7 + with: + name: arrow-flight-sql-odbc-crash-dumps + path: crash-dumps/ + if-no-files-found: warn - name: Install WiX Toolset shell: pwsh run: | diff --git a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt index 69dbd438e39..6589cbfe615 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt @@ -40,7 +40,8 @@ set(ARROW_FLIGHT_SQL_ODBC_TEST_SRCS type_info_test.cc # Enable Protobuf cleanup after test execution # GH-46889: move protobuf_test_util to a more common location - ../../../../engine/substrait/protobuf_test_util.cc) + #../../../../engine/substrait/protobuf_test_util.cc) +) if(ARROW_TEST_LINKAGE STREQUAL "static") set(ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS arrow_flight_sql_odbc_static From 96b49aba042347514b1ac5ec47664356f3feed7a Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Mon, 30 Mar 2026 17:09:21 -0700 Subject: [PATCH 12/29] try shared test linkage --- .github/workflows/cpp_extra.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index 119b727d8c9..cff5371294a 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -529,7 +529,7 @@ jobs: ARROW_BUILD_STATIC: ON ARROW_BUILD_TESTS: ON ARROW_BUILD_TYPE: release - ARROW_TEST_LINKAGE: static + ARROW_TEST_LINKAGE: shared ARROW_CMAKE_ARGS: -DVCPKG_TARGET_TRIPLET=x64-windows-static-md # Turn Arrow CSV off to disable `find_package(Arrow)` check on MSVC CI. # GH-49050 TODO: enable `find_package(Arrow)` check on MSVC CI. From 6aa8b103edba9d72d46ad21b8a65f93b7bf21b07 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Mon, 30 Mar 2026 17:42:15 -0700 Subject: [PATCH 13/29] Update odbc_test_suite.cc --- .../flight/sql/odbc/tests/odbc_test_suite.cc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/cpp/src/arrow/flight/sql/odbc/tests/odbc_test_suite.cc b/cpp/src/arrow/flight/sql/odbc/tests/odbc_test_suite.cc index 3fc48c263ec..c042af2aaaf 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/odbc_test_suite.cc +++ b/cpp/src/arrow/flight/sql/odbc/tests/odbc_test_suite.cc @@ -181,7 +181,22 @@ void ODBCTestBase::TearDown() { void ODBCTestBase::TearDownTestSuite() { if (connected) { - Disconnect(); + // WORKAROUND GH-49585: Skip Disconnect() to avoid segfault when run through CTest + // + // When tests are run through CTest (but NOT when run directly from cmd.exe), + // SQLFreeHandle(SQL_HANDLE_ENV) crashes during cleanup. The crash occurs only with + // static linkage (ARROW_TEST_LINKAGE=static) and happens while freeing the ODBC + // environment handle, which triggers cleanup of statically-linked gRPC/Flight resources. + // + // Root cause appears to be CTest's process management (signal handling, I/O redirection, + // or environment differences) interfering with gRPC cleanup during static destruction. + // + // This workaround leaks the ODBC handles but allows tests to complete successfully. + // A proper fix would require ensuring gRPC is kept alive until all ODBC handles are freed, + // or switching to dynamic linkage for tests. + // + // Disconnect(); + std::cerr << "[TEARDOWN] Skipping Disconnect() to avoid CTest-specific crash" << std::endl; connected = false; } } From 82ee4929c6a723e8bc377228d4f5cf58f8551c5f Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Tue, 31 Mar 2026 09:10:19 -0700 Subject: [PATCH 14/29] Check ARROW_FLIGHT_TEST_LINKAGE Flight tests get statically linked no matter what when grpc or protobuf are static. --- cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt index dc6c5fe9781..47525fafbbd 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt @@ -171,7 +171,7 @@ target_link_libraries(arrow_odbc_spi_impl_cli arrow_odbc_spi_impl) # On Windows, dynamic linking ODBC is supported. # On unix systems, static linking ODBC is supported, thus the library linking is static. -if(WIN32 AND ARROW_TEST_LINKAGE STREQUAL "static") +if(WIN32 AND ARROW_FLIGHT_TEST_LINKAGE STREQUAL "static") set(ODBC_SPI_IMPL_TEST_LINK_LIBS arrow_flight_testing_static) elseif(WIN32) set(ODBC_SPI_IMPL_TEST_LINK_LIBS arrow_flight_testing_shared) From 61b16345e8c87a1f981ec0595588a939153648ac Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Tue, 31 Mar 2026 15:40:58 -0700 Subject: [PATCH 15/29] force static link libs --- .../flight/sql/odbc/odbc_impl/CMakeLists.txt | 24 ++++++++++++++----- .../flight/sql/odbc/tests/CMakeLists.txt | 12 ++++++++-- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt index 47525fafbbd..d8325354629 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt @@ -171,13 +171,24 @@ target_link_libraries(arrow_odbc_spi_impl_cli arrow_odbc_spi_impl) # On Windows, dynamic linking ODBC is supported. # On unix systems, static linking ODBC is supported, thus the library linking is static. +# Use STATIC_LINK_LIBS when Flight tests require static linkage to avoid mixing static/shared Arrow if(WIN32 AND ARROW_FLIGHT_TEST_LINKAGE STREQUAL "static") - set(ODBC_SPI_IMPL_TEST_LINK_LIBS arrow_flight_testing_static) + # Static linkage required - pass everything via STATIC_LINK_LIBS + set(ODBC_SPI_IMPL_TEST_STATIC_LIBS arrow_odbc_spi_impl + arrow_flight_testing_static + ${ARROW_TEST_STATIC_LINK_LIBS}) + set(ODBC_SPI_IMPL_TEST_EXTRA_LIBS "") elseif(WIN32) - set(ODBC_SPI_IMPL_TEST_LINK_LIBS arrow_flight_testing_shared) + # Shared linkage - use EXTRA_LINK_LIBS + set(ODBC_SPI_IMPL_TEST_STATIC_LIBS "") + set(ODBC_SPI_IMPL_TEST_EXTRA_LIBS arrow_odbc_spi_impl + arrow_flight_testing_shared) else() - # unix - set(ODBC_SPI_IMPL_TEST_LINK_LIBS arrow_flight_testing_static) + # Unix - always static + set(ODBC_SPI_IMPL_TEST_STATIC_LIBS arrow_odbc_spi_impl + arrow_flight_testing_static + ${ARROW_TEST_STATIC_LINK_LIBS}) + set(ODBC_SPI_IMPL_TEST_EXTRA_LIBS "") endif() add_arrow_test(odbc_spi_impl_test @@ -197,5 +208,6 @@ add_arrow_test(odbc_spi_impl_test record_batch_transformer_test.cc util_test.cc EXTRA_LINK_LIBS - arrow_odbc_spi_impl - ${ODBC_SPI_IMPL_TEST_LINK_LIBS}) + ${ODBC_SPI_IMPL_TEST_EXTRA_LIBS} + STATIC_LINK_LIBS + ${ODBC_SPI_IMPL_TEST_STATIC_LIBS}) diff --git a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt index 6589cbfe615..936e28b2e3c 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt @@ -43,7 +43,9 @@ set(ARROW_FLIGHT_SQL_ODBC_TEST_SRCS #../../../../engine/substrait/protobuf_test_util.cc) ) -if(ARROW_TEST_LINKAGE STREQUAL "static") +# ODBC tests must respect ARROW_FLIGHT_TEST_LINKAGE since they depend on Flight libraries +# which may be forced to static linkage due to static gRPC/Protobuf +if(ARROW_FLIGHT_TEST_LINKAGE STREQUAL "static") set(ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS arrow_flight_sql_odbc_static ${ARROW_TEST_STATIC_LINK_LIBS}) else() @@ -58,7 +60,7 @@ set(ARROW_FLIGHT_SQL_ODBC_TEST_LIBS ${ODBCINST} ${ODBC_LIBRARIES} ${SQLite3_LIBR # On unix systems, static linking ODBC is supported, thus tests link libraries statically. set(ARROW_FLIGHT_SQL_ODBC_TEST_EXTRA_LINK_LIBS "") set(ARROW_FLIGHT_SQL_ODBC_TEST_STATIC_LINK_LIBS "") -if(WIN32 AND ARROW_TEST_LINKAGE STREQUAL "static") +if(WIN32 AND ARROW_FLIGHT_TEST_LINKAGE STREQUAL "static") # Static Windows tests list(APPEND ARROW_FLIGHT_SQL_ODBC_TEST_STATIC_LINK_LIBS arrow_odbc_spi_impl @@ -74,6 +76,12 @@ else() ${ARROW_FLIGHT_SQL_ODBC_TEST_LIBS} ${ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS}) endif() +# When Flight tests require static linkage, we must also add Arrow test libs to STATIC_LINK_LIBS +# to avoid add_arrow_test from adding shared Arrow test libs +if(ARROW_FLIGHT_TEST_LINKAGE STREQUAL "static") + list(APPEND ARROW_FLIGHT_SQL_ODBC_TEST_STATIC_LINK_LIBS ${ARROW_TEST_STATIC_LINK_LIBS}) +endif() + add_arrow_test(flight_sql_odbc_test SOURCES ${ARROW_FLIGHT_SQL_ODBC_TEST_SRCS} From 972bb0a3704d5af9d5035bbb4ff02d3c7397425a Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 3 Apr 2026 17:20:49 -0700 Subject: [PATCH 16/29] try reomving disconnect --- cpp/src/arrow/flight/sql/odbc/tests/odbc_test_suite.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/src/arrow/flight/sql/odbc/tests/odbc_test_suite.cc b/cpp/src/arrow/flight/sql/odbc/tests/odbc_test_suite.cc index c042af2aaaf..cd530f11ac9 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/odbc_test_suite.cc +++ b/cpp/src/arrow/flight/sql/odbc/tests/odbc_test_suite.cc @@ -195,7 +195,7 @@ void ODBCTestBase::TearDownTestSuite() { // A proper fix would require ensuring gRPC is kept alive until all ODBC handles are freed, // or switching to dynamic linkage for tests. // - // Disconnect(); + Disconnect(); std::cerr << "[TEARDOWN] Skipping Disconnect() to avoid CTest-specific crash" << std::endl; connected = false; } From b4f2d840922eba8911dec9192ef0b29709c14ee6 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 3 Apr 2026 18:31:07 -0700 Subject: [PATCH 17/29] Update odbc_test_suite.cc --- .../flight/sql/odbc/tests/odbc_test_suite.cc | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/cpp/src/arrow/flight/sql/odbc/tests/odbc_test_suite.cc b/cpp/src/arrow/flight/sql/odbc/tests/odbc_test_suite.cc index cd530f11ac9..7c75f91ada9 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/odbc_test_suite.cc +++ b/cpp/src/arrow/flight/sql/odbc/tests/odbc_test_suite.cc @@ -181,22 +181,13 @@ void ODBCTestBase::TearDown() { void ODBCTestBase::TearDownTestSuite() { if (connected) { - // WORKAROUND GH-49585: Skip Disconnect() to avoid segfault when run through CTest + // TODO(XXX): Without commenting this out, Disconnect() makes this test + // executable segfault when run under ctest but not when the test executable + // is run directly. This only happens under static test linkage. // - // When tests are run through CTest (but NOT when run directly from cmd.exe), - // SQLFreeHandle(SQL_HANDLE_ENV) crashes during cleanup. The crash occurs only with - // static linkage (ARROW_TEST_LINKAGE=static) and happens while freeing the ODBC - // environment handle, which triggers cleanup of statically-linked gRPC/Flight resources. - // - // Root cause appears to be CTest's process management (signal handling, I/O redirection, - // or environment differences) interfering with gRPC cleanup during static destruction. - // - // This workaround leaks the ODBC handles but allows tests to complete successfully. - // A proper fix would require ensuring gRPC is kept alive until all ODBC handles are freed, - // or switching to dynamic linkage for tests. - // - Disconnect(); - std::cerr << "[TEARDOWN] Skipping Disconnect() to avoid CTest-specific crash" << std::endl; + // Disconnect(); + std::cerr << "[TEARDOWN] Skipping Disconnect() to avoid CTest-specific crash" + << std::endl; connected = false; } } From 0b94a8bf06a219297667092f43edfb26598d4aca Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 3 Apr 2026 18:31:25 -0700 Subject: [PATCH 18/29] Update CMakeLists.txt --- cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt index 936e28b2e3c..ea37cfee181 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt @@ -40,7 +40,7 @@ set(ARROW_FLIGHT_SQL_ODBC_TEST_SRCS type_info_test.cc # Enable Protobuf cleanup after test execution # GH-46889: move protobuf_test_util to a more common location - #../../../../engine/substrait/protobuf_test_util.cc) + ../../../../engine/substrait/protobuf_test_util.cc) ) # ODBC tests must respect ARROW_FLIGHT_TEST_LINKAGE since they depend on Flight libraries From 1df1cef10f168a1def810741d053db0a6114361b Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 3 Apr 2026 18:32:25 -0700 Subject: [PATCH 19/29] Update CMakeLists.txt --- cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt index ea37cfee181..a3946f802cb 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt @@ -40,7 +40,7 @@ set(ARROW_FLIGHT_SQL_ODBC_TEST_SRCS type_info_test.cc # Enable Protobuf cleanup after test execution # GH-46889: move protobuf_test_util to a more common location - ../../../../engine/substrait/protobuf_test_util.cc) + ../../../../engine/substrait/protobuf_test_util.cc ) # ODBC tests must respect ARROW_FLIGHT_TEST_LINKAGE since they depend on Flight libraries From 3272a1485777c8e931b1e995a72cb1f9129f168e Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 3 Apr 2026 18:42:57 -0700 Subject: [PATCH 20/29] cleanup --- .github/workflows/cpp_extra.yml | 54 --------------------------------- 1 file changed, 54 deletions(-) diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index cff5371294a..1d0bd47f89b 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -545,30 +545,6 @@ jobs: CMAKE_INSTALL_PREFIX: /usr VCPKG_BINARY_SOURCES: 'clear;nugettimeout,600;nuget,GitHub,readwrite' steps: - - name: Configure Crash Dumps - run: | - # Disable crash dialog UI but enable dump collection - reg add ` - "HKCU\SOFTWARE\Microsoft\Windows\Windows Error Reporting" ` - /v DontShowUI ` - /t REG_DWORD ` - /d 1 ` - /f - # Enable local crash dumps - reg add ` - "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" ` - /v DumpFolder ` - /t REG_EXPAND_SZ ` - /d "%LOCALAPPDATA%\CrashDumps" ` - /f - reg add ` - "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" ` - /v DumpType ` - /t REG_DWORD ` - /d 2 ` - /f - # Create dumps directory - New-Item -ItemType Directory -Force -Path "$env:LOCALAPPDATA\CrashDumps" | Out-Null - name: Checkout Arrow uses: actions/checkout@v6 with: @@ -630,24 +606,10 @@ jobs: call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 set VCPKG_ROOT=%VCPKG_ROOT_KEEP% bash -c "ci/scripts/cpp_build.sh $(pwd) $(pwd)/build" - - name: List vcpkg packages for debugging - shell: bash - run: | - echo "=== Installed vcpkg packages (protobuf, grpc, abseil) ===" - vcpkg list | grep -E 'protobuf|grpc|abseil' || echo "No matching packages found" - name: Register Flight SQL ODBC Driver shell: cmd run: | call "cpp\src\arrow\flight\sql\odbc\tests\install_odbc.cmd" ${{ github.workspace }}\build\cpp\%ARROW_BUILD_TYPE%\arrow_flight_sql_odbc.dll - - name: Upload test executable and dependencies for debugging - if: always() - uses: actions/upload-artifact@v7 - with: - name: arrow-flight-sql-odbc-test-debug - path: | - build/cpp/${{ env.ARROW_BUILD_TYPE }}/arrow-flight-sql-odbc-test.exe - build/cpp/${{ env.ARROW_BUILD_TYPE }}/*.dll - if-no-files-found: warn - name: Test shell: cmd run: | @@ -657,22 +619,6 @@ jobs: # Convert VCPKG Windows path to MSYS path for /f "usebackq delims=" %%I in (`bash -c "cygpath -u \"$VCPKG_ROOT_KEEP\""` ) do set VCPKG_ROOT=%%I bash -c "ci/scripts/cpp_test.sh $(pwd) $(pwd)/build" - - name: Collect crash dumps - if: failure() - shell: bash - run: | - echo "=== Collecting crash dumps from Windows Error Reporting ===" - mkdir -p crash-dumps - # Windows dumps go to %LOCALAPPDATA%\CrashDumps - cp "$LOCALAPPDATA/CrashDumps/"*.dmp crash-dumps/ 2>/dev/null || echo "No crash dumps found" - ls -lh crash-dumps/ || echo "Crash dumps directory is empty" - - name: Upload crash dumps - if: failure() - uses: actions/upload-artifact@v7 - with: - name: arrow-flight-sql-odbc-crash-dumps - path: crash-dumps/ - if-no-files-found: warn - name: Install WiX Toolset shell: pwsh run: | From 14cbe3a76bdd77a67cf396d21ffece842f9c204c Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 3 Apr 2026 18:44:43 -0700 Subject: [PATCH 21/29] Update cpp_extra.yml --- .github/workflows/cpp_extra.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index 1d0bd47f89b..ed5b55e20d9 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -545,6 +545,14 @@ jobs: CMAKE_INSTALL_PREFIX: /usr VCPKG_BINARY_SOURCES: 'clear;nugettimeout,600;nuget,GitHub,readwrite' steps: + - name: Disable Crash Dialogs + run: | + reg add ` + "HKCU\SOFTWARE\Microsoft\Windows\Windows Error Reporting" ` + /v DontShowUI ` + /t REG_DWORD ` + /d 1 ` + /f - name: Checkout Arrow uses: actions/checkout@v6 with: From 8765ae261bde9d24698c1480fb12f6ef84269da6 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 3 Apr 2026 18:45:23 -0700 Subject: [PATCH 22/29] Update odbc_test_suite.cc --- cpp/src/arrow/flight/sql/odbc/tests/odbc_test_suite.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/cpp/src/arrow/flight/sql/odbc/tests/odbc_test_suite.cc b/cpp/src/arrow/flight/sql/odbc/tests/odbc_test_suite.cc index 7c75f91ada9..40674de02be 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/odbc_test_suite.cc +++ b/cpp/src/arrow/flight/sql/odbc/tests/odbc_test_suite.cc @@ -186,8 +186,6 @@ void ODBCTestBase::TearDownTestSuite() { // is run directly. This only happens under static test linkage. // // Disconnect(); - std::cerr << "[TEARDOWN] Skipping Disconnect() to avoid CTest-specific crash" - << std::endl; connected = false; } } From bbbf246cc6d728fb3453d71613571c40820f68a9 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 3 Apr 2026 19:06:17 -0700 Subject: [PATCH 23/29] cleanup unneeded cmake --- cpp/src/arrow/compute/CMakeLists.txt | 12 ++++++------ cpp/src/arrow/compute/kernels/CMakeLists.txt | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cpp/src/arrow/compute/CMakeLists.txt b/cpp/src/arrow/compute/CMakeLists.txt index c9dea0d6937..7470a29a52e 100644 --- a/cpp/src/arrow/compute/CMakeLists.txt +++ b/cpp/src/arrow/compute/CMakeLists.txt @@ -36,9 +36,9 @@ if(ARROW_TESTING) # dependencies so that include paths are configured correctly target_link_libraries(arrow_compute_core_testing PUBLIC ${ARROW_GTEST_GMOCK}) # When using static test linkage, define ARROW_STATIC so test_util_internal.cc doesn't expect DLL imports - if(ARROW_TEST_LINKAGE STREQUAL "static") - target_compile_definitions(arrow_compute_core_testing PRIVATE ARROW_STATIC ARROW_COMPUTE_STATIC) - endif() + # if(ARROW_TEST_LINKAGE STREQUAL "static") + # target_compile_definitions(arrow_compute_core_testing PRIVATE ARROW_STATIC ARROW_COMPUTE_STATIC) + # endif() endif() # Define arrow_compute_testing object library for test files requiring extra kernels. @@ -51,9 +51,9 @@ if(ARROW_TESTING AND ARROW_COMPUTE) PUBLIC $ PUBLIC ${ARROW_GTEST_GTEST}) # When using static test linkage, define ARROW_STATIC so test_env.cc doesn't expect DLL imports - if(ARROW_TEST_LINKAGE STREQUAL "static") - target_compile_definitions(arrow_compute_testing PRIVATE ARROW_STATIC ARROW_COMPUTE_STATIC) - endif() + # if(ARROW_TEST_LINKAGE STREQUAL "static") + # target_compile_definitions(arrow_compute_testing PRIVATE ARROW_STATIC ARROW_COMPUTE_STATIC) + # endif() endif() set(ARROW_COMPUTE_TEST_PREFIX "arrow-compute") diff --git a/cpp/src/arrow/compute/kernels/CMakeLists.txt b/cpp/src/arrow/compute/kernels/CMakeLists.txt index ae1da2368a5..f7efca48ea3 100644 --- a/cpp/src/arrow/compute/kernels/CMakeLists.txt +++ b/cpp/src/arrow/compute/kernels/CMakeLists.txt @@ -27,9 +27,9 @@ if(ARROW_TESTING) # dependencies so that include paths are configured correctly target_link_libraries(arrow_compute_kernels_testing PUBLIC ${ARROW_GTEST_GMOCK}) # When using static test linkage, define ARROW_STATIC so test_util_internal.cc doesn't expect DLL imports - if(ARROW_TEST_LINKAGE STREQUAL "static") - target_compile_definitions(arrow_compute_kernels_testing PRIVATE ARROW_STATIC) - endif() + # if(ARROW_TEST_LINKAGE STREQUAL "static") + # target_compile_definitions(arrow_compute_kernels_testing PRIVATE ARROW_STATIC) + # endif() endif() add_arrow_test(scalar_cast_test From e1a6f9b0f62cb664964fba3d2676f3236ae63e78 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Tue, 7 Apr 2026 14:19:24 -0700 Subject: [PATCH 24/29] remove comments --- cpp/src/arrow/compute/CMakeLists.txt | 8 -------- cpp/src/arrow/compute/kernels/CMakeLists.txt | 4 ---- 2 files changed, 12 deletions(-) diff --git a/cpp/src/arrow/compute/CMakeLists.txt b/cpp/src/arrow/compute/CMakeLists.txt index 7470a29a52e..6c530a76e18 100644 --- a/cpp/src/arrow/compute/CMakeLists.txt +++ b/cpp/src/arrow/compute/CMakeLists.txt @@ -35,10 +35,6 @@ if(ARROW_TESTING) # Even though this is still just an object library we still need to "link" our # dependencies so that include paths are configured correctly target_link_libraries(arrow_compute_core_testing PUBLIC ${ARROW_GTEST_GMOCK}) - # When using static test linkage, define ARROW_STATIC so test_util_internal.cc doesn't expect DLL imports - # if(ARROW_TEST_LINKAGE STREQUAL "static") - # target_compile_definitions(arrow_compute_core_testing PRIVATE ARROW_STATIC ARROW_COMPUTE_STATIC) - # endif() endif() # Define arrow_compute_testing object library for test files requiring extra kernels. @@ -50,10 +46,6 @@ if(ARROW_TESTING AND ARROW_COMPUTE) target_link_libraries(arrow_compute_testing PUBLIC $ PUBLIC ${ARROW_GTEST_GTEST}) - # When using static test linkage, define ARROW_STATIC so test_env.cc doesn't expect DLL imports - # if(ARROW_TEST_LINKAGE STREQUAL "static") - # target_compile_definitions(arrow_compute_testing PRIVATE ARROW_STATIC ARROW_COMPUTE_STATIC) - # endif() endif() set(ARROW_COMPUTE_TEST_PREFIX "arrow-compute") diff --git a/cpp/src/arrow/compute/kernels/CMakeLists.txt b/cpp/src/arrow/compute/kernels/CMakeLists.txt index f7efca48ea3..15955b5ef88 100644 --- a/cpp/src/arrow/compute/kernels/CMakeLists.txt +++ b/cpp/src/arrow/compute/kernels/CMakeLists.txt @@ -26,10 +26,6 @@ if(ARROW_TESTING) # Even though this is still just an object library we still need to "link" our # dependencies so that include paths are configured correctly target_link_libraries(arrow_compute_kernels_testing PUBLIC ${ARROW_GTEST_GMOCK}) - # When using static test linkage, define ARROW_STATIC so test_util_internal.cc doesn't expect DLL imports - # if(ARROW_TEST_LINKAGE STREQUAL "static") - # target_compile_definitions(arrow_compute_kernels_testing PRIVATE ARROW_STATIC) - # endif() endif() add_arrow_test(scalar_cast_test From 8c26020fe77e5c5a6622a4c0175cc51fefe7b8a3 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Tue, 7 Apr 2026 14:22:16 -0700 Subject: [PATCH 25/29] formatting --- cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt index a3946f802cb..89b48e34fa3 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt @@ -40,8 +40,7 @@ set(ARROW_FLIGHT_SQL_ODBC_TEST_SRCS type_info_test.cc # Enable Protobuf cleanup after test execution # GH-46889: move protobuf_test_util to a more common location - ../../../../engine/substrait/protobuf_test_util.cc -) + ../../../../engine/substrait/protobuf_test_util.cc) # ODBC tests must respect ARROW_FLIGHT_TEST_LINKAGE since they depend on Flight libraries # which may be forced to static linkage due to static gRPC/Protobuf From 0731b3cc6364495ee34490c76d4f418a71eca31c Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Tue, 7 Apr 2026 14:25:58 -0700 Subject: [PATCH 26/29] switch back to VCPKG_DEFAULT_TRIPLET --- .github/workflows/cpp_extra.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index ed5b55e20d9..07f9c5984cb 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -530,7 +530,6 @@ jobs: ARROW_BUILD_TESTS: ON ARROW_BUILD_TYPE: release ARROW_TEST_LINKAGE: shared - ARROW_CMAKE_ARGS: -DVCPKG_TARGET_TRIPLET=x64-windows-static-md # Turn Arrow CSV off to disable `find_package(Arrow)` check on MSVC CI. # GH-49050 TODO: enable `find_package(Arrow)` check on MSVC CI. ARROW_CSV: OFF @@ -544,6 +543,7 @@ jobs: CMAKE_GENERATOR: Ninja CMAKE_INSTALL_PREFIX: /usr VCPKG_BINARY_SOURCES: 'clear;nugettimeout,600;nuget,GitHub,readwrite' + VCPKG_DEFAULT_TRIPLET: x64-windows-static-md steps: - name: Disable Crash Dialogs run: | From 38aea70e2e8da78de858ee4d39f4c33111bced74 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Tue, 7 Apr 2026 14:32:53 -0700 Subject: [PATCH 27/29] Simplify odbc_impl test linkage cmake directives --- .../flight/sql/odbc/odbc_impl/CMakeLists.txt | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt index d8325354629..99af079579a 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt @@ -169,26 +169,15 @@ target_link_libraries(arrow_odbc_spi_impl_cli arrow_odbc_spi_impl) # Unit tests -# On Windows, dynamic linking ODBC is supported. -# On unix systems, static linking ODBC is supported, thus the library linking is static. -# Use STATIC_LINK_LIBS when Flight tests require static linkage to avoid mixing static/shared Arrow -if(WIN32 AND ARROW_FLIGHT_TEST_LINKAGE STREQUAL "static") - # Static linkage required - pass everything via STATIC_LINK_LIBS +# Respect ARROW_FLIGHT_TEST_LINKAGE, default to shared +if(ARROW_FLIGHT_TEST_LINKAGE STREQUAL "static") set(ODBC_SPI_IMPL_TEST_STATIC_LIBS arrow_odbc_spi_impl arrow_flight_testing_static ${ARROW_TEST_STATIC_LINK_LIBS}) set(ODBC_SPI_IMPL_TEST_EXTRA_LIBS "") -elseif(WIN32) - # Shared linkage - use EXTRA_LINK_LIBS +else() set(ODBC_SPI_IMPL_TEST_STATIC_LIBS "") set(ODBC_SPI_IMPL_TEST_EXTRA_LIBS arrow_odbc_spi_impl - arrow_flight_testing_shared) -else() - # Unix - always static - set(ODBC_SPI_IMPL_TEST_STATIC_LIBS arrow_odbc_spi_impl - arrow_flight_testing_static - ${ARROW_TEST_STATIC_LINK_LIBS}) - set(ODBC_SPI_IMPL_TEST_EXTRA_LIBS "") endif() add_arrow_test(odbc_spi_impl_test From 6b923917f21d557c8d205d6feec8132866958ba2 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Tue, 7 Apr 2026 15:21:12 -0700 Subject: [PATCH 28/29] cleanup --- cpp/src/arrow/flight/sql/odbc/CMakeLists.txt | 16 ++-------- .../flight/sql/odbc/odbc_impl/CMakeLists.txt | 2 +- .../flight/sql/odbc/tests/CMakeLists.txt | 30 +++++++------------ 3 files changed, 13 insertions(+), 35 deletions(-) diff --git a/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt index 3d905128305..c0bb052e05b 100644 --- a/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt @@ -62,12 +62,11 @@ if(WIN32) list(APPEND ARROW_FLIGHT_SQL_ODBC_SRCS odbc.def install/versioninfo.rc) endif() -# On Windows, dynmaic build for ODBC is supported. -# On unix systems, static build for ODBC is supported, all libraries are linked statically on unix. -set(ARROW_FLIGHT_SQL_ODBC_DEPENDENCIES "") +# Initialize install interface libs (only set in Windows static build) set(ARROW_FLIGHT_SQL_ODBC_SHARED_INSTALL_INTERFACE_LIBS "") set(ARROW_FLIGHT_SQL_ODBC_STATIC_INSTALL_INTERFACE_LIBS "") set(ARROW_FLIGHT_SQL_ODBC_SHARED_PRIVATE_LINK_LIBS "") + if(WIN32 AND ARROW_BUILD_STATIC) # Static Arrow deps on Windows — self-contained ODBC DLL set(ARROW_FLIGHT_SQL_ODBC_SHARED_LINK_LIBS arrow_flight_sql_static arrow_odbc_spi_impl) @@ -77,16 +76,7 @@ if(WIN32 AND ARROW_BUILD_STATIC) list(APPEND ARROW_FLIGHT_SQL_ODBC_STATIC_INSTALL_INTERFACE_LIBS ArrowFlight::arrow_flight_sql_static) list(APPEND ARROW_FLIGHT_SQL_ODBC_SHARED_PRIVATE_LINK_LIBS ODBC::ODBC ${ODBCINST}) -elseif(WIN32) - # Dynamic Arrow deps on Windows (current behavior) - set(ARROW_FLIGHT_SQL_ODBC_DEPENDENCIES arrow_flight_sql) - set(ARROW_FLIGHT_SQL_ODBC_SHARED_LINK_LIBS arrow_odbc_spi_impl) - set(ARROW_FLIGHT_SQL_ODBC_STATIC_LINK_LIBS arrow_flight_sql_static) - list(APPEND ARROW_FLIGHT_SQL_ODBC_STATIC_INSTALL_INTERFACE_LIBS - ArrowFlight::arrow_flight_sql_static) - list(APPEND ARROW_FLIGHT_SQL_ODBC_SHARED_PRIVATE_LINK_LIBS ODBC::ODBC ${ODBCINST}) else() - # Unix set(ARROW_FLIGHT_SQL_ODBC_SHARED_LINK_LIBS arrow_odbc_spi_impl) set(ARROW_FLIGHT_SQL_ODBC_STATIC_LINK_LIBS ODBC::ODBC ${ODBCINST}) endif() @@ -102,8 +92,6 @@ add_arrow_lib(arrow_flight_sql_odbc ${ARROW_FLIGHT_SQL_ODBC_SRCS} DEFINITIONS UNICODE - DEPENDENCIES - ${ARROW_FLIGHT_SQL_ODBC_DEPENDENCIES} SHARED_LINK_FLAGS ${ARROW_VERSION_SCRIPT_FLAGS} # Defined in cpp/arrow/CMakeLists.txt SHARED_LINK_LIBS diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt index 99af079579a..43a5879d754 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt @@ -177,7 +177,7 @@ if(ARROW_FLIGHT_TEST_LINKAGE STREQUAL "static") set(ODBC_SPI_IMPL_TEST_EXTRA_LIBS "") else() set(ODBC_SPI_IMPL_TEST_STATIC_LIBS "") - set(ODBC_SPI_IMPL_TEST_EXTRA_LIBS arrow_odbc_spi_impl + set(ODBC_SPI_IMPL_TEST_EXTRA_LIBS arrow_odbc_spi_impl) endif() add_arrow_test(odbc_spi_impl_test diff --git a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt index 89b48e34fa3..825398c79af 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt @@ -42,8 +42,6 @@ set(ARROW_FLIGHT_SQL_ODBC_TEST_SRCS # GH-46889: move protobuf_test_util to a more common location ../../../../engine/substrait/protobuf_test_util.cc) -# ODBC tests must respect ARROW_FLIGHT_TEST_LINKAGE since they depend on Flight libraries -# which may be forced to static linkage due to static gRPC/Protobuf if(ARROW_FLIGHT_TEST_LINKAGE STREQUAL "static") set(ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS arrow_flight_sql_odbc_static ${ARROW_TEST_STATIC_LINK_LIBS}) @@ -55,30 +53,22 @@ endif() # On macOS, link `ODBCINST` first to ensure iodbc take precedence over unixodbc set(ARROW_FLIGHT_SQL_ODBC_TEST_LIBS ${ODBCINST} ${ODBC_LIBRARIES} ${SQLite3_LIBRARIES}) -# On Windows, dynamic linking ODBC is supported, tests link libraries dynamically. -# On unix systems, static linking ODBC is supported, thus tests link libraries statically. -set(ARROW_FLIGHT_SQL_ODBC_TEST_EXTRA_LINK_LIBS "") -set(ARROW_FLIGHT_SQL_ODBC_TEST_STATIC_LINK_LIBS "") -if(WIN32 AND ARROW_FLIGHT_TEST_LINKAGE STREQUAL "static") - # Static Windows tests +# Respect ARROW_FLIGHT_TEST_LINKAGE, default to shared +if(ARROW_FLIGHT_TEST_LINKAGE STREQUAL "static") + set(ARROW_FLIGHT_SQL_ODBC_TEST_EXTRA_LINK_LIBS "") list(APPEND ARROW_FLIGHT_SQL_ODBC_TEST_STATIC_LINK_LIBS arrow_odbc_spi_impl ${ARROW_FLIGHT_SQL_ODBC_TEST_LIBS} ${ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS}) -elseif(WIN32) - # Dynamic Windows tests (current behavior) + # When Flight tests require static linkage, we must also add Arrow test libs to STATIC_LINK_LIBS + # to avoid add_arrow_test from adding shared Arrow test libs + if(ARROW_FLIGHT_TEST_LINKAGE STREQUAL "static") + list(APPEND ARROW_FLIGHT_SQL_ODBC_TEST_STATIC_LINK_LIBS ${ARROW_TEST_STATIC_LINK_LIBS}) + endif() +else() list(APPEND ARROW_FLIGHT_SQL_ODBC_TEST_EXTRA_LINK_LIBS arrow_odbc_spi_impl ${ARROW_FLIGHT_SQL_ODBC_TEST_LIBS}) -else() - # Unix - list(APPEND ARROW_FLIGHT_SQL_ODBC_TEST_STATIC_LINK_LIBS - ${ARROW_FLIGHT_SQL_ODBC_TEST_LIBS} ${ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS}) -endif() - -# When Flight tests require static linkage, we must also add Arrow test libs to STATIC_LINK_LIBS -# to avoid add_arrow_test from adding shared Arrow test libs -if(ARROW_FLIGHT_TEST_LINKAGE STREQUAL "static") - list(APPEND ARROW_FLIGHT_SQL_ODBC_TEST_STATIC_LINK_LIBS ${ARROW_TEST_STATIC_LINK_LIBS}) + set(ARROW_FLIGHT_SQL_ODBC_TEST_STATIC_LINK_LIBS "") endif() add_arrow_test(flight_sql_odbc_test From 86564a85057b0e532a2ca3a5833b242904b239a6 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Tue, 7 Apr 2026 15:44:49 -0700 Subject: [PATCH 29/29] Update CMakeLists.txt --- cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt index 825398c79af..a9d9bc619aa 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt @@ -60,11 +60,6 @@ if(ARROW_FLIGHT_TEST_LINKAGE STREQUAL "static") arrow_odbc_spi_impl ${ARROW_FLIGHT_SQL_ODBC_TEST_LIBS} ${ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS}) - # When Flight tests require static linkage, we must also add Arrow test libs to STATIC_LINK_LIBS - # to avoid add_arrow_test from adding shared Arrow test libs - if(ARROW_FLIGHT_TEST_LINKAGE STREQUAL "static") - list(APPEND ARROW_FLIGHT_SQL_ODBC_TEST_STATIC_LINK_LIBS ${ARROW_TEST_STATIC_LINK_LIBS}) - endif() else() list(APPEND ARROW_FLIGHT_SQL_ODBC_TEST_EXTRA_LINK_LIBS arrow_odbc_spi_impl ${ARROW_FLIGHT_SQL_ODBC_TEST_LIBS})