From 710d7615944f30d9fd1d4ee6bd02dd44818d12b3 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Mon, 23 Mar 2026 17:47:19 -0700 Subject: [PATCH 01/35] 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 7d34a77800384077c8826d1f401578c68e1c2faa Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Mon, 23 Mar 2026 18:36:54 -0700 Subject: [PATCH 02/35] 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 cb0ea3bda68e415c4f337c85aa9f11a1220bfef3 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Mon, 23 Mar 2026 18:37:10 -0700 Subject: [PATCH 03/35] 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 83e0f3445d5fe755c6d14e4f2f20fcdbb3ae8a56 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Tue, 24 Mar 2026 21:06:02 -0700 Subject: [PATCH 04/35] 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 50e8f3d7dcec393c7a2d1fa95940f7d674d29803 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Tue, 24 Mar 2026 21:06:14 -0700 Subject: [PATCH 05/35] 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 7e3afa090d46316e5fd02ed0c4e56b55b5211a90 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Wed, 25 Mar 2026 12:34:40 -0700 Subject: [PATCH 06/35] 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 2e57e08737554405ab806effdbbd22ba5ac1f90e Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Wed, 25 Mar 2026 12:42:19 -0700 Subject: [PATCH 07/35] 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 5bbcd062ac19d4e38b568529f3809f9cb621642d Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Thu, 26 Mar 2026 16:24:15 -0700 Subject: [PATCH 08/35] 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 59b0c02677d3424e94f31ee7e2eb5b1b1dcf77f3 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 27 Mar 2026 09:24:23 -0700 Subject: [PATCH 09/35] 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 a0f0a2345a97d0e5457cbadad0f0243b01c376c5 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Sun, 29 Mar 2026 11:07:16 -0700 Subject: [PATCH 10/35] 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 084a195b6cd6389020df74b4f3328b4ec733205c Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Mon, 30 Mar 2026 12:56:10 -0700 Subject: [PATCH 11/35] 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 c55f47ef7320ee067d44567f1065c4c4b24e29a7 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Mon, 30 Mar 2026 17:09:21 -0700 Subject: [PATCH 12/35] 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 ef740cc08d47924aa5049ab9e20f3918c39a311c Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Mon, 30 Mar 2026 17:42:15 -0700 Subject: [PATCH 13/35] 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 507fa706d886eb13dfb70bf739d400dd3241a6e8 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Tue, 31 Mar 2026 09:10:19 -0700 Subject: [PATCH 14/35] 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 f49eceb5b152bbd00b13abb0e877dcb976651f89 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Tue, 31 Mar 2026 15:40:58 -0700 Subject: [PATCH 15/35] 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 388480ae1beccefb7dbed09970fa5b39996e6f9d Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 3 Apr 2026 17:20:49 -0700 Subject: [PATCH 16/35] 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 1ddbdc652e1771859e6786ed3e375840dbe61072 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 3 Apr 2026 18:31:07 -0700 Subject: [PATCH 17/35] 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 bcb175a060ebe6ff5c0cf13ca3d63ba005201fa1 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 3 Apr 2026 18:31:25 -0700 Subject: [PATCH 18/35] 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 72bd9e780d329d3c5aba40db4ec512a0a7e4dd5c Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 3 Apr 2026 18:32:25 -0700 Subject: [PATCH 19/35] 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 9d62947b0e3d084893b05470dc4bb791c9134e57 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 3 Apr 2026 18:42:57 -0700 Subject: [PATCH 20/35] 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 807cfae64b4f33691e33834c669a8cf6d89c35ed Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 3 Apr 2026 18:44:43 -0700 Subject: [PATCH 21/35] 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 6041123173a25faf725ad2b6fe23cd2f97f953d0 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 3 Apr 2026 18:45:23 -0700 Subject: [PATCH 22/35] 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 ef880fd82493b29158ab537561454d6f3f4e01e7 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 3 Apr 2026 19:06:17 -0700 Subject: [PATCH 23/35] 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 0588a4d292d42cba65cbe00b979b754ef320e08b Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Tue, 7 Apr 2026 14:19:24 -0700 Subject: [PATCH 24/35] 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 3edef309fb41e38e4b5fc2a8540043c31b1445eb Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Tue, 7 Apr 2026 14:22:16 -0700 Subject: [PATCH 25/35] 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 edbb20e40642b49a943a054b7f6cd2ce599d76a9 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Tue, 7 Apr 2026 14:25:58 -0700 Subject: [PATCH 26/35] 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 57b04dea6e9c4591214919b151c165faadd4ebd2 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Tue, 7 Apr 2026 14:32:53 -0700 Subject: [PATCH 27/35] 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 22a25b18f115aaa57f75df54ba037f3f438819b5 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Tue, 7 Apr 2026 15:21:12 -0700 Subject: [PATCH 28/35] 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 1d4f6075173a523a55fe3879fa0971bd450d4b6c Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Tue, 7 Apr 2026 15:44:49 -0700 Subject: [PATCH 29/35] 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}) From fa69c21cd7dc55b3a98f3f4f6f2ce298662d0c15 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 10 Apr 2026 15:37:26 -0700 Subject: [PATCH 30/35] format --- cpp/src/arrow/flight/sql/odbc/CMakeLists.txt | 24 +++++++++---------- .../flight/sql/odbc/odbc_impl/CMakeLists.txt | 13 ++++------ .../flight/sql/odbc/tests/CMakeLists.txt | 3 ++- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt index c0bb052e05b..2ebe8bfe259 100644 --- a/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt @@ -137,12 +137,12 @@ if(ARROW_FLIGHT_SQL_ODBC_INSTALLER) 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_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 @@ -151,12 +151,12 @@ if(ARROW_FLIGHT_SQL_ODBC_INSTALLER) 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_DEPENDENCIES + PRE_EXCLUDE_REGEXES + "api-ms-.*" + "ext-ms-.*" + POST_EXCLUDE_REGEXES + ".*system32/.*\\.dll" RUNTIME DESTINATION bin COMPONENT arrow_flight_sql_odbc) endif() 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 43a5879d754..85548acae1f 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt @@ -135,14 +135,12 @@ if(WIN32) target_include_directories(arrow_odbc_spi_impl PUBLIC ${ODBC_INCLUDE_DIR}) if(ARROW_BUILD_STATIC) target_link_libraries(arrow_odbc_spi_impl - PUBLIC arrow_flight_sql_static - arrow_compute_static - Boost::locale - ${ODBCINST}) + 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}) + PUBLIC arrow_flight_sql_shared arrow_compute_shared + Boost::locale ${ODBCINST}) endif() else() # Unix @@ -171,8 +169,7 @@ target_link_libraries(arrow_odbc_spi_impl_cli arrow_odbc_spi_impl) # 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 + 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 "") else() diff --git a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt index a9d9bc619aa..96d67a6ec2d 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt @@ -56,7 +56,8 @@ set(ARROW_FLIGHT_SQL_ODBC_TEST_LIBS ${ODBCINST} ${ODBC_LIBRARIES} ${SQLite3_LIBR # 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 + 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}) From dafb905063406ae6f8171e081d1a785f8bc7e6c9 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 10 Apr 2026 16:40:37 -0700 Subject: [PATCH 31/35] try to fix macos test crash --- .../flight/sql/odbc/odbc_impl/CMakeLists.txt | 20 ++++++++++---- .../flight/sql/odbc/tests/CMakeLists.txt | 26 ++++++++++++++----- 2 files changed, 34 insertions(+), 12 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 85548acae1f..d2e069b2a6c 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt @@ -167,14 +167,24 @@ target_link_libraries(arrow_odbc_spi_impl_cli arrow_odbc_spi_impl) # Unit tests -# 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 +# 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_STATIC_LIBS arrow_odbc_spi_impl + arrow_flight_testing_static ${ARROW_TEST_STATIC_LINK_LIBS}) set(ODBC_SPI_IMPL_TEST_EXTRA_LIBS "") -else() +elseif(WIN32) 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 + 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 diff --git a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt index 96d67a6ec2d..4ee523968b3 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt @@ -53,18 +53,30 @@ 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}) -# 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 +# 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 + 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}) -else() +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}) - set(ARROW_FLIGHT_SQL_ODBC_TEST_STATIC_LINK_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}) endif() add_arrow_test(flight_sql_odbc_test From 6763cec453c81446ece94062c793dae5b059e647 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 10 Apr 2026 16:59:20 -0700 Subject: [PATCH 32/35] format --- cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt | 9 +++------ cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt | 3 ++- 2 files changed, 5 insertions(+), 7 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 d2e069b2a6c..a88867e01d7 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt @@ -171,18 +171,15 @@ target_link_libraries(arrow_odbc_spi_impl_cli arrow_odbc_spi_impl) # 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_STATIC_LIBS arrow_odbc_spi_impl - arrow_flight_testing_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) set(ODBC_SPI_IMPL_TEST_STATIC_LIBS "") - set(ODBC_SPI_IMPL_TEST_EXTRA_LIBS arrow_odbc_spi_impl - arrow_flight_testing_shared) + 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 + 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() diff --git a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt index 4ee523968b3..475e63d4c45 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt @@ -59,7 +59,8 @@ 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 - list(APPEND ARROW_FLIGHT_SQL_ODBC_TEST_STATIC_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}) From 1c8ac046014af64414e0c91cb2e8f655f510c225 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 10 Apr 2026 17:02:44 -0700 Subject: [PATCH 33/35] add missing header --- cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) 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 a88867e01d7..70747fb0825 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt @@ -150,6 +150,7 @@ else() arrow_compute_static Boost::locale Boost::headers + Boost::variant RapidJSON) if(NOT APPLE) From 705e7cae53c7267e1f1649c740bd545599161604 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 10 Apr 2026 17:13:54 -0700 Subject: [PATCH 34/35] testing --- cpp/src/arrow/flight/sql/odbc/CMakeLists.txt | 27 +++++++++++++------ .../flight/sql/odbc/odbc_impl/CMakeLists.txt | 1 - .../flight/sql/odbc/tests/CMakeLists.txt | 21 ++++++--------- 3 files changed, 27 insertions(+), 22 deletions(-) diff --git a/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt index 2ebe8bfe259..18516a002d1 100644 --- a/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt @@ -67,16 +67,27 @@ 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) - 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) +if(WIN32) + if(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) + else() + set(ARROW_FLIGHT_SQL_ODBC_SHARED_LINK_LIBS arrow_flight_sql_shared 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) + endif() list(APPEND ARROW_FLIGHT_SQL_ODBC_SHARED_PRIVATE_LINK_LIBS ODBC::ODBC ${ODBCINST}) else() + # Unix/macOS: driver dynamically links arrow_flight_sql so the driver and test + # binary share the same grpc/arrow_flight runtime. set(ARROW_FLIGHT_SQL_ODBC_SHARED_LINK_LIBS arrow_odbc_spi_impl) set(ARROW_FLIGHT_SQL_ODBC_STATIC_LINK_LIBS ODBC::ODBC ${ODBCINST}) endif() 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 70747fb0825..a88867e01d7 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt @@ -150,7 +150,6 @@ else() arrow_compute_static Boost::locale Boost::headers - Boost::variant RapidJSON) if(NOT APPLE) diff --git a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt index 475e63d4c45..ad4ee94c5fa 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt @@ -42,7 +42,7 @@ set(ARROW_FLIGHT_SQL_ODBC_TEST_SRCS # GH-46889: move protobuf_test_util to a more common location ../../../../engine/substrait/protobuf_test_util.cc) -if(ARROW_FLIGHT_TEST_LINKAGE STREQUAL "static") +if(ARROW_TEST_LINKAGE STREQUAL "static") set(ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS arrow_flight_sql_odbc_static ${ARROW_TEST_STATIC_LINK_LIBS}) else() @@ -54,32 +54,27 @@ endif() 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. +# On Windows with static Arrow, use STATIC_LINK_LIBS to avoid mixing static/shared. +# On Unix/macOS, 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 - list(APPEND - ARROW_FLIGHT_SQL_ODBC_TEST_STATIC_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}) + ${ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS} + ${ARROW_TEST_STATIC_LINK_LIBS}) elseif(WIN32) - # Dynamic Windows tests (current behavior) + # Dynamic Windows tests list(APPEND ARROW_FLIGHT_SQL_ODBC_TEST_EXTRA_LINK_LIBS arrow_odbc_spi_impl ${ARROW_FLIGHT_SQL_ODBC_TEST_LIBS}) else() - # Unix + # Unix/macOS 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}) -endif() - add_arrow_test(flight_sql_odbc_test SOURCES ${ARROW_FLIGHT_SQL_ODBC_TEST_SRCS} From 7782c69f846a03b0e907ebbca692097b14c0e7c7 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 10 Apr 2026 22:31:14 -0700 Subject: [PATCH 35/35] format --- cpp/src/arrow/flight/sql/odbc/CMakeLists.txt | 6 ++++-- cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt index 18516a002d1..d918d26503d 100644 --- a/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt @@ -70,14 +70,16 @@ set(ARROW_FLIGHT_SQL_ODBC_SHARED_PRIVATE_LINK_LIBS "") if(WIN32) if(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_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) else() - 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_flight_sql_shared + 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) diff --git a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt index ad4ee94c5fa..7c17864aa62 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt @@ -60,7 +60,8 @@ 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 - list(APPEND ARROW_FLIGHT_SQL_ODBC_TEST_STATIC_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}