From e4b4c69ccf7dcc01e2bade6598849228a88be0ee Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Tue, 2 Dec 2025 16:09:38 -0800 Subject: [PATCH 01/22] Link ODBC library statically on unix Change unit tests to re-use code. Testing on windows is needed. Now seeing error ``` Library not loaded: /usr/local/opt/grpc/lib/libgrpc++.1.76.dylib ``` on Excel. Attempt to unlink arrow_flight.proto Now I see ODBC.dylib has 100MB, and error from Excel is ``` Library not loaded: /usr/local/opt/libiodbc/lib/libiodbc.2.dylib ``` instead of looking for flightsql. `iodbctest` command outside of Excel works. in-progress link arrow statically for `flightsql-odbc` * both ODBC driver and `arrow_odbc_spi_impl` need to link Arrow statically for tests to work. * getting error `File already exists in database: Flight.proto` since the ODBC layer is linking dynamically while I successfully got `arrow_odbc_spi_impl` to link to Arrow statically Draft for resolving `File already exists in database: FlightSql.proto` error Note: make ODBC available on Excel first, test with `iodbctest`, worry about ODBC test executable later. Add unix build (same as Windows build) * Attempted to link static libraries with `arrow_odbc_spi_impl`, failed as it caused linking errors and rendered the ODBC driver unusable. Undo changes to resolve broken driver Resolves dependency errors Attempt to switch to static build Still getting error ``` [iODBC][Driver Manager]dlopen(/Library/ODBC/arrow-odbc/libarrow_flight_sql_odbc.2300.0.0.dylib, 0x0006): Library not loaded: @rpath/libarrow_flight_sql.2300.dylib ``` In-progress attempt to build ODBC statically on unix systems In-progress changes to enable static odbc_impl library pushing the changes just for saving my code. Currently odbc test still has double registration issue, work on this next. I think it should be solvable by either adding library flags or just using odbc spi shared. Because `odbc_spi_impl_test` works. And the ODBC tests worked just fine before I switched to static odbc spi impl. Fix for gtest missing issue Attempting to fix for issue: IMPORTANT NOTICE - DO NOT IGNORE: This test program did NOT call testing::InitGoogleTest() before calling RUN_ALL_TESTS(). This is INVALID. Soon Google Test will start to enforce the valid usage. Please fix it ASAP, or IT WILL START TO FAIL. Issue fixed with adding `${ARROW_TEST_LINK_LIBS}`. It is needed alongside `arrow_flight_testing_shared`. IN-PROGRESS build static test on macOS * Trying to have 2 builds. One `arrow_odbc_spi_impl_static` for static build and one `arrow_odbc_spi_impl_shared` for a shared lib that links Arrow dynamically --- only committing the approach that worked. Trying to work from `flight_sql_odbc_test` to debug the real issue. Link 3rd party dependencies statically Fix 3rd party headers cannot find issue for: - boost xpressive and beast headers - rapidjson headers Resolve unneeded link for ODBC ---- Moving `set(APPEND CMAKE_FIND_LIBRARY_SUFFIXES ".a")` up didn't seem to have any effect ---- Fix for static gRPC connection issue: export GRPC_DEFAULT_SSL_ROOTS_FILE_PATH=/etc/ssl/cert.pem Fix cares `cannot modify alias target` issue Make arrow_odbc_spi_impl static lib In progress for getting gprc linked statically Add debug msgs in add_arrow_lib BuildUtils.cmake Remove commented out code in odbc lib Fix build issue from odbc impl tests Added draft code for Link Arrow libs statically on Unix for unit tests Add commented out code`ARROW_DEPENDENCY_USE_SHARED` in ODBC cpp yml Uncomment when it is verified to work. In-progress Fix ODBC test build and make it run. Build executable from scratch Revert "Build executable from scratch" This reverts commit a51dc395d69c50b42090f50c22cdc9247d3baf9f. Dummy test dummy test without using ODBC passed without double registration issue Make ODBC test run Issue to resolve: [libprotobuf FATAL /path/to/arrow/cpp/debug-build/_deps/protobuf-src/src/google/protobuf/extension_set.cc:100] Multiple extension registrations for type "google.protobuf.MessageOptions", field number 1000. unknown file: Failure C++ exception with description "Multiple extension registrations for type "google.protobuf.MessageOptions", field number 1000." thrown in SetUp(). Fix: only link test executable directly with ODBC shared dylib. Do not link test executable with odbc spi impl dylib. And change ODBC to link odbc spi impl dylib publicly instead of privately --- cpp/cmake_modules/BuildUtils.cmake | 9 + cpp/cmake_modules/ThirdpartyToolchain.cmake | 17 +- cpp/src/arrow/flight/sql/odbc/CMakeLists.txt | 95 +++++--- .../sql/odbc/odbc_impl/CMakeLists-backup.txt | 230 ++++++++++++++++++ .../flight/sql/odbc/odbc_impl/CMakeLists.txt | 98 ++++++-- .../config/connection_string_parser.h | 2 +- .../sql/odbc/odbc_impl/odbc_statement.cc | 1 - .../sql/odbc/odbc_impl/spi/connection.h | 1 - .../odbc_impl/ui/dsn_configuration_window.h | 2 +- .../arrow/flight/sql/odbc/odbc_impl/util.h | 1 - .../flight/sql/odbc/tests/CMakeLists.txt | 66 +++-- .../flight/sql/odbc/tests/connection_test.cc | 6 + .../flight/sql/odbc/tests/temp_odbc_test.cc | 38 +++ 13 files changed, 496 insertions(+), 70 deletions(-) create mode 100644 cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists-backup.txt create mode 100644 cpp/src/arrow/flight/sql/odbc/tests/temp_odbc_test.cc diff --git a/cpp/cmake_modules/BuildUtils.cmake b/cpp/cmake_modules/BuildUtils.cmake index db760400f7c..88c98ee9405 100644 --- a/cpp/cmake_modules/BuildUtils.cmake +++ b/cpp/cmake_modules/BuildUtils.cmake @@ -220,6 +220,10 @@ function(ADD_ARROW_LIB LIB_NAME) message(SEND_ERROR "Error: unrecognized arguments: ${ARG_UNPARSED_ARGUMENTS}") endif() + if("${LIB_NAME}" MATCHES "odbc") + message(STATUS "-AL- LIB_NAME contains odbc (arrow flight sql odbc)") + endif() + if(ARG_OUTPUTS) set(${ARG_OUTPUTS}) endif() @@ -319,6 +323,8 @@ function(ADD_ARROW_LIB LIB_NAME) endif() if(BUILD_SHARED) + message(STATUS "-AL- LIB_DEPS:${LIB_DEPS}, EXTRA_DEPS: ${EXTRA_DEPS}" + ) add_library(${LIB_NAME}_shared SHARED ${LIB_DEPS}) if(EXTRA_DEPS) add_dependencies(${LIB_NAME}_shared ${EXTRA_DEPS}) @@ -364,6 +370,8 @@ function(ADD_ARROW_LIB LIB_NAME) VERSION "${ARROW_FULL_SO_VERSION}" SOVERSION "${ARROW_SO_VERSION}") + message(STATUS "-AL- ARG_SHARED_LINK_LIBS:${ARG_SHARED_LINK_LIBS}, ARG_SHARED_INSTALL_INTERFACE_LIBS: ${ARG_SHARED_INSTALL_INTERFACE_LIBS}, ARG_SHARED_PRIVATE_LINK_LIBS: ${ARG_SHARED_PRIVATE_LINK_LIBS}" + ) target_link_libraries(${LIB_NAME}_shared PUBLIC "$" "$" @@ -719,6 +727,7 @@ function(ADD_TEST_CASE REL_TEST_NAME) # Customize link libraries target_link_libraries(${TEST_NAME} PRIVATE ${ARG_STATIC_LINK_LIBS}) else() + message(STATUS "-AL- ARROW_TEST_LINK_LIBS: ${ARROW_TEST_LINK_LIBS}") target_link_libraries(${TEST_NAME} PRIVATE ${ARROW_TEST_LINK_LIBS}) endif() diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index df937cc14cb..a870894c289 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -41,6 +41,8 @@ set(ARROW_RE2_LINKAGE # ---------------------------------------------------------------------- # Resolve the dependencies +# -AL- I believe this is the place where gRPC is linked. (or somewhere else related) + set(ARROW_THIRDPARTY_DEPENDENCIES absl AWSSDK @@ -1107,6 +1109,12 @@ function(build_boost) else() list(APPEND BOOST_EXCLUDE_LIBRARIES uuid) endif() + #-al- Add ODBC-specific dependencies + if(ARROW_FLIGHT_SQL_ODBC) + list(APPEND BOOST_INCLUDE_LIBRARIES beast xpressive) + else() + list(APPEND BOOST_EXCLUDE_LIBRARIES beast xpressive) + endif() set(BOOST_SKIP_INSTALL_RULES ON) if(NOT ARROW_ENABLE_THREADING) set(BOOST_UUID_LINK_LIBATOMIC OFF) @@ -3021,11 +3029,16 @@ function(build_cares) set(CARES_BUILD_TOOLS OFF) fetchcontent_makeavailable(cares) + # -AL- getting issue here. Resolved issue on macOS Intel with `c-ares` if(APPLE) # libresolv must be linked from c-ares version 1.16.1 find_library(LIBRESOLV_LIBRARY NAMES resolv libresolv REQUIRED) - set_target_properties(c-ares::cares PROPERTIES INTERFACE_LINK_LIBRARIES - "${LIBRESOLV_LIBRARY}") + # set_target_properties(c-ares::cares PROPERTIES INTERFACE_LINK_LIBRARIES + # "${LIBRESOLV_LIBRARY}") + # -AL- Changed to below code to get pass + # `set_target_properties can not be used on an ALIAS target.` error. + set_target_properties(c-ares PROPERTIES INTERFACE_LINK_LIBRARIES + "${LIBRESOLV_LIBRARY}") endif() set(ARROW_BUNDLED_STATIC_LIBS diff --git a/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt index c18a8e5de95..c95105aa587 100644 --- a/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt @@ -19,6 +19,12 @@ # GH-44792: Arrow will switch to C++ 20 set(CMAKE_CXX_STANDARD 20) + +if(APPLE) + # CMAKE_FIND_LIBRARY_SUFFIXES. + set(APPEND CMAKE_FIND_LIBRARY_SUFFIXES ".a") +endif() + if(WIN32) if(MSVC_VERSION GREATER_EQUAL 1900) set(ODBCINST legacy_stdio_definitions odbccp32 shlwapi) @@ -31,8 +37,10 @@ else() set(ODBCINST odbcinst) endif() +message(STATUS "-AL- random msg in odbc cmake") + add_subdirectory(odbc_impl) -add_subdirectory(tests) +add_subdirectory(tests) # -AL- TODO enable after `odbc_impl` works and ODBC driver still links statically. arrow_install_all_headers("arrow/flight/sql/odbc") @@ -61,33 +69,64 @@ if(WIN32) list(APPEND ARROW_FLIGHT_SQL_ODBC_SRCS odbc.def install/versioninfo.rc) endif() -add_arrow_lib(arrow_flight_sql_odbc - CMAKE_PACKAGE_NAME - ArrowFlightSqlOdbc - PKG_CONFIG_NAME - arrow-flight-sql-odbc - OUTPUTS - ARROW_FLIGHT_SQL_ODBC_LIBRARIES - SOURCES - ${ARROW_FLIGHT_SQL_ODBC_SRCS} - DEPENDENCIES - arrow_flight_sql - DEFINITIONS - UNICODE - SHARED_LINK_FLAGS - ${ARROW_VERSION_SCRIPT_FLAGS} # Defined in cpp/arrow/CMakeLists.txt - SHARED_LINK_LIBS - arrow_flight_sql_shared - SHARED_INSTALL_INTERFACE_LIBS - ArrowFlight::arrow_flight_sql_shared - STATIC_LINK_LIBS - arrow_flight_sql_static - STATIC_INSTALL_INTERFACE_LIBS - ArrowFlight::arrow_flight_sql_static - SHARED_PRIVATE_LINK_LIBS - ODBC::ODBC - ${ODBCINST} - arrow_odbc_spi_impl) +# -AL- TODO for ODBC layer, use variables so it's like +# Var = “” +# If windows +# Var append shared lib +# And that it. The end goal should be 1 add_arrow_lib call. + + +# -AL- build dynamically on Windows and statically on Unix systems. +# Might make them both the same if it is easier to maintain? Currently doing it separately to not break ODBC on Windows for now. +if(WIN32) + add_arrow_lib(arrow_flight_sql_odbc + CMAKE_PACKAGE_NAME + ArrowFlightSqlOdbc + PKG_CONFIG_NAME + arrow-flight-sql-odbc + OUTPUTS + ARROW_FLIGHT_SQL_ODBC_LIBRARIES + SOURCES + ${ARROW_FLIGHT_SQL_ODBC_SRCS} + DEFINITIONS + UNICODE + SHARED_LINK_FLAGS + ${ARROW_VERSION_SCRIPT_FLAGS} # Defined in cpp/arrow/CMakeLists.txt + SHARED_LINK_LIBS + arrow_flight_sql_shared + SHARED_INSTALL_INTERFACE_LIBS + ArrowFlight::arrow_flight_sql_shared + STATIC_LINK_LIBS + arrow_flight_sql_static + STATIC_INSTALL_INTERFACE_LIBS + ArrowFlight::arrow_flight_sql_static + SHARED_PRIVATE_LINK_LIBS + ODBC::ODBC + ${ODBCINST} + arrow_odbc_spi_impl_shared) +else() + # Unix + add_arrow_lib(arrow_flight_sql_odbc + CMAKE_PACKAGE_NAME + ArrowFlightSqlOdbc + PKG_CONFIG_NAME + arrow-flight-sql-odbc + OUTPUTS + ARROW_FLIGHT_SQL_ODBC_LIBRARIES + SOURCES + ${ARROW_FLIGHT_SQL_ODBC_SRCS} + DEFINITIONS + UNICODE + SHARED_LINK_FLAGS + ${ARROW_VERSION_SCRIPT_FLAGS} # Defined in cpp/arrow/CMakeLists.txt + STATIC_LINK_LIBS + ODBC::ODBC + ${ODBCINST} + # -AL- below line removed = driver not loaded? + # SHARED_PRIVATE_LINK_LIBS + SHARED_LINK_LIBS #-AL- make odbc calls exported too? + arrow_odbc_spi_impl_static) +endif() foreach(LIB_TARGET ${ARROW_FLIGHT_SQL_ODBC_LIBRARIES}) target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_FLIGHT_SQL_ODBC_EXPORTING) diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists-backup.txt b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists-backup.txt new file mode 100644 index 00000000000..be04f3bb922 --- /dev/null +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists-backup.txt @@ -0,0 +1,230 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# -AL- TODO try to create a arrow_odbc_spi_impl_static/shared static build AND shared build. +# The ODBC driver can still link to static build as before on unix, and test can link to the shared build. + +set(ARROW_ODBC_SPI_IMPL_SOURCES accessors/binary_array_accessor.cc + accessors/binary_array_accessor.h + accessors/boolean_array_accessor.cc + accessors/boolean_array_accessor.h + accessors/common.h + accessors/date_array_accessor.cc + accessors/date_array_accessor.h + accessors/decimal_array_accessor.cc + accessors/decimal_array_accessor.h + accessors/primitive_array_accessor.cc + accessors/primitive_array_accessor.h + accessors/string_array_accessor.cc + accessors/string_array_accessor.h + accessors/time_array_accessor.cc + accessors/time_array_accessor.h + accessors/timestamp_array_accessor.cc + accessors/timestamp_array_accessor.h + address_info.cc + address_info.h + attribute_utils.h + blocking_queue.h + calendar_utils.cc + calendar_utils.h + config/configuration.cc + config/configuration.h + config/connection_string_parser.cc + config/connection_string_parser.h + diagnostics.cc + diagnostics.h + encoding.cc + encoding.h + encoding_utils.h + error_codes.h + exceptions.cc + exceptions.h + flight_sql_auth_method.cc + flight_sql_auth_method.h + flight_sql_connection.cc + flight_sql_connection.h + flight_sql_driver.cc + flight_sql_driver.h + flight_sql_get_tables_reader.cc + flight_sql_get_tables_reader.h + flight_sql_get_type_info_reader.cc + flight_sql_get_type_info_reader.h + flight_sql_result_set.cc + flight_sql_result_set.h + flight_sql_result_set_accessors.cc + flight_sql_result_set_accessors.h + flight_sql_result_set_column.cc + flight_sql_result_set_column.h + flight_sql_result_set_metadata.cc + flight_sql_result_set_metadata.h + flight_sql_ssl_config.cc + flight_sql_ssl_config.h + flight_sql_statement.cc + flight_sql_statement.h + flight_sql_statement_get_columns.cc + flight_sql_statement_get_columns.h + flight_sql_statement_get_tables.cc + flight_sql_statement_get_tables.h + flight_sql_statement_get_type_info.cc + flight_sql_statement_get_type_info.h + flight_sql_stream_chunk_buffer.cc + flight_sql_stream_chunk_buffer.h + get_info_cache.cc + get_info_cache.h + json_converter.cc + json_converter.h + odbc_connection.cc + odbc_connection.h + odbc_descriptor.cc + odbc_descriptor.h + odbc_environment.cc + odbc_environment.h + odbc_handle.h + odbc_statement.cc + odbc_statement.h + platform.h + record_batch_transformer.cc + record_batch_transformer.h + scalar_function_reporter.cc + scalar_function_reporter.h + spi/connection.h + spi/driver.h + spi/result_set.h + spi/result_set_metadata.h + spi/statement.h + system_trust_store.cc + system_trust_store.h + types.h + type_utilities.h + util.cc + util.h) + +add_library(arrow_odbc_spi_impl STATIC + ${ARROW_ODBC_SPI_IMPL_SOURCES}) +target_compile_definitions(arrow_odbc_spi_impl PUBLIC UNICODE) +target_include_directories(arrow_odbc_spi_impl PUBLIC include include/odbc_impl) +target_include_directories(arrow_odbc_spi_impl PUBLIC ${CMAKE_CURRENT_LIST_DIR}) + +if(WIN32) + target_sources(arrow_odbc_spi_impl + PRIVATE ui/add_property_window.cc + ui/add_property_window.h + ui/custom_window.cc + ui/custom_window.h + ui/dsn_configuration_window.cc + ui/dsn_configuration_window.h + ui/window.cc + ui/window.h + win_system_dsn.cc + system_dsn.cc + system_dsn.h) +endif() + +message(STATUS "-AL- random msg in odbc_impl") + +if(WIN32) + target_link_libraries(arrow_odbc_spi_impl + PUBLIC arrow_flight_sql_shared arrow_compute_shared Boost::locale + ${ODBCINST}) +else() + # unix + + # find_package(Arrow REQUIRED) #-AL- tried this line for static linking, but it doesn't work because when we build + # `arrow_odbc_spi_impl`, we are still in the process of building the Arrow library + + # message(STATUS "-AL- 2 random msg in odbc_impl 2 ") + # find_dependency(Arrow CONFIG) # -AL- new issue: Could NOT find Arrow (missing: Arrow_DIR) error + # message(STATUS "-AL- 3 random msg in odbc_impl 3") + # find_dependency(ArrowCompute CONFIG) + + # -AL- if I can link arrow_odbc_spi_impl with static libs, I will begin to understand how it works. + # (it is also possible that both ODBC and `flightsql-odbc` are needed to be statically linking to work) + target_link_libraries(arrow_odbc_spi_impl + # -AL- shared libs are required for linking to work properly. + # -AL- used to switch to `_static` when shared libraries are turned off. + # Requires `find_package(Arrow REQUIRED)` so it won't work. + # PUBLIC Arrow::arrow_flight_sql_static ArrowCompute::arrow_compute_static + # -AL- below is the format used by ARROW_EXAMPLE_LINK_LIBS example. + PUBLIC arrow_flight_sql_static + arrow_compute_static + Boost::locale + Boost::headers + RapidJSON) +endif() + +set_target_properties(arrow_odbc_spi_impl + PROPERTIES ARCHIVE_OUTPUT_DIRECTORY + ${CMAKE_BINARY_DIR}/$/lib + LIBRARY_OUTPUT_DIRECTORY + ${CMAKE_BINARY_DIR}/$/lib + RUNTIME_OUTPUT_DIRECTORY + ${CMAKE_BINARY_DIR}/$/lib) + +# CLI +add_executable(arrow_odbc_spi_impl_cli main.cc) +set_target_properties(arrow_odbc_spi_impl_cli + PROPERTIES RUNTIME_OUTPUT_DIRECTORY + ${CMAKE_BINARY_DIR}/$/bin) +target_link_libraries(arrow_odbc_spi_impl_cli arrow_odbc_spi_impl) + +# Unit tests +# if(WIN32) +add_arrow_test(odbc_spi_impl_test + SOURCES + accessors/boolean_array_accessor_test.cc + accessors/binary_array_accessor_test.cc + accessors/date_array_accessor_test.cc + accessors/decimal_array_accessor_test.cc + accessors/primitive_array_accessor_test.cc + accessors/string_array_accessor_test.cc + accessors/time_array_accessor_test.cc + accessors/timestamp_array_accessor_test.cc + flight_sql_connection_test.cc + flight_sql_stream_chunk_buffer_test.cc + parse_table_types_test.cc + json_converter_test.cc + record_batch_transformer_test.cc + util_test.cc + EXTRA_LINK_LIBS + arrow_odbc_spi_impl + arrow_flight_testing_shared) +# Using below code causes build issues +# else() +# # Unix +# # Link Arrow libs statically on Unix for unit tests +# #-AL- nicer way to do it might be like example in cpp/src/arrow/c/CMakeLists.txt +# add_arrow_test(odbc_spi_impl_test +# SOURCES +# accessors/boolean_array_accessor_test.cc +# accessors/binary_array_accessor_test.cc +# accessors/date_array_accessor_test.cc +# accessors/decimal_array_accessor_test.cc +# accessors/primitive_array_accessor_test.cc +# accessors/string_array_accessor_test.cc +# accessors/time_array_accessor_test.cc +# accessors/timestamp_array_accessor_test.cc +# flight_sql_connection_test.cc +# flight_sql_stream_chunk_buffer_test.cc +# parse_table_types_test.cc +# json_converter_test.cc +# record_batch_transformer_test.cc +# util_test.cc +# EXTRA_LINK_LIBS +# arrow_odbc_spi_impl +# STATIC_LINK_LIBS +# arrow_flight_testing_static) +# 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 e58558258df..40a14babe65 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt @@ -15,8 +15,10 @@ # specific language governing permissions and limitations # under the License. -add_library(arrow_odbc_spi_impl - accessors/binary_array_accessor.cc +# -AL- TODO try to create a arrow_odbc_spi_impl_static/shared static build AND shared build. +# The ODBC driver can still link to static build as before on unix, and test can link to the shared build. + +set(ARROW_ODBC_SPI_IMPL_SOURCES accessors/binary_array_accessor.cc accessors/binary_array_accessor.h accessors/boolean_array_accessor.cc accessors/boolean_array_accessor.h @@ -111,13 +113,16 @@ add_library(arrow_odbc_spi_impl type_utilities.h util.cc util.h) -target_compile_definitions(arrow_odbc_spi_impl PUBLIC UNICODE) -target_include_directories(arrow_odbc_spi_impl PUBLIC include include/odbc_impl) -target_include_directories(arrow_odbc_spi_impl PUBLIC ${CMAKE_CURRENT_LIST_DIR}) + +# add_library(arrow_odbc_spi_impl STATIC +# ${ARROW_ODBC_SPI_IMPL_SOURCES}) +# target_compile_definitions(arrow_odbc_spi_impl PUBLIC UNICODE) +# target_include_directories(arrow_odbc_spi_impl PUBLIC include include/odbc_impl) +# target_include_directories(arrow_odbc_spi_impl PUBLIC ${CMAKE_CURRENT_LIST_DIR}) if(WIN32) - target_sources(arrow_odbc_spi_impl - PRIVATE ui/add_property_window.cc + list(APPEND ARROW_ODBC_SPI_IMPL_SOURCES + ui/add_property_window.cc ui/add_property_window.h ui/custom_window.cc ui/custom_window.h @@ -143,22 +148,82 @@ else() ${ODBCINST}) endif() -set_target_properties(arrow_odbc_spi_impl - PROPERTIES ARCHIVE_OUTPUT_DIRECTORY - ${CMAKE_BINARY_DIR}/$/lib - LIBRARY_OUTPUT_DIRECTORY - ${CMAKE_BINARY_DIR}/$/lib - RUNTIME_OUTPUT_DIRECTORY - ${CMAKE_BINARY_DIR}/$/lib) +# if(WIN32) +# target_link_libraries(arrow_odbc_spi_impl +# PUBLIC arrow_flight_sql_shared arrow_compute_shared Boost::locale +# ${ODBCINST}) +# else() +# # unix + +# # find_package(Arrow REQUIRED) #-AL- tried this line for static linking, but it doesn't work because when we build +# # `arrow_odbc_spi_impl`, we are still in the process of building the Arrow library + +# # message(STATUS "-AL- 2 random msg in odbc_impl 2 ") +# # find_dependency(Arrow CONFIG) # -AL- new issue: Could NOT find Arrow (missing: Arrow_DIR) error +# # message(STATUS "-AL- 3 random msg in odbc_impl 3") +# # find_dependency(ArrowCompute CONFIG) + +# # -AL- if I can link arrow_odbc_spi_impl with static libs, I will begin to understand how it works. +# # (it is also possible that both ODBC and `flightsql-odbc` are needed to be statically linking to work) +# target_link_libraries(arrow_odbc_spi_impl +# # -AL- shared libs are required for linking to work properly. +# # -AL- used to switch to `_static` when shared libraries are turned off. +# # Requires `find_package(Arrow REQUIRED)` so it won't work. +# # PUBLIC Arrow::arrow_flight_sql_static ArrowCompute::arrow_compute_static +# # -AL- below is the format used by ARROW_EXAMPLE_LINK_LIBS example. +# PUBLIC arrow_flight_sql_static +# arrow_compute_static +# Boost::locale +# Boost::headers +# RapidJSON) +# endif() + +# -AL- TODO: if below works, need to refactor to add +# ${ODBC_SPI_IMPL_STATIC_LINK_LIBS} ${ODBC_SPI_IMPL_SHARED_LINK_LIBS} +add_arrow_lib(arrow_odbc_spi_impl + SOURCES + ${ARROW_ODBC_SPI_IMPL_SOURCES} + DEFINITIONS + UNICODE + SHARED_LINK_LIBS + arrow_flight_sql_shared + arrow_compute_shared + Boost::locale + Boost::headers + RapidJSON + STATIC_LINK_LIBS + arrow_flight_sql_static + arrow_compute_static + Boost::locale + Boost::headers + RapidJSON + # PUBLIC_INCLUDES #-AL- turns out Arrow doesn't have a `PUBLIC_INCLUDES` var + # include + # include/odbc_impl + # ${CMAKE_CURRENT_LIST_DIR} + ) # CLI add_executable(arrow_odbc_spi_impl_cli main.cc) set_target_properties(arrow_odbc_spi_impl_cli PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/$/bin) -target_link_libraries(arrow_odbc_spi_impl_cli arrow_odbc_spi_impl) +target_link_libraries(arrow_odbc_spi_impl_cli arrow_odbc_spi_impl_shared) # Unit tests + +# -AL- add comment +# On Windows, dynamic linking ODBC is supported. +# On unix systems, static linking ODBC is supported, thus the test linking is different. + +# -AL- todo: test this on Windows. +set(ODBC_SPI_IMPL_TEST_LINK_LIBS arrow_odbc_spi_impl_shared + arrow_flight_testing_shared) + +if(APPLE) + list(APPEND ODBC_SPI_IMPL_TEST_LINK_LIBS ${ARROW_TEST_LINK_LIBS}) +endif() + add_arrow_test(odbc_spi_impl_test SOURCES accessors/boolean_array_accessor_test.cc @@ -176,5 +241,4 @@ add_arrow_test(odbc_spi_impl_test record_batch_transformer_test.cc util_test.cc EXTRA_LINK_LIBS - arrow_odbc_spi_impl - arrow_flight_testing_shared) + ${ODBC_SPI_IMPL_TEST_LINK_LIBS}) diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/config/connection_string_parser.h b/cpp/src/arrow/flight/sql/odbc/odbc_impl/config/connection_string_parser.h index dd937410adc..2e7196e322f 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/config/connection_string_parser.h +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/config/connection_string_parser.h @@ -19,7 +19,7 @@ #include -#include "config/configuration.h" +#include "arrow/flight/sql/odbc/odbc_impl/config/configuration.h" namespace arrow::flight::sql::odbc { namespace config { diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/odbc_statement.cc b/cpp/src/arrow/flight/sql/odbc/odbc_impl/odbc_statement.cc index 82656d1a38f..c9cedfe3b3f 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/odbc_statement.cc +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/odbc_statement.cc @@ -30,7 +30,6 @@ #include #include #include -#include #include #include diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/spi/connection.h b/cpp/src/arrow/flight/sql/odbc/odbc_impl/spi/connection.h index b7f24628a64..00a7b511ef2 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/spi/connection.h +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/spi/connection.h @@ -18,7 +18,6 @@ #pragma once #include -#include #include #include #include diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/ui/dsn_configuration_window.h b/cpp/src/arrow/flight/sql/odbc/odbc_impl/ui/dsn_configuration_window.h index bfac68df8b9..a01b7740a11 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/ui/dsn_configuration_window.h +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/ui/dsn_configuration_window.h @@ -17,7 +17,7 @@ #pragma once -#include "config/configuration.h" +#include "arrow/flight/sql/odbc/odbc_impl/config/configuration.h" #include "ui/custom_window.h" namespace arrow::flight::sql::odbc { diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/util.h b/cpp/src/arrow/flight/sql/odbc/odbc_impl/util.h index e9a6794f104..3bd11d60113 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/util.h +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/util.h @@ -17,7 +17,6 @@ #pragma once -#include #include #include diff --git a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt index 3041d2a973d..7c17a687b87 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt @@ -15,8 +15,6 @@ # specific language governing permissions and limitations # under the License. -add_custom_target(tests) - if(WIN32) include_directories(${ODBC_INCLUDE_DIRS}) else() @@ -33,29 +31,61 @@ set(ARROW_FLIGHT_SQL_MOCK_SERVER_SRCS ../../example/sqlite_server.cc ../../example/sqlite_tables_schema_batch_reader.cc) +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() + set(ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS arrow_flight_sql_odbc_shared + ${ARROW_TEST_SHARED_LINK_LIBS} + ) +endif() + +set(ARROW_FLIGHT_SQL_ODBC_TEST_SRCS + odbc_test_suite.cc + odbc_test_suite.h + columns_test.cc + connection_attr_test.cc + connection_info_test.cc + connection_test.cc + errors_test.cc + get_functions_test.cc + statement_attr_test.cc + statement_test.cc + tables_test.cc + 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 +) + +# -AL- todo write comment: +# On Windows, dynamic linking ODBC is supported. +# On unix systems, static linking ODBC is supported, thus the test linking is different. +if(WIN32) add_arrow_test(flight_sql_odbc_test SOURCES - odbc_test_suite.cc - odbc_test_suite.h - columns_test.cc - connection_attr_test.cc - connection_info_test.cc - connection_test.cc - errors_test.cc - get_functions_test.cc - statement_attr_test.cc - statement_test.cc - tables_test.cc - 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 + ${ARROW_FLIGHT_SQL_ODBC_TEST_SRCS} ${ARROW_FLIGHT_SQL_MOCK_SERVER_SRCS} EXTRA_LINK_LIBS ${ODBC_LIBRARIES} ${ODBCINST} ${SQLite3_LIBRARIES} - arrow_odbc_spi_impl) + arrow_odbc_spi_impl_shared) +else() + # unix +add_arrow_test(flight_sql_odbc_test + SOURCES + ${ARROW_FLIGHT_SQL_ODBC_TEST_SRCS} + ${ARROW_FLIGHT_SQL_MOCK_SERVER_SRCS} + DEFINITIONS + UNICODE + STATIC_LINK_LIBS + ${ODBC_LIBRARIES} + ${ODBCINST} + ${SQLite3_LIBRARIES} + ${ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS}) +endif() # Disable unity build due to sqlite_sql_info.cc conflict with sql.h and sqlext.h headers. set_target_properties(arrow-flight-sql-odbc-test PROPERTIES UNITY_BUILD OFF) diff --git a/cpp/src/arrow/flight/sql/odbc/tests/connection_test.cc b/cpp/src/arrow/flight/sql/odbc/tests/connection_test.cc index 3ca4a50ef76..08ea643d777 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/connection_test.cc +++ b/cpp/src/arrow/flight/sql/odbc/tests/connection_test.cc @@ -469,6 +469,12 @@ TYPED_TEST(ConnectionTest, TestConnect) { // Verifies connect and disconnect works on its own } +// -AL- dummy test without using ODBC passed without double registration issue +TEST(DummyTest, AlinaDummyTest) { + bool boolvar = true; + EXPECT_EQ(boolvar, true); +} + TYPED_TEST(ConnectionTest, TestSQLAllocFreeStmt) { SQLHSTMT statement; diff --git a/cpp/src/arrow/flight/sql/odbc/tests/temp_odbc_test.cc b/cpp/src/arrow/flight/sql/odbc/tests/temp_odbc_test.cc new file mode 100644 index 00000000000..091e7cdefa4 --- /dev/null +++ b/cpp/src/arrow/flight/sql/odbc/tests/temp_odbc_test.cc @@ -0,0 +1,38 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// #include "arrow/flight/sql/odbc/odbc_impl/platform.h" + +// #include +// #include +// #include + +#include + +namespace arrow::flight::sql::odbc { + +TEST(TEMP, DUMMY) { + int x = 1; + ASSERT_EQ(1, x); +} + +TEST(TEMP, DUMMYFails) { + int x = 1; + ASSERT_EQ(2, x); +} + +} // namespace arrow::flight::sql::odbc From 9288a6fcc405ac15df0361d9e65279c572b4a6ff Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Tue, 20 Jan 2026 15:02:18 -0800 Subject: [PATCH 02/22] in-progress changes to accomodate macos CI --- .github/workflows/cpp_extra.yml | 2 + cpp/src/arrow/flight/sql/odbc/CMakeLists.txt | 6 +- .../flight/sql/odbc/odbc_impl/CMakeLists.txt | 62 ++++++++++++------- 3 files changed, 43 insertions(+), 27 deletions(-) diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index 25f7d06a9e3..dcadda18a07 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -357,6 +357,8 @@ jobs: ARROW_BUILD_TESTS: ON ARROW_FLIGHT_SQL_ODBC: ON ARROW_HOME: /tmp/local + ARROW_DEPENDENCY_USE_SHARED: OFF + ARROW_DEPENDENCY_SOURCE: BUNDLED steps: - name: Checkout Arrow uses: actions/checkout@v6.0.0 diff --git a/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt index c95105aa587..e231f622309 100644 --- a/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt @@ -40,7 +40,7 @@ endif() message(STATUS "-AL- random msg in odbc cmake") add_subdirectory(odbc_impl) -add_subdirectory(tests) # -AL- TODO enable after `odbc_impl` works and ODBC driver still links statically. +add_subdirectory(tests) arrow_install_all_headers("arrow/flight/sql/odbc") @@ -122,9 +122,7 @@ else() STATIC_LINK_LIBS ODBC::ODBC ${ODBCINST} - # -AL- below line removed = driver not loaded? - # SHARED_PRIVATE_LINK_LIBS - SHARED_LINK_LIBS #-AL- make odbc calls exported too? + SHARED_LINK_LIBS #-AL- make odbc calls exported too arrow_odbc_spi_impl_static) 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 40a14babe65..41ed6f5b059 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt @@ -135,19 +135,6 @@ if(WIN32) system_dsn.h) endif() -if(APPLE) - target_include_directories(arrow_odbc_spi_impl SYSTEM BEFORE PUBLIC ${ODBC_INCLUDE_DIR}) - target_link_libraries(arrow_odbc_spi_impl - PUBLIC arrow_flight_sql_shared arrow_compute_shared Boost::locale - iodbc) -else() - 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}) -endif() - # if(WIN32) # target_link_libraries(arrow_odbc_spi_impl # PUBLIC arrow_flight_sql_shared arrow_compute_shared Boost::locale @@ -178,6 +165,29 @@ endif() # RapidJSON) # endif() +set(ODBC_SPI_IMPL_SHARED_LINK_LIBS + arrow_flight_sql_shared + arrow_compute_shared + Boost::locale + Boost::headers + RapidJSON) + +set(ODBC_SPI_IMPL_STATIC_LINK_LIBS + arrow_flight_sql_static + arrow_compute_static + Boost::locale + Boost::headers + RapidJSON) + +# if(APPLE) +# list(APPEND ODBC_SPI_IMPL_SHARED_LINK_LIBS iodbc) +# list(APPEND ODBC_SPI_IMPL_STATIC_LINK_LIBS iodbc) +# else() +# find_package(ODBC REQUIRED) +# list(APPEND ODBC_SPI_IMPL_SHARED_LINK_LIBS ${ODBCINST}) +# list(APPEND ODBC_SPI_IMPL_STATIC_LINK_LIBS ${ODBCINST}) +# endif() + # -AL- TODO: if below works, need to refactor to add # ${ODBC_SPI_IMPL_STATIC_LINK_LIBS} ${ODBC_SPI_IMPL_SHARED_LINK_LIBS} add_arrow_lib(arrow_odbc_spi_impl @@ -186,23 +196,29 @@ add_arrow_lib(arrow_odbc_spi_impl DEFINITIONS UNICODE SHARED_LINK_LIBS - arrow_flight_sql_shared - arrow_compute_shared - Boost::locale - Boost::headers - RapidJSON + ${ODBC_SPI_IMPL_SHARED_LINK_LIBS} STATIC_LINK_LIBS - arrow_flight_sql_static - arrow_compute_static - Boost::locale - Boost::headers - RapidJSON + ${ODBC_SPI_IMPL_STATIC_LINK_LIBS} # PUBLIC_INCLUDES #-AL- turns out Arrow doesn't have a `PUBLIC_INCLUDES` var # include # include/odbc_impl # ${CMAKE_CURRENT_LIST_DIR} ) +# if(APPLE) +# #-AL- temp comment out +# target_include_directories(arrow_odbc_spi_impl SYSTEM BEFORE PUBLIC ${ODBC_INCLUDE_DIR}) +# # target_link_libraries(arrow_odbc_spi_impl +# # PUBLIC arrow_flight_sql_shared arrow_compute_shared Boost::locale +# # iodbc) +# else() +# # 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}) +# endif() + # CLI add_executable(arrow_odbc_spi_impl_cli main.cc) set_target_properties(arrow_odbc_spi_impl_cli From 711b3e0863ebbf5fe2c5cb1401fbaf72eed58aa4 Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Tue, 20 Jan 2026 15:07:04 -0800 Subject: [PATCH 03/22] Test ODBC CI - to be reverted Can revert later --- .github/workflows/cpp_extra.yml | 490 ++++++++++++++++---------------- 1 file changed, 245 insertions(+), 245 deletions(-) diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index dcadda18a07..fc5b89ccf21 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -91,250 +91,250 @@ jobs: with: parent-workflow: cpp_extra - docker: - needs: check-labels - name: ${{ matrix.title }} - runs-on: ${{ matrix.runs-on }} - if: >- - needs.check-labels.outputs.force == 'true' || - contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') || - contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++') - timeout-minutes: 75 - strategy: - fail-fast: false - matrix: - include: - - image: alpine-linux-cpp - runs-on: ubuntu-latest - title: AMD64 Alpine Linux - - image: conda-cpp - run-options: >- - -e ARROW_USE_MESON=ON - runs-on: ubuntu-latest - title: AMD64 Ubuntu Meson - # TODO: We should remove this "continue-on-error: true" once GH-47207 is resolved - - continue-on-error: true - envs: - - DEBIAN=13 - image: debian-cpp - run-options: >- - -e CMAKE_CXX_STANDARD=23 - runs-on: ubuntu-latest - title: AMD64 Debian C++23 - env: - ARCHERY_DEBUG: 1 - ARROW_ENABLE_TIMING_TESTS: OFF - DOCKER_VOLUME_PREFIX: ".docker/" - steps: - - name: Checkout Arrow - uses: actions/checkout@v6 - with: - fetch-depth: 0 - submodules: recursive - - name: Cache Docker Volumes - uses: actions/cache@v5 - with: - path: .docker - key: extra-${{ matrix.image }}-${{ hashFiles('cpp/**') }} - restore-keys: extra-${{ matrix.image }}- - - name: Setup Python - uses: actions/setup-python@v6 - with: - python-version: 3 - - name: Setup Archery - run: python3 -m pip install -e dev/archery[docker] - - name: Execute Docker Build - continue-on-error: ${{ matrix.continue-on-error || false }} - env: - ARCHERY_DOCKER_USER: ${{ secrets.DOCKERHUB_USER }} - ARCHERY_DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} - ENVS: ${{ toJSON(matrix.envs) }} - run: | - # GH-40558: reduce ASLR to avoid ASAN/LSAN crashes - sudo sysctl -w vm.mmap_rnd_bits=28 - source ci/scripts/util_enable_core_dumps.sh - if [ "${ENVS}" != "null" ]; then - echo "${ENVS}" | jq -r '.[]' | while read env; do - echo "${env}" >> .env - done - fi - archery docker run ${{ matrix.run-options || '' }} ${{ matrix.image }} - - name: Docker Push - if: >- - success() && - github.event_name == 'push' && - github.repository == 'apache/arrow' && - github.ref_name == 'main' - env: - ARCHERY_DOCKER_USER: ${{ secrets.DOCKERHUB_USER }} - ARCHERY_DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} - continue-on-error: true - run: archery docker push ${{ matrix.image }} + # docker: + # needs: check-labels + # name: ${{ matrix.title }} + # runs-on: ${{ matrix.runs-on }} + # if: >- + # needs.check-labels.outputs.force == 'true' || + # contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') || + # contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++') + # timeout-minutes: 75 + # strategy: + # fail-fast: false + # matrix: + # include: + # - image: alpine-linux-cpp + # runs-on: ubuntu-latest + # title: AMD64 Alpine Linux + # - image: conda-cpp + # run-options: >- + # -e ARROW_USE_MESON=ON + # runs-on: ubuntu-latest + # title: AMD64 Ubuntu Meson + # # TODO: We should remove this "continue-on-error: true" once GH-47207 is resolved + # - continue-on-error: true + # envs: + # - DEBIAN=13 + # image: debian-cpp + # run-options: >- + # -e CMAKE_CXX_STANDARD=23 + # runs-on: ubuntu-latest + # title: AMD64 Debian C++23 + # env: + # ARCHERY_DEBUG: 1 + # ARROW_ENABLE_TIMING_TESTS: OFF + # DOCKER_VOLUME_PREFIX: ".docker/" + # steps: + # - name: Checkout Arrow + # uses: actions/checkout@v6 + # with: + # fetch-depth: 0 + # submodules: recursive + # - name: Cache Docker Volumes + # uses: actions/cache@v5 + # with: + # path: .docker + # key: extra-${{ matrix.image }}-${{ hashFiles('cpp/**') }} + # restore-keys: extra-${{ matrix.image }}- + # - name: Setup Python + # uses: actions/setup-python@v6 + # with: + # python-version: 3 + # - name: Setup Archery + # run: python3 -m pip install -e dev/archery[docker] + # - name: Execute Docker Build + # continue-on-error: ${{ matrix.continue-on-error || false }} + # env: + # ARCHERY_DOCKER_USER: ${{ secrets.DOCKERHUB_USER }} + # ARCHERY_DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + # ENVS: ${{ toJSON(matrix.envs) }} + # run: | + # # GH-40558: reduce ASLR to avoid ASAN/LSAN crashes + # sudo sysctl -w vm.mmap_rnd_bits=28 + # source ci/scripts/util_enable_core_dumps.sh + # if [ "${ENVS}" != "null" ]; then + # echo "${ENVS}" | jq -r '.[]' | while read env; do + # echo "${env}" >> .env + # done + # fi + # archery docker run ${{ matrix.run-options || '' }} ${{ matrix.image }} + # - name: Docker Push + # if: >- + # success() && + # github.event_name == 'push' && + # github.repository == 'apache/arrow' && + # github.ref_name == 'main' + # env: + # ARCHERY_DOCKER_USER: ${{ secrets.DOCKERHUB_USER }} + # ARCHERY_DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + # continue-on-error: true + # run: archery docker push ${{ matrix.image }} - msvc-arm64: - needs: check-labels - if: >- - needs.check-labels.outputs.force == 'true' || - contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') || - contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++') - name: ARM64 Windows 11 MSVC - uses: ./.github/workflows/cpp_windows.yml - with: - arch: arm64 - os: windows-11-arm - simd-level: NONE + # msvc-arm64: + # needs: check-labels + # if: >- + # needs.check-labels.outputs.force == 'true' || + # contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') || + # contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++') + # name: ARM64 Windows 11 MSVC + # uses: ./.github/workflows/cpp_windows.yml + # with: + # arch: arm64 + # os: windows-11-arm + # simd-level: NONE - jni-linux: - needs: check-labels - name: JNI ${{ matrix.platform.runs-on }} ${{ matrix.platform.arch }} - runs-on: ${{ matrix.platform.runs-on }} - if: >- - needs.check-labels.outputs.force == 'true' || - contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') || - contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++') - timeout-minutes: 240 - permissions: - # This is for using GitHub Packages for vcpkg cache - packages: write - strategy: - fail-fast: false - matrix: - platform: - - arch: "amd64" - runs-on: ubuntu-latest - - arch: "arm64v8" - runs-on: ubuntu-24.04-arm - env: - ARCH: ${{ matrix.platform.arch }} - REPO: ghcr.io/${{ github.repository }}-dev - steps: - - name: Checkout Arrow - uses: actions/checkout@v6 - with: - fetch-depth: 0 - submodules: recursive - - name: Free up disk space - run: | - ci/scripts/util_free_space.sh - - name: Cache Docker Volumes - uses: actions/cache@v5 - with: - path: .docker - key: jni-${{ matrix.platform.runs-on }}-${{ hashFiles('cpp/**') }} - restore-keys: jni-${{ matrix.platform.runs-on }}- - - name: Setup Python - uses: actions/setup-python@v6 - with: - python-version: 3 - - name: Setup Archery - run: python3 -m pip install -e dev/archery[docker] - - name: Execute Docker Build - env: - ARCHERY_DOCKER_USER: ${{ github.actor }} - ARCHERY_DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,readwrite" - run: | - source ci/scripts/util_enable_core_dumps.sh - archery docker run cpp-jni - - name: Docker Push - if: >- - success() && - github.event_name == 'push' && - github.ref_name == 'main' - env: - ARCHERY_DOCKER_USER: ${{ github.actor }} - ARCHERY_DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }} - continue-on-error: true - run: archery docker push cpp-jni + # jni-linux: + # needs: check-labels + # name: JNI ${{ matrix.platform.runs-on }} ${{ matrix.platform.arch }} + # runs-on: ${{ matrix.platform.runs-on }} + # if: >- + # needs.check-labels.outputs.force == 'true' || + # contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') || + # contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++') + # timeout-minutes: 240 + # permissions: + # # This is for using GitHub Packages for vcpkg cache + # packages: write + # strategy: + # fail-fast: false + # matrix: + # platform: + # - arch: "amd64" + # runs-on: ubuntu-latest + # - arch: "arm64v8" + # runs-on: ubuntu-24.04-arm + # env: + # ARCH: ${{ matrix.platform.arch }} + # REPO: ghcr.io/${{ github.repository }}-dev + # steps: + # - name: Checkout Arrow + # uses: actions/checkout@v6 + # with: + # fetch-depth: 0 + # submodules: recursive + # - name: Free up disk space + # run: | + # ci/scripts/util_free_space.sh + # - name: Cache Docker Volumes + # uses: actions/cache@v5 + # with: + # path: .docker + # key: jni-${{ matrix.platform.runs-on }}-${{ hashFiles('cpp/**') }} + # restore-keys: jni-${{ matrix.platform.runs-on }}- + # - name: Setup Python + # uses: actions/setup-python@v6 + # with: + # python-version: 3 + # - name: Setup Archery + # run: python3 -m pip install -e dev/archery[docker] + # - name: Execute Docker Build + # env: + # ARCHERY_DOCKER_USER: ${{ github.actor }} + # ARCHERY_DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }} + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,readwrite" + # run: | + # source ci/scripts/util_enable_core_dumps.sh + # archery docker run cpp-jni + # - name: Docker Push + # if: >- + # success() && + # github.event_name == 'push' && + # github.ref_name == 'main' + # env: + # ARCHERY_DOCKER_USER: ${{ github.actor }} + # ARCHERY_DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }} + # continue-on-error: true + # run: archery docker push cpp-jni - jni-macos: - needs: check-labels - name: JNI macOS - runs-on: macos-14 - if: >- - needs.check-labels.outputs.force == 'true' || - contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') || - contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++') - timeout-minutes: 45 - env: - MACOSX_DEPLOYMENT_TARGET: "14.0" - steps: - - name: Checkout Arrow - uses: actions/checkout@v6 - with: - fetch-depth: 0 - submodules: recursive - - name: Install dependencies - run: | - brew bundle --file=cpp/Brewfile - # We want to link aws-sdk-cpp statically but Homebrew's - # aws-sdk-cpp provides only shared library. If we have - # Homebrew's aws-sdk-cpp, our build mix Homebrew's - # aws-sdk-cpp and bundled aws-sdk-cpp. We uninstall Homebrew's - # aws-sdk-cpp to ensure using only bundled aws-sdk-cpp. - brew uninstall aws-sdk-cpp - # We want to use bundled RE2 for static linking. If - # Homebrew's RE2 is installed, its header file may be used. - # We uninstall Homebrew's RE2 to ensure using bundled RE2. - brew uninstall grpc || : # gRPC depends on RE2 - brew uninstall grpc@1.54 || : # gRPC 1.54 may be installed too - brew uninstall re2 - # We want to use bundled Protobuf for static linking. If - # Homebrew's Protobuf is installed, its library file may be - # used on test We uninstall Homebrew's Protobuf to ensure using - # bundled Protobuf. - brew uninstall protobuf - - name: Prepare ccache - run: | - echo "CCACHE_DIR=${PWD}/ccache" >> ${GITHUB_ENV} - - name: Cache ccache - uses: actions/cache@v5 - with: - path: ccache - key: jni-macos-${{ hashFiles('cpp/**') }} - restore-keys: jni-macos- - - name: CMake - run: | - cmake \ - -S cpp \ - -B cpp.build \ - --preset=ninja-release-jni-macos \ - -DARROW_BUILD_TESTS=ON \ - -DCMAKE_INSTALL_PREFIX=$PWD/cpp.install - - name: Build - run: | - cmake --build cpp.build - - name: Install - run: | - cmake --install cpp.build - - name: Test - env: - ARROW_TEST_DATA: ${{ github.workspace }}/testing/data - PARQUET_TEST_DATA: ${{ github.workspace }}/cpp/submodules/parquet-testing/data - run: | - # MinIO is required - exclude_tests="arrow-s3fs-test" - # unstable - exclude_tests="${exclude_tests}|arrow-acero-asof-join-node-test" - exclude_tests="${exclude_tests}|arrow-acero-hash-join-node-test" - ctest \ - --exclude-regex "${exclude_tests}" \ - --label-regex unittest \ - --output-on-failure \ - --parallel "$(sysctl -n hw.ncpu)" \ - --test-dir "cpp.build" \ - --timeout 300 - - name: Build example - run: | - cmake \ - -S cpp/examples/minimal_build/ \ - -B cpp/examples/minimal_build.build \ - -GNinja \ - -DCMAKE_INSTALL_PREFIX=$PWD/cpp.install - cmake --build cpp/examples/minimal_build.build - cd cpp/examples/minimal_build - ../minimal_build.build/arrow-example + # jni-macos: + # needs: check-labels + # name: JNI macOS + # runs-on: macos-14 + # if: >- + # needs.check-labels.outputs.force == 'true' || + # contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') || + # contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++') + # timeout-minutes: 45 + # env: + # MACOSX_DEPLOYMENT_TARGET: "14.0" + # steps: + # - name: Checkout Arrow + # uses: actions/checkout@v6 + # with: + # fetch-depth: 0 + # submodules: recursive + # - name: Install dependencies + # run: | + # brew bundle --file=cpp/Brewfile + # # We want to link aws-sdk-cpp statically but Homebrew's + # # aws-sdk-cpp provides only shared library. If we have + # # Homebrew's aws-sdk-cpp, our build mix Homebrew's + # # aws-sdk-cpp and bundled aws-sdk-cpp. We uninstall Homebrew's + # # aws-sdk-cpp to ensure using only bundled aws-sdk-cpp. + # brew uninstall aws-sdk-cpp + # # We want to use bundled RE2 for static linking. If + # # Homebrew's RE2 is installed, its header file may be used. + # # We uninstall Homebrew's RE2 to ensure using bundled RE2. + # brew uninstall grpc || : # gRPC depends on RE2 + # brew uninstall grpc@1.54 || : # gRPC 1.54 may be installed too + # brew uninstall re2 + # # We want to use bundled Protobuf for static linking. If + # # Homebrew's Protobuf is installed, its library file may be + # # used on test We uninstall Homebrew's Protobuf to ensure using + # # bundled Protobuf. + # brew uninstall protobuf + # - name: Prepare ccache + # run: | + # echo "CCACHE_DIR=${PWD}/ccache" >> ${GITHUB_ENV} + # - name: Cache ccache + # uses: actions/cache@v5 + # with: + # path: ccache + # key: jni-macos-${{ hashFiles('cpp/**') }} + # restore-keys: jni-macos- + # - name: CMake + # run: | + # cmake \ + # -S cpp \ + # -B cpp.build \ + # --preset=ninja-release-jni-macos \ + # -DARROW_BUILD_TESTS=ON \ + # -DCMAKE_INSTALL_PREFIX=$PWD/cpp.install + # - name: Build + # run: | + # cmake --build cpp.build + # - name: Install + # run: | + # cmake --install cpp.build + # - name: Test + # env: + # ARROW_TEST_DATA: ${{ github.workspace }}/testing/data + # PARQUET_TEST_DATA: ${{ github.workspace }}/cpp/submodules/parquet-testing/data + # run: | + # # MinIO is required + # exclude_tests="arrow-s3fs-test" + # # unstable + # exclude_tests="${exclude_tests}|arrow-acero-asof-join-node-test" + # exclude_tests="${exclude_tests}|arrow-acero-hash-join-node-test" + # ctest \ + # --exclude-regex "${exclude_tests}" \ + # --label-regex unittest \ + # --output-on-failure \ + # --parallel "$(sysctl -n hw.ncpu)" \ + # --test-dir "cpp.build" \ + # --timeout 300 + # - name: Build example + # run: | + # cmake \ + # -S cpp/examples/minimal_build/ \ + # -B cpp/examples/minimal_build.build \ + # -GNinja \ + # -DCMAKE_INSTALL_PREFIX=$PWD/cpp.install + # cmake --build cpp/examples/minimal_build.build + # cd cpp/examples/minimal_build + # ../minimal_build.build/arrow-example odbc-macos: needs: check-labels @@ -557,10 +557,10 @@ jobs: report-extra-cpp: if: github.event_name == 'schedule' && always() needs: - - docker - - jni-linux - - jni-macos - - msvc-arm64 + # - docker + # - jni-linux + # - jni-macos + # - msvc-arm64 - odbc-macos - odbc-msvc uses: ./.github/workflows/report_ci.yml From eea27ba1296c406c37a3238c6d816547e3c427e0 Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Tue, 20 Jan 2026 16:06:26 -0800 Subject: [PATCH 04/22] Only install ODBC dependencies in mac As dependencies are static and built from source --- .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 fc5b89ccf21..77ecabbc4b1 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -367,7 +367,8 @@ jobs: submodules: recursive - name: Install Dependencies run: | - brew bundle --file=cpp/Brewfile + brew install libiodbc + # brew bundle --file=cpp/Brewfile - name: Setup ccache run: | ci/scripts/ccache_setup.sh From f27dad76ccf6f99c638bd8a79178e257714abd48 Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Tue, 20 Jan 2026 16:12:42 -0800 Subject: [PATCH 05/22] Uninstall absl as attempt to resolve build on Intel --- .github/workflows/cpp_extra.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index 77ecabbc4b1..c89c2bdbdc7 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -367,8 +367,10 @@ jobs: submodules: recursive - name: Install Dependencies run: | - brew install libiodbc - # brew bundle --file=cpp/Brewfile + # brew install libiodbc + # -AL- absl header collision on mac + brew bundle --file=cpp/Brewfile + brew uninstall absl - name: Setup ccache run: | ci/scripts/ccache_setup.sh From 7b72564387cf25af04a08e74cf099cf187c3291d Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Tue, 20 Jan 2026 16:25:41 -0800 Subject: [PATCH 06/22] Add C++ standard 20 --- .github/workflows/cpp_extra.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index c89c2bdbdc7..c943e1920f9 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -358,7 +358,8 @@ jobs: ARROW_FLIGHT_SQL_ODBC: ON ARROW_HOME: /tmp/local ARROW_DEPENDENCY_USE_SHARED: OFF - ARROW_DEPENDENCY_SOURCE: BUNDLED + ARROW_DEPENDENCY_SOURCE: BUNDLED + CMAKE_CXX_STANDARD: "20" steps: - name: Checkout Arrow uses: actions/checkout@v6.0.0 @@ -370,7 +371,7 @@ jobs: # brew install libiodbc # -AL- absl header collision on mac brew bundle --file=cpp/Brewfile - brew uninstall absl + # brew uninstall absl - name: Setup ccache run: | ci/scripts/ccache_setup.sh @@ -432,6 +433,7 @@ jobs: CMAKE_INSTALL_PREFIX: /usr VCPKG_BINARY_SOURCES: 'clear;nugettimeout,600;nuget,GitHub,readwrite' VCPKG_DEFAULT_TRIPLET: x64-windows + CMAKE_CXX_STANDARD: "20" steps: - name: Disable Crash Dialogs run: | From b80234c8b471ca87172441156a4946ea387e985b Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Tue, 20 Jan 2026 16:46:05 -0800 Subject: [PATCH 07/22] Remove absl header from intel --- .github/workflows/cpp_extra.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index c943e1920f9..bf1e8fc8335 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -399,6 +399,11 @@ jobs: LIBIODBC_DIR="$(brew --cellar libiodbc)/$(brew list --versions libiodbc | awk '{print $2}')" export ODBC_INCLUDE_DIR=$LIBIODBC_DIR/include export CXXFLAGS="$CXXFLAGS -I$ODBC_INCLUDE_DIR" + + if [ "${{ matrix.macos-version }}" = "15-intel" ]; then + # -AL- fix absl issue on Intel mac + rm -rf /usr/local/include/absl + fi ci/scripts/cpp_build.sh $(pwd) $(pwd)/build - name: Test shell: bash From 51b85264f2d7d15885ba87ab35dd74d81c4f7260 Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Tue, 20 Jan 2026 16:51:37 -0800 Subject: [PATCH 08/22] Use static linking in dependency install step --- .github/workflows/cpp_extra.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index bf1e8fc8335..d5b1be1955f 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -368,10 +368,18 @@ jobs: submodules: recursive - name: Install Dependencies run: | - # brew install libiodbc - # -AL- absl header collision on mac brew bundle --file=cpp/Brewfile - # brew uninstall absl + # We want to use bundled RE2 for static linking. If + # Homebrew's RE2 is installed, its header file may be used. + # We uninstall Homebrew's RE2 to ensure using bundled RE2. + brew uninstall grpc || : # gRPC depends on RE2 + brew uninstall grpc@1.54 || : # gRPC 1.54 may be installed too + brew uninstall re2 + # We want to use bundled Protobuf for static linking. If + # Homebrew's Protobuf is installed, its library file may be + # used on test We uninstall Homebrew's Protobuf to ensure using + # bundled Protobuf. + brew uninstall protobuf - name: Setup ccache run: | ci/scripts/ccache_setup.sh @@ -399,11 +407,6 @@ jobs: LIBIODBC_DIR="$(brew --cellar libiodbc)/$(brew list --versions libiodbc | awk '{print $2}')" export ODBC_INCLUDE_DIR=$LIBIODBC_DIR/include export CXXFLAGS="$CXXFLAGS -I$ODBC_INCLUDE_DIR" - - if [ "${{ matrix.macos-version }}" = "15-intel" ]; then - # -AL- fix absl issue on Intel mac - rm -rf /usr/local/include/absl - fi ci/scripts/cpp_build.sh $(pwd) $(pwd)/build - name: Test shell: bash From f6efc09dddbb37e83c4a4aeaec151efa0efc48cb Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Thu, 22 Jan 2026 10:58:30 -0800 Subject: [PATCH 09/22] Use bundled boost for static linking --- .github/workflows/cpp_extra.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index d5b1be1955f..abc35375afe 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -380,6 +380,8 @@ jobs: # used on test We uninstall Homebrew's Protobuf to ensure using # bundled Protobuf. brew uninstall protobuf + # We want to use bundled Boost for static linking. + brew uninstall boost - name: Setup ccache run: | ci/scripts/ccache_setup.sh From 27f45732f26389cfe95377fcb67373bc25bf276e Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Wed, 21 Jan 2026 14:20:27 -0800 Subject: [PATCH 10/22] In-progress Fix Windows build --- .github/workflows/cpp_extra.yml | 8 +- cpp/cmake_modules/BuildUtils.cmake | 2 +- cpp/src/arrow/flight/sql/odbc/CMakeLists.txt | 8 +- .../sql/odbc/odbc_impl/CMakeLists-backup.txt | 3 +- .../flight/sql/odbc/odbc_impl/CMakeLists.txt | 132 +++--------------- .../odbc/odbc_impl/ui/add_property_window.cc | 6 +- .../sql/odbc/odbc_impl/ui/custom_window.cc | 2 +- .../sql/odbc/odbc_impl/ui/custom_window.h | 2 +- .../odbc_impl/ui/dsn_configuration_window.h | 2 +- .../flight/sql/odbc/tests/CMakeLists.txt | 6 +- 10 files changed, 46 insertions(+), 125 deletions(-) diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index abc35375afe..bbeef163afc 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -478,8 +478,12 @@ jobs: uses: actions/cache@v5 with: path: ${{ steps.ccache-info.outputs.cache-dir }} - key: cpp-odbc-ccache-windows-x64-${{ hashFiles('cpp/**') }} - restore-keys: cpp-odbc-ccache-windows-x64- + key: cpp-odbc-ccache-windows-x64-${{ env.CACHE_VERSION }}-${{ hashFiles('cpp/**') }} + restore-keys: cpp-odbc-ccache-windows-x64-${{ env.CACHE_VERSION }}- + env: + # -AL- if needed, can invalidate current cache after resolving Windows build. Can remove this code in PR if not needed + # We can invalidate the current cache by updating this. + CACHE_VERSION: "2026-01-21" - name: Checkout vcpkg uses: actions/checkout@v6 with: diff --git a/cpp/cmake_modules/BuildUtils.cmake b/cpp/cmake_modules/BuildUtils.cmake index 88c98ee9405..874afbebf4f 100644 --- a/cpp/cmake_modules/BuildUtils.cmake +++ b/cpp/cmake_modules/BuildUtils.cmake @@ -221,7 +221,7 @@ function(ADD_ARROW_LIB LIB_NAME) endif() if("${LIB_NAME}" MATCHES "odbc") - message(STATUS "-AL- LIB_NAME contains odbc (arrow flight sql odbc)") + message(STATUS "-AL- LIB_NAME contains odbc (arrow flight sql odbc): ${LIB_NAME}") endif() if(ARG_OUTPUTS) diff --git a/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt index e231f622309..7c3fc238e9b 100644 --- a/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt @@ -19,6 +19,7 @@ # GH-44792: Arrow will switch to C++ 20 set(CMAKE_CXX_STANDARD 20) +# add_custom_target(arrow_flight_sql_odbc) # -AL- attempt to create optional arrow_flight_sql_odbc.lib if(APPLE) # CMAKE_FIND_LIBRARY_SUFFIXES. @@ -94,6 +95,7 @@ if(WIN32) ${ARROW_VERSION_SCRIPT_FLAGS} # Defined in cpp/arrow/CMakeLists.txt SHARED_LINK_LIBS arrow_flight_sql_shared + arrow_odbc_spi_impl SHARED_INSTALL_INTERFACE_LIBS ArrowFlight::arrow_flight_sql_shared STATIC_LINK_LIBS @@ -102,10 +104,10 @@ if(WIN32) ArrowFlight::arrow_flight_sql_static SHARED_PRIVATE_LINK_LIBS ODBC::ODBC - ${ODBCINST} - arrow_odbc_spi_impl_shared) + ${ODBCINST}) else() # Unix + # -AL- add comment for static build. Static build is recommended in unix system add_arrow_lib(arrow_flight_sql_odbc CMAKE_PACKAGE_NAME ArrowFlightSqlOdbc @@ -123,7 +125,7 @@ else() ODBC::ODBC ${ODBCINST} SHARED_LINK_LIBS #-AL- make odbc calls exported too - arrow_odbc_spi_impl_static) + arrow_odbc_spi_impl) endif() foreach(LIB_TARGET ${ARROW_FLIGHT_SQL_ODBC_LIBRARIES}) diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists-backup.txt b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists-backup.txt index be04f3bb922..be4f42aed0e 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists-backup.txt +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists-backup.txt @@ -120,8 +120,7 @@ target_include_directories(arrow_odbc_spi_impl PUBLIC include include/odbc_impl) target_include_directories(arrow_odbc_spi_impl PUBLIC ${CMAKE_CURRENT_LIST_DIR}) if(WIN32) - target_sources(arrow_odbc_spi_impl - PRIVATE ui/add_property_window.cc +list(APPEND ARROW_ODBC_SPI_IMPL_SOURCES ui/add_property_window.cc ui/add_property_window.h ui/custom_window.cc ui/custom_window.h 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 41ed6f5b059..d088012d3bc 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt @@ -15,10 +15,8 @@ # specific language governing permissions and limitations # under the License. -# -AL- TODO try to create a arrow_odbc_spi_impl_static/shared static build AND shared build. -# The ODBC driver can still link to static build as before on unix, and test can link to the shared build. - -set(ARROW_ODBC_SPI_IMPL_SOURCES accessors/binary_array_accessor.cc +add_library(arrow_odbc_spi_impl STATIC + accessors/binary_array_accessor.cc accessors/binary_array_accessor.h accessors/boolean_array_accessor.cc accessors/boolean_array_accessor.h @@ -113,16 +111,13 @@ set(ARROW_ODBC_SPI_IMPL_SOURCES accessors/binary_array_accessor.cc type_utilities.h util.cc util.h) - -# add_library(arrow_odbc_spi_impl STATIC -# ${ARROW_ODBC_SPI_IMPL_SOURCES}) -# target_compile_definitions(arrow_odbc_spi_impl PUBLIC UNICODE) -# target_include_directories(arrow_odbc_spi_impl PUBLIC include include/odbc_impl) -# target_include_directories(arrow_odbc_spi_impl PUBLIC ${CMAKE_CURRENT_LIST_DIR}) +target_compile_definitions(arrow_odbc_spi_impl PUBLIC UNICODE) +target_include_directories(arrow_odbc_spi_impl PUBLIC include include/odbc_impl) +target_include_directories(arrow_odbc_spi_impl PUBLIC ${CMAKE_CURRENT_LIST_DIR}) if(WIN32) - list(APPEND ARROW_ODBC_SPI_IMPL_SOURCES - ui/add_property_window.cc + target_sources(arrow_odbc_spi_impl + PRIVATE ui/add_property_window.cc ui/add_property_window.h ui/custom_window.cc ui/custom_window.h @@ -135,111 +130,27 @@ if(WIN32) system_dsn.h) endif() -# if(WIN32) -# target_link_libraries(arrow_odbc_spi_impl -# PUBLIC arrow_flight_sql_shared arrow_compute_shared Boost::locale -# ${ODBCINST}) -# else() -# # unix - -# # find_package(Arrow REQUIRED) #-AL- tried this line for static linking, but it doesn't work because when we build -# # `arrow_odbc_spi_impl`, we are still in the process of building the Arrow library - -# # message(STATUS "-AL- 2 random msg in odbc_impl 2 ") -# # find_dependency(Arrow CONFIG) # -AL- new issue: Could NOT find Arrow (missing: Arrow_DIR) error -# # message(STATUS "-AL- 3 random msg in odbc_impl 3") -# # find_dependency(ArrowCompute CONFIG) - -# # -AL- if I can link arrow_odbc_spi_impl with static libs, I will begin to understand how it works. -# # (it is also possible that both ODBC and `flightsql-odbc` are needed to be statically linking to work) -# target_link_libraries(arrow_odbc_spi_impl -# # -AL- shared libs are required for linking to work properly. -# # -AL- used to switch to `_static` when shared libraries are turned off. -# # Requires `find_package(Arrow REQUIRED)` so it won't work. -# # PUBLIC Arrow::arrow_flight_sql_static ArrowCompute::arrow_compute_static -# # -AL- below is the format used by ARROW_EXAMPLE_LINK_LIBS example. -# PUBLIC arrow_flight_sql_static -# arrow_compute_static -# Boost::locale -# Boost::headers -# RapidJSON) -# endif() - -set(ODBC_SPI_IMPL_SHARED_LINK_LIBS - arrow_flight_sql_shared - arrow_compute_shared - Boost::locale - Boost::headers - RapidJSON) - -set(ODBC_SPI_IMPL_STATIC_LINK_LIBS - arrow_flight_sql_static - arrow_compute_static - Boost::locale - Boost::headers - RapidJSON) - -# if(APPLE) -# list(APPEND ODBC_SPI_IMPL_SHARED_LINK_LIBS iodbc) -# list(APPEND ODBC_SPI_IMPL_STATIC_LINK_LIBS iodbc) -# else() -# find_package(ODBC REQUIRED) -# list(APPEND ODBC_SPI_IMPL_SHARED_LINK_LIBS ${ODBCINST}) -# list(APPEND ODBC_SPI_IMPL_STATIC_LINK_LIBS ${ODBCINST}) -# endif() - -# -AL- TODO: if below works, need to refactor to add -# ${ODBC_SPI_IMPL_STATIC_LINK_LIBS} ${ODBC_SPI_IMPL_SHARED_LINK_LIBS} -add_arrow_lib(arrow_odbc_spi_impl - SOURCES - ${ARROW_ODBC_SPI_IMPL_SOURCES} - DEFINITIONS - UNICODE - SHARED_LINK_LIBS - ${ODBC_SPI_IMPL_SHARED_LINK_LIBS} - STATIC_LINK_LIBS - ${ODBC_SPI_IMPL_STATIC_LINK_LIBS} - # PUBLIC_INCLUDES #-AL- turns out Arrow doesn't have a `PUBLIC_INCLUDES` var - # include - # include/odbc_impl - # ${CMAKE_CURRENT_LIST_DIR} - ) - -# if(APPLE) -# #-AL- temp comment out -# target_include_directories(arrow_odbc_spi_impl SYSTEM BEFORE PUBLIC ${ODBC_INCLUDE_DIR}) -# # target_link_libraries(arrow_odbc_spi_impl -# # PUBLIC arrow_flight_sql_shared arrow_compute_shared Boost::locale -# # iodbc) -# else() -# # 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}) -# endif() +if(APPLE) + target_include_directories(arrow_odbc_spi_impl SYSTEM BEFORE PUBLIC ${ODBC_INCLUDE_DIR}) + target_link_libraries(arrow_odbc_spi_impl + PUBLIC arrow_flight_sql_static arrow_compute_static Boost::locale + iodbc) +else() + 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}) +endif() # CLI add_executable(arrow_odbc_spi_impl_cli main.cc) set_target_properties(arrow_odbc_spi_impl_cli PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/$/bin) -target_link_libraries(arrow_odbc_spi_impl_cli arrow_odbc_spi_impl_shared) +target_link_libraries(arrow_odbc_spi_impl_cli arrow_odbc_spi_impl) # Unit tests - -# -AL- add comment -# On Windows, dynamic linking ODBC is supported. -# On unix systems, static linking ODBC is supported, thus the test linking is different. - -# -AL- todo: test this on Windows. -set(ODBC_SPI_IMPL_TEST_LINK_LIBS arrow_odbc_spi_impl_shared - arrow_flight_testing_shared) - -if(APPLE) - list(APPEND ODBC_SPI_IMPL_TEST_LINK_LIBS ${ARROW_TEST_LINK_LIBS}) -endif() - add_arrow_test(odbc_spi_impl_test SOURCES accessors/boolean_array_accessor_test.cc @@ -257,4 +168,5 @@ add_arrow_test(odbc_spi_impl_test record_batch_transformer_test.cc util_test.cc EXTRA_LINK_LIBS - ${ODBC_SPI_IMPL_TEST_LINK_LIBS}) + arrow_odbc_spi_impl + arrow_flight_testing_shared) diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/ui/add_property_window.cc b/cpp/src/arrow/flight/sql/odbc/odbc_impl/ui/add_property_window.cc index 634fd77862e..6518e48459e 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/ui/add_property_window.cc +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/ui/add_property_window.cc @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -#include "ui/add_property_window.h" +#include "arrow/flight/sql/odbc/odbc_impl/ui/add_property_window.h" #include @@ -25,8 +25,8 @@ #include #include "arrow/flight/sql/odbc/odbc_impl/exceptions.h" -#include "ui/custom_window.h" -#include "ui/window.h" +#include "arrow/flight/sql/odbc/odbc_impl/ui/custom_window.h" +#include "arrow/flight/sql/odbc/odbc_impl/ui/window.h" namespace arrow::flight::sql::odbc { namespace config { diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/ui/custom_window.cc b/cpp/src/arrow/flight/sql/odbc/odbc_impl/ui/custom_window.cc index 0d24f0cca82..ff8416a43a8 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/ui/custom_window.cc +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/ui/custom_window.cc @@ -29,7 +29,7 @@ #include #include "arrow/flight/sql/odbc/odbc_impl/exceptions.h" -#include "ui/custom_window.h" +#include "arrow/flight/sql/odbc/odbc_impl/ui/custom_window.h" namespace arrow::flight::sql::odbc { namespace config { diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/ui/custom_window.h b/cpp/src/arrow/flight/sql/odbc/odbc_impl/ui/custom_window.h index a6580011485..9745f58b2e2 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/ui/custom_window.h +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/ui/custom_window.h @@ -17,7 +17,7 @@ #pragma once -#include "ui/window.h" +#include "arrow/flight/sql/odbc/odbc_impl/ui/window.h" namespace arrow::flight::sql::odbc { namespace config { diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/ui/dsn_configuration_window.h b/cpp/src/arrow/flight/sql/odbc/odbc_impl/ui/dsn_configuration_window.h index a01b7740a11..74a75053736 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/ui/dsn_configuration_window.h +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/ui/dsn_configuration_window.h @@ -18,7 +18,7 @@ #pragma once #include "arrow/flight/sql/odbc/odbc_impl/config/configuration.h" -#include "ui/custom_window.h" +#include "arrow/flight/sql/odbc/odbc_impl/ui/custom_window.h" namespace arrow::flight::sql::odbc { namespace config { diff --git a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt index 7c17a687b87..39293ff37ec 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt @@ -67,11 +67,15 @@ add_arrow_test(flight_sql_odbc_test SOURCES ${ARROW_FLIGHT_SQL_ODBC_TEST_SRCS} ${ARROW_FLIGHT_SQL_MOCK_SERVER_SRCS} + DEFINITIONS + UNICODE EXTRA_LINK_LIBS ${ODBC_LIBRARIES} ${ODBCINST} ${SQLite3_LIBRARIES} - arrow_odbc_spi_impl_shared) + ${ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS} + # arrow_odbc_spi_impl_shared # -AL- +) else() # unix add_arrow_test(flight_sql_odbc_test From f661478e2a33c18c3df4530b926e7901b7dd3bb6 Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Thu, 22 Jan 2026 16:42:33 -0800 Subject: [PATCH 11/22] Fix macOS (after Windows build) --- 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 d088012d3bc..b76b0b55fee 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt @@ -133,7 +133,7 @@ endif() if(APPLE) target_include_directories(arrow_odbc_spi_impl SYSTEM BEFORE PUBLIC ${ODBC_INCLUDE_DIR}) target_link_libraries(arrow_odbc_spi_impl - PUBLIC arrow_flight_sql_static arrow_compute_static Boost::locale + PUBLIC arrow_flight_sql_static arrow_compute_static Boost::locale Boost::headers RapidJSON iodbc) else() find_package(ODBC REQUIRED) From 2eb9a5d70ebcb4ebe40d7e21b8e6c73cfbf1da9f Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Thu, 22 Jan 2026 17:28:30 -0800 Subject: [PATCH 12/22] Remove unneeded ODBC link Resolves the issue of ODBC on macOS being dynamically linked to ODBC --- 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 b76b0b55fee..a93e268a2f6 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt @@ -134,7 +134,7 @@ if(APPLE) target_include_directories(arrow_odbc_spi_impl SYSTEM BEFORE PUBLIC ${ODBC_INCLUDE_DIR}) target_link_libraries(arrow_odbc_spi_impl PUBLIC arrow_flight_sql_static arrow_compute_static Boost::locale Boost::headers RapidJSON - iodbc) + ) else() find_package(ODBC REQUIRED) target_include_directories(arrow_odbc_spi_impl PUBLIC ${ODBC_INCLUDE_DIR}) From 88c7c969401430cbd7c59cf11e329c9763eac955 Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Thu, 22 Jan 2026 17:33:12 -0800 Subject: [PATCH 13/22] Fix ODBC double proto issue on macOS Need to check if Windows CI passes --- .../flight/sql/odbc/odbc_impl/CMakeLists.txt | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 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 a93e268a2f6..e831a79255a 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt @@ -133,8 +133,11 @@ endif() if(APPLE) target_include_directories(arrow_odbc_spi_impl SYSTEM BEFORE PUBLIC ${ODBC_INCLUDE_DIR}) target_link_libraries(arrow_odbc_spi_impl - PUBLIC arrow_flight_sql_static arrow_compute_static Boost::locale Boost::headers RapidJSON - ) + PUBLIC arrow_flight_sql_static + arrow_compute_static + Boost::locale + Boost::headers + RapidJSON) else() find_package(ODBC REQUIRED) target_include_directories(arrow_odbc_spi_impl PUBLIC ${ODBC_INCLUDE_DIR}) @@ -151,6 +154,15 @@ set_target_properties(arrow_odbc_spi_impl_cli target_link_libraries(arrow_odbc_spi_impl_cli arrow_odbc_spi_impl) # Unit tests +if(WIN32) + set(ODBC_SPI_IMPL_TEST_LINK_LIBS arrow_flight_testing_shared) +else() + # unix + set(ODBC_SPI_IMPL_TEST_LINK_LIBS arrow_flight_testing_static) +endif() + +# On Windows, dynamic linking ODBC is supported. +# On unix systems, static linking ODBC is supported, thus the test linking is different. add_arrow_test(odbc_spi_impl_test SOURCES accessors/boolean_array_accessor_test.cc @@ -169,4 +181,4 @@ add_arrow_test(odbc_spi_impl_test util_test.cc EXTRA_LINK_LIBS arrow_odbc_spi_impl - arrow_flight_testing_shared) + ${ODBC_SPI_IMPL_TEST_LINK_LIBS}) From aac357d32e2ea64c38db66fe3a70f107be4051d7 Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Wed, 28 Jan 2026 15:11:19 -0800 Subject: [PATCH 14/22] Clean up PR - Remove dummy tests - Remove unneeded changes --- cpp/src/arrow/flight/sql/odbc/CMakeLists.txt | 18 +----- .../flight/sql/odbc/odbc_impl/CMakeLists.txt | 5 +- .../flight/sql/odbc/tests/CMakeLists.txt | 64 +++++++++---------- .../flight/sql/odbc/tests/connection_test.cc | 6 -- 4 files changed, 35 insertions(+), 58 deletions(-) diff --git a/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt index 7c3fc238e9b..f52707bbe48 100644 --- a/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt @@ -19,8 +19,6 @@ # GH-44792: Arrow will switch to C++ 20 set(CMAKE_CXX_STANDARD 20) -# add_custom_target(arrow_flight_sql_odbc) # -AL- attempt to create optional arrow_flight_sql_odbc.lib - if(APPLE) # CMAKE_FIND_LIBRARY_SUFFIXES. set(APPEND CMAKE_FIND_LIBRARY_SUFFIXES ".a") @@ -38,8 +36,6 @@ else() set(ODBCINST odbcinst) endif() -message(STATUS "-AL- random msg in odbc cmake") - add_subdirectory(odbc_impl) add_subdirectory(tests) @@ -70,15 +66,8 @@ if(WIN32) list(APPEND ARROW_FLIGHT_SQL_ODBC_SRCS odbc.def install/versioninfo.rc) endif() -# -AL- TODO for ODBC layer, use variables so it's like -# Var = “” -# If windows -# Var append shared lib -# And that it. The end goal should be 1 add_arrow_lib call. - - -# -AL- build dynamically on Windows and statically on Unix systems. -# Might make them both the same if it is easier to maintain? Currently doing it separately to not break ODBC on Windows for now. +# On Windows, dynmaic build for ODBC is supported. +# On unix systems, static build for ODBC is supported, all libraries are linked statically on unix. if(WIN32) add_arrow_lib(arrow_flight_sql_odbc CMAKE_PACKAGE_NAME @@ -107,7 +96,6 @@ if(WIN32) ${ODBCINST}) else() # Unix - # -AL- add comment for static build. Static build is recommended in unix system add_arrow_lib(arrow_flight_sql_odbc CMAKE_PACKAGE_NAME ArrowFlightSqlOdbc @@ -124,7 +112,7 @@ else() STATIC_LINK_LIBS ODBC::ODBC ${ODBCINST} - SHARED_LINK_LIBS #-AL- make odbc calls exported too + SHARED_LINK_LIBS arrow_odbc_spi_impl) 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 e831a79255a..0897248f6ce 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt @@ -154,6 +154,9 @@ set_target_properties(arrow_odbc_spi_impl_cli 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. if(WIN32) set(ODBC_SPI_IMPL_TEST_LINK_LIBS arrow_flight_testing_shared) else() @@ -161,8 +164,6 @@ else() set(ODBC_SPI_IMPL_TEST_LINK_LIBS arrow_flight_testing_static) endif() -# On Windows, dynamic linking ODBC is supported. -# On unix systems, static linking ODBC is supported, thus the test linking is different. add_arrow_test(odbc_spi_impl_test SOURCES accessors/boolean_array_accessor_test.cc diff --git a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt index 39293ff37ec..c48ab71bb0b 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt @@ -32,13 +32,11 @@ set(ARROW_FLIGHT_SQL_MOCK_SERVER_SRCS ../../example/sqlite_tables_schema_batch_reader.cc) if(ARROW_TEST_LINKAGE STREQUAL "static") - set(ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS arrow_flight_sql_odbc_static - ${ARROW_TEST_STATIC_LINK_LIBS} - ) + set(ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS arrow_flight_sql_odbc_static + ${ARROW_TEST_STATIC_LINK_LIBS}) else() set(ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS arrow_flight_sql_odbc_shared - ${ARROW_TEST_SHARED_LINK_LIBS} - ) + ${ARROW_TEST_SHARED_LINK_LIBS}) endif() set(ARROW_FLIGHT_SQL_ODBC_TEST_SRCS @@ -56,40 +54,36 @@ 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) -# -AL- todo write comment: -# On Windows, dynamic linking ODBC is supported. -# On unix systems, static linking ODBC is supported, thus the test linking is different. +# On Windows, dynamic linking ODBC is supported, tests link libraries dynamically. +# On unix systems, static linking ODBC is supported, thus tests link libraries statically. if(WIN32) -add_arrow_test(flight_sql_odbc_test - SOURCES - ${ARROW_FLIGHT_SQL_ODBC_TEST_SRCS} - ${ARROW_FLIGHT_SQL_MOCK_SERVER_SRCS} - DEFINITIONS - UNICODE - EXTRA_LINK_LIBS - ${ODBC_LIBRARIES} - ${ODBCINST} - ${SQLite3_LIBRARIES} - ${ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS} - # arrow_odbc_spi_impl_shared # -AL- -) + add_arrow_test(flight_sql_odbc_test + SOURCES + ${ARROW_FLIGHT_SQL_ODBC_TEST_SRCS} + ${ARROW_FLIGHT_SQL_MOCK_SERVER_SRCS} + DEFINITIONS + UNICODE + EXTRA_LINK_LIBS + ${ODBC_LIBRARIES} + ${ODBCINST} + ${SQLite3_LIBRARIES} + ${ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS}) else() # unix -add_arrow_test(flight_sql_odbc_test - SOURCES - ${ARROW_FLIGHT_SQL_ODBC_TEST_SRCS} - ${ARROW_FLIGHT_SQL_MOCK_SERVER_SRCS} - DEFINITIONS - UNICODE - STATIC_LINK_LIBS - ${ODBC_LIBRARIES} - ${ODBCINST} - ${SQLite3_LIBRARIES} - ${ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS}) -endif() + add_arrow_test(flight_sql_odbc_test + SOURCES + ${ARROW_FLIGHT_SQL_ODBC_TEST_SRCS} + ${ARROW_FLIGHT_SQL_MOCK_SERVER_SRCS} + DEFINITIONS + UNICODE + STATIC_LINK_LIBS + ${ODBC_LIBRARIES} + ${ODBCINST} + ${SQLite3_LIBRARIES} + ${ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS}) +endif() # Disable unity build due to sqlite_sql_info.cc conflict with sql.h and sqlext.h headers. set_target_properties(arrow-flight-sql-odbc-test PROPERTIES UNITY_BUILD OFF) diff --git a/cpp/src/arrow/flight/sql/odbc/tests/connection_test.cc b/cpp/src/arrow/flight/sql/odbc/tests/connection_test.cc index 08ea643d777..3ca4a50ef76 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/connection_test.cc +++ b/cpp/src/arrow/flight/sql/odbc/tests/connection_test.cc @@ -469,12 +469,6 @@ TYPED_TEST(ConnectionTest, TestConnect) { // Verifies connect and disconnect works on its own } -// -AL- dummy test without using ODBC passed without double registration issue -TEST(DummyTest, AlinaDummyTest) { - bool boolvar = true; - EXPECT_EQ(boolvar, true); -} - TYPED_TEST(ConnectionTest, TestSQLAllocFreeStmt) { SQLHSTMT statement; From c1de9c8118ecba9f5a777a221eb248b5a7f99bb2 Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Wed, 28 Jan 2026 15:37:51 -0800 Subject: [PATCH 15/22] Revert "Test ODBC CI - to be reverted" This reverts commit 711b3e0863ebbf5fe2c5cb1401fbaf72eed58aa4. --- .github/workflows/cpp_extra.yml | 490 ++++++++++++++++---------------- 1 file changed, 245 insertions(+), 245 deletions(-) diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index bbeef163afc..451acfd594b 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -91,250 +91,250 @@ jobs: with: parent-workflow: cpp_extra - # docker: - # needs: check-labels - # name: ${{ matrix.title }} - # runs-on: ${{ matrix.runs-on }} - # if: >- - # needs.check-labels.outputs.force == 'true' || - # contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') || - # contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++') - # timeout-minutes: 75 - # strategy: - # fail-fast: false - # matrix: - # include: - # - image: alpine-linux-cpp - # runs-on: ubuntu-latest - # title: AMD64 Alpine Linux - # - image: conda-cpp - # run-options: >- - # -e ARROW_USE_MESON=ON - # runs-on: ubuntu-latest - # title: AMD64 Ubuntu Meson - # # TODO: We should remove this "continue-on-error: true" once GH-47207 is resolved - # - continue-on-error: true - # envs: - # - DEBIAN=13 - # image: debian-cpp - # run-options: >- - # -e CMAKE_CXX_STANDARD=23 - # runs-on: ubuntu-latest - # title: AMD64 Debian C++23 - # env: - # ARCHERY_DEBUG: 1 - # ARROW_ENABLE_TIMING_TESTS: OFF - # DOCKER_VOLUME_PREFIX: ".docker/" - # steps: - # - name: Checkout Arrow - # uses: actions/checkout@v6 - # with: - # fetch-depth: 0 - # submodules: recursive - # - name: Cache Docker Volumes - # uses: actions/cache@v5 - # with: - # path: .docker - # key: extra-${{ matrix.image }}-${{ hashFiles('cpp/**') }} - # restore-keys: extra-${{ matrix.image }}- - # - name: Setup Python - # uses: actions/setup-python@v6 - # with: - # python-version: 3 - # - name: Setup Archery - # run: python3 -m pip install -e dev/archery[docker] - # - name: Execute Docker Build - # continue-on-error: ${{ matrix.continue-on-error || false }} - # env: - # ARCHERY_DOCKER_USER: ${{ secrets.DOCKERHUB_USER }} - # ARCHERY_DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} - # ENVS: ${{ toJSON(matrix.envs) }} - # run: | - # # GH-40558: reduce ASLR to avoid ASAN/LSAN crashes - # sudo sysctl -w vm.mmap_rnd_bits=28 - # source ci/scripts/util_enable_core_dumps.sh - # if [ "${ENVS}" != "null" ]; then - # echo "${ENVS}" | jq -r '.[]' | while read env; do - # echo "${env}" >> .env - # done - # fi - # archery docker run ${{ matrix.run-options || '' }} ${{ matrix.image }} - # - name: Docker Push - # if: >- - # success() && - # github.event_name == 'push' && - # github.repository == 'apache/arrow' && - # github.ref_name == 'main' - # env: - # ARCHERY_DOCKER_USER: ${{ secrets.DOCKERHUB_USER }} - # ARCHERY_DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} - # continue-on-error: true - # run: archery docker push ${{ matrix.image }} + docker: + needs: check-labels + name: ${{ matrix.title }} + runs-on: ${{ matrix.runs-on }} + if: >- + needs.check-labels.outputs.force == 'true' || + contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') || + contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++') + timeout-minutes: 75 + strategy: + fail-fast: false + matrix: + include: + - image: alpine-linux-cpp + runs-on: ubuntu-latest + title: AMD64 Alpine Linux + - image: conda-cpp + run-options: >- + -e ARROW_USE_MESON=ON + runs-on: ubuntu-latest + title: AMD64 Ubuntu Meson + # TODO: We should remove this "continue-on-error: true" once GH-47207 is resolved + - continue-on-error: true + envs: + - DEBIAN=13 + image: debian-cpp + run-options: >- + -e CMAKE_CXX_STANDARD=23 + runs-on: ubuntu-latest + title: AMD64 Debian C++23 + env: + ARCHERY_DEBUG: 1 + ARROW_ENABLE_TIMING_TESTS: OFF + DOCKER_VOLUME_PREFIX: ".docker/" + steps: + - name: Checkout Arrow + uses: actions/checkout@v6 + with: + fetch-depth: 0 + submodules: recursive + - name: Cache Docker Volumes + uses: actions/cache@v5 + with: + path: .docker + key: extra-${{ matrix.image }}-${{ hashFiles('cpp/**') }} + restore-keys: extra-${{ matrix.image }}- + - name: Setup Python + uses: actions/setup-python@v6 + with: + python-version: 3 + - name: Setup Archery + run: python3 -m pip install -e dev/archery[docker] + - name: Execute Docker Build + continue-on-error: ${{ matrix.continue-on-error || false }} + env: + ARCHERY_DOCKER_USER: ${{ secrets.DOCKERHUB_USER }} + ARCHERY_DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + ENVS: ${{ toJSON(matrix.envs) }} + run: | + # GH-40558: reduce ASLR to avoid ASAN/LSAN crashes + sudo sysctl -w vm.mmap_rnd_bits=28 + source ci/scripts/util_enable_core_dumps.sh + if [ "${ENVS}" != "null" ]; then + echo "${ENVS}" | jq -r '.[]' | while read env; do + echo "${env}" >> .env + done + fi + archery docker run ${{ matrix.run-options || '' }} ${{ matrix.image }} + - name: Docker Push + if: >- + success() && + github.event_name == 'push' && + github.repository == 'apache/arrow' && + github.ref_name == 'main' + env: + ARCHERY_DOCKER_USER: ${{ secrets.DOCKERHUB_USER }} + ARCHERY_DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + continue-on-error: true + run: archery docker push ${{ matrix.image }} - # msvc-arm64: - # needs: check-labels - # if: >- - # needs.check-labels.outputs.force == 'true' || - # contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') || - # contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++') - # name: ARM64 Windows 11 MSVC - # uses: ./.github/workflows/cpp_windows.yml - # with: - # arch: arm64 - # os: windows-11-arm - # simd-level: NONE + msvc-arm64: + needs: check-labels + if: >- + needs.check-labels.outputs.force == 'true' || + contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') || + contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++') + name: ARM64 Windows 11 MSVC + uses: ./.github/workflows/cpp_windows.yml + with: + arch: arm64 + os: windows-11-arm + simd-level: NONE - # jni-linux: - # needs: check-labels - # name: JNI ${{ matrix.platform.runs-on }} ${{ matrix.platform.arch }} - # runs-on: ${{ matrix.platform.runs-on }} - # if: >- - # needs.check-labels.outputs.force == 'true' || - # contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') || - # contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++') - # timeout-minutes: 240 - # permissions: - # # This is for using GitHub Packages for vcpkg cache - # packages: write - # strategy: - # fail-fast: false - # matrix: - # platform: - # - arch: "amd64" - # runs-on: ubuntu-latest - # - arch: "arm64v8" - # runs-on: ubuntu-24.04-arm - # env: - # ARCH: ${{ matrix.platform.arch }} - # REPO: ghcr.io/${{ github.repository }}-dev - # steps: - # - name: Checkout Arrow - # uses: actions/checkout@v6 - # with: - # fetch-depth: 0 - # submodules: recursive - # - name: Free up disk space - # run: | - # ci/scripts/util_free_space.sh - # - name: Cache Docker Volumes - # uses: actions/cache@v5 - # with: - # path: .docker - # key: jni-${{ matrix.platform.runs-on }}-${{ hashFiles('cpp/**') }} - # restore-keys: jni-${{ matrix.platform.runs-on }}- - # - name: Setup Python - # uses: actions/setup-python@v6 - # with: - # python-version: 3 - # - name: Setup Archery - # run: python3 -m pip install -e dev/archery[docker] - # - name: Execute Docker Build - # env: - # ARCHERY_DOCKER_USER: ${{ github.actor }} - # ARCHERY_DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,readwrite" - # run: | - # source ci/scripts/util_enable_core_dumps.sh - # archery docker run cpp-jni - # - name: Docker Push - # if: >- - # success() && - # github.event_name == 'push' && - # github.ref_name == 'main' - # env: - # ARCHERY_DOCKER_USER: ${{ github.actor }} - # ARCHERY_DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }} - # continue-on-error: true - # run: archery docker push cpp-jni + jni-linux: + needs: check-labels + name: JNI ${{ matrix.platform.runs-on }} ${{ matrix.platform.arch }} + runs-on: ${{ matrix.platform.runs-on }} + if: >- + needs.check-labels.outputs.force == 'true' || + contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') || + contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++') + timeout-minutes: 240 + permissions: + # This is for using GitHub Packages for vcpkg cache + packages: write + strategy: + fail-fast: false + matrix: + platform: + - arch: "amd64" + runs-on: ubuntu-latest + - arch: "arm64v8" + runs-on: ubuntu-24.04-arm + env: + ARCH: ${{ matrix.platform.arch }} + REPO: ghcr.io/${{ github.repository }}-dev + steps: + - name: Checkout Arrow + uses: actions/checkout@v6 + with: + fetch-depth: 0 + submodules: recursive + - name: Free up disk space + run: | + ci/scripts/util_free_space.sh + - name: Cache Docker Volumes + uses: actions/cache@v5 + with: + path: .docker + key: jni-${{ matrix.platform.runs-on }}-${{ hashFiles('cpp/**') }} + restore-keys: jni-${{ matrix.platform.runs-on }}- + - name: Setup Python + uses: actions/setup-python@v6 + with: + python-version: 3 + - name: Setup Archery + run: python3 -m pip install -e dev/archery[docker] + - name: Execute Docker Build + env: + ARCHERY_DOCKER_USER: ${{ github.actor }} + ARCHERY_DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,readwrite" + run: | + source ci/scripts/util_enable_core_dumps.sh + archery docker run cpp-jni + - name: Docker Push + if: >- + success() && + github.event_name == 'push' && + github.ref_name == 'main' + env: + ARCHERY_DOCKER_USER: ${{ github.actor }} + ARCHERY_DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }} + continue-on-error: true + run: archery docker push cpp-jni - # jni-macos: - # needs: check-labels - # name: JNI macOS - # runs-on: macos-14 - # if: >- - # needs.check-labels.outputs.force == 'true' || - # contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') || - # contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++') - # timeout-minutes: 45 - # env: - # MACOSX_DEPLOYMENT_TARGET: "14.0" - # steps: - # - name: Checkout Arrow - # uses: actions/checkout@v6 - # with: - # fetch-depth: 0 - # submodules: recursive - # - name: Install dependencies - # run: | - # brew bundle --file=cpp/Brewfile - # # We want to link aws-sdk-cpp statically but Homebrew's - # # aws-sdk-cpp provides only shared library. If we have - # # Homebrew's aws-sdk-cpp, our build mix Homebrew's - # # aws-sdk-cpp and bundled aws-sdk-cpp. We uninstall Homebrew's - # # aws-sdk-cpp to ensure using only bundled aws-sdk-cpp. - # brew uninstall aws-sdk-cpp - # # We want to use bundled RE2 for static linking. If - # # Homebrew's RE2 is installed, its header file may be used. - # # We uninstall Homebrew's RE2 to ensure using bundled RE2. - # brew uninstall grpc || : # gRPC depends on RE2 - # brew uninstall grpc@1.54 || : # gRPC 1.54 may be installed too - # brew uninstall re2 - # # We want to use bundled Protobuf for static linking. If - # # Homebrew's Protobuf is installed, its library file may be - # # used on test We uninstall Homebrew's Protobuf to ensure using - # # bundled Protobuf. - # brew uninstall protobuf - # - name: Prepare ccache - # run: | - # echo "CCACHE_DIR=${PWD}/ccache" >> ${GITHUB_ENV} - # - name: Cache ccache - # uses: actions/cache@v5 - # with: - # path: ccache - # key: jni-macos-${{ hashFiles('cpp/**') }} - # restore-keys: jni-macos- - # - name: CMake - # run: | - # cmake \ - # -S cpp \ - # -B cpp.build \ - # --preset=ninja-release-jni-macos \ - # -DARROW_BUILD_TESTS=ON \ - # -DCMAKE_INSTALL_PREFIX=$PWD/cpp.install - # - name: Build - # run: | - # cmake --build cpp.build - # - name: Install - # run: | - # cmake --install cpp.build - # - name: Test - # env: - # ARROW_TEST_DATA: ${{ github.workspace }}/testing/data - # PARQUET_TEST_DATA: ${{ github.workspace }}/cpp/submodules/parquet-testing/data - # run: | - # # MinIO is required - # exclude_tests="arrow-s3fs-test" - # # unstable - # exclude_tests="${exclude_tests}|arrow-acero-asof-join-node-test" - # exclude_tests="${exclude_tests}|arrow-acero-hash-join-node-test" - # ctest \ - # --exclude-regex "${exclude_tests}" \ - # --label-regex unittest \ - # --output-on-failure \ - # --parallel "$(sysctl -n hw.ncpu)" \ - # --test-dir "cpp.build" \ - # --timeout 300 - # - name: Build example - # run: | - # cmake \ - # -S cpp/examples/minimal_build/ \ - # -B cpp/examples/minimal_build.build \ - # -GNinja \ - # -DCMAKE_INSTALL_PREFIX=$PWD/cpp.install - # cmake --build cpp/examples/minimal_build.build - # cd cpp/examples/minimal_build - # ../minimal_build.build/arrow-example + jni-macos: + needs: check-labels + name: JNI macOS + runs-on: macos-14 + if: >- + needs.check-labels.outputs.force == 'true' || + contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') || + contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++') + timeout-minutes: 45 + env: + MACOSX_DEPLOYMENT_TARGET: "14.0" + steps: + - name: Checkout Arrow + uses: actions/checkout@v6 + with: + fetch-depth: 0 + submodules: recursive + - name: Install dependencies + run: | + brew bundle --file=cpp/Brewfile + # We want to link aws-sdk-cpp statically but Homebrew's + # aws-sdk-cpp provides only shared library. If we have + # Homebrew's aws-sdk-cpp, our build mix Homebrew's + # aws-sdk-cpp and bundled aws-sdk-cpp. We uninstall Homebrew's + # aws-sdk-cpp to ensure using only bundled aws-sdk-cpp. + brew uninstall aws-sdk-cpp + # We want to use bundled RE2 for static linking. If + # Homebrew's RE2 is installed, its header file may be used. + # We uninstall Homebrew's RE2 to ensure using bundled RE2. + brew uninstall grpc || : # gRPC depends on RE2 + brew uninstall grpc@1.54 || : # gRPC 1.54 may be installed too + brew uninstall re2 + # We want to use bundled Protobuf for static linking. If + # Homebrew's Protobuf is installed, its library file may be + # used on test We uninstall Homebrew's Protobuf to ensure using + # bundled Protobuf. + brew uninstall protobuf + - name: Prepare ccache + run: | + echo "CCACHE_DIR=${PWD}/ccache" >> ${GITHUB_ENV} + - name: Cache ccache + uses: actions/cache@v5 + with: + path: ccache + key: jni-macos-${{ hashFiles('cpp/**') }} + restore-keys: jni-macos- + - name: CMake + run: | + cmake \ + -S cpp \ + -B cpp.build \ + --preset=ninja-release-jni-macos \ + -DARROW_BUILD_TESTS=ON \ + -DCMAKE_INSTALL_PREFIX=$PWD/cpp.install + - name: Build + run: | + cmake --build cpp.build + - name: Install + run: | + cmake --install cpp.build + - name: Test + env: + ARROW_TEST_DATA: ${{ github.workspace }}/testing/data + PARQUET_TEST_DATA: ${{ github.workspace }}/cpp/submodules/parquet-testing/data + run: | + # MinIO is required + exclude_tests="arrow-s3fs-test" + # unstable + exclude_tests="${exclude_tests}|arrow-acero-asof-join-node-test" + exclude_tests="${exclude_tests}|arrow-acero-hash-join-node-test" + ctest \ + --exclude-regex "${exclude_tests}" \ + --label-regex unittest \ + --output-on-failure \ + --parallel "$(sysctl -n hw.ncpu)" \ + --test-dir "cpp.build" \ + --timeout 300 + - name: Build example + run: | + cmake \ + -S cpp/examples/minimal_build/ \ + -B cpp/examples/minimal_build.build \ + -GNinja \ + -DCMAKE_INSTALL_PREFIX=$PWD/cpp.install + cmake --build cpp/examples/minimal_build.build + cd cpp/examples/minimal_build + ../minimal_build.build/arrow-example odbc-macos: needs: check-labels @@ -576,10 +576,10 @@ jobs: report-extra-cpp: if: github.event_name == 'schedule' && always() needs: - # - docker - # - jni-linux - # - jni-macos - # - msvc-arm64 + - docker + - jni-linux + - jni-macos + - msvc-arm64 - odbc-macos - odbc-msvc uses: ./.github/workflows/report_ci.yml From 10bf3495b471555862895362368350adf1930031 Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Wed, 28 Jan 2026 15:38:34 -0800 Subject: [PATCH 16/22] Remove unneeded code --- .github/workflows/cpp_extra.yml | 8 +- cpp/cmake_modules/BuildUtils.cmake | 9 - cpp/cmake_modules/ThirdpartyToolchain.cmake | 4 - .../sql/odbc/odbc_impl/CMakeLists-backup.txt | 229 ------------------ .../flight/sql/odbc/tests/temp_odbc_test.cc | 38 --- 5 files changed, 2 insertions(+), 286 deletions(-) delete mode 100644 cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists-backup.txt delete mode 100644 cpp/src/arrow/flight/sql/odbc/tests/temp_odbc_test.cc diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index 451acfd594b..48b6ba7660a 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -478,12 +478,8 @@ jobs: uses: actions/cache@v5 with: path: ${{ steps.ccache-info.outputs.cache-dir }} - key: cpp-odbc-ccache-windows-x64-${{ env.CACHE_VERSION }}-${{ hashFiles('cpp/**') }} - restore-keys: cpp-odbc-ccache-windows-x64-${{ env.CACHE_VERSION }}- - env: - # -AL- if needed, can invalidate current cache after resolving Windows build. Can remove this code in PR if not needed - # We can invalidate the current cache by updating this. - CACHE_VERSION: "2026-01-21" + key: cpp-odbc-ccache-windows-x64-${{ hashFiles('cpp/**') }} + restore-keys: cpp-odbc-ccache-windows-x64- - name: Checkout vcpkg uses: actions/checkout@v6 with: diff --git a/cpp/cmake_modules/BuildUtils.cmake b/cpp/cmake_modules/BuildUtils.cmake index 874afbebf4f..db760400f7c 100644 --- a/cpp/cmake_modules/BuildUtils.cmake +++ b/cpp/cmake_modules/BuildUtils.cmake @@ -220,10 +220,6 @@ function(ADD_ARROW_LIB LIB_NAME) message(SEND_ERROR "Error: unrecognized arguments: ${ARG_UNPARSED_ARGUMENTS}") endif() - if("${LIB_NAME}" MATCHES "odbc") - message(STATUS "-AL- LIB_NAME contains odbc (arrow flight sql odbc): ${LIB_NAME}") - endif() - if(ARG_OUTPUTS) set(${ARG_OUTPUTS}) endif() @@ -323,8 +319,6 @@ function(ADD_ARROW_LIB LIB_NAME) endif() if(BUILD_SHARED) - message(STATUS "-AL- LIB_DEPS:${LIB_DEPS}, EXTRA_DEPS: ${EXTRA_DEPS}" - ) add_library(${LIB_NAME}_shared SHARED ${LIB_DEPS}) if(EXTRA_DEPS) add_dependencies(${LIB_NAME}_shared ${EXTRA_DEPS}) @@ -370,8 +364,6 @@ function(ADD_ARROW_LIB LIB_NAME) VERSION "${ARROW_FULL_SO_VERSION}" SOVERSION "${ARROW_SO_VERSION}") - message(STATUS "-AL- ARG_SHARED_LINK_LIBS:${ARG_SHARED_LINK_LIBS}, ARG_SHARED_INSTALL_INTERFACE_LIBS: ${ARG_SHARED_INSTALL_INTERFACE_LIBS}, ARG_SHARED_PRIVATE_LINK_LIBS: ${ARG_SHARED_PRIVATE_LINK_LIBS}" - ) target_link_libraries(${LIB_NAME}_shared PUBLIC "$" "$" @@ -727,7 +719,6 @@ function(ADD_TEST_CASE REL_TEST_NAME) # Customize link libraries target_link_libraries(${TEST_NAME} PRIVATE ${ARG_STATIC_LINK_LIBS}) else() - message(STATUS "-AL- ARROW_TEST_LINK_LIBS: ${ARROW_TEST_LINK_LIBS}") target_link_libraries(${TEST_NAME} PRIVATE ${ARROW_TEST_LINK_LIBS}) endif() diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index a870894c289..67bcdbbeede 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -41,8 +41,6 @@ set(ARROW_RE2_LINKAGE # ---------------------------------------------------------------------- # Resolve the dependencies -# -AL- I believe this is the place where gRPC is linked. (or somewhere else related) - set(ARROW_THIRDPARTY_DEPENDENCIES absl AWSSDK @@ -1109,7 +1107,6 @@ function(build_boost) else() list(APPEND BOOST_EXCLUDE_LIBRARIES uuid) endif() - #-al- Add ODBC-specific dependencies if(ARROW_FLIGHT_SQL_ODBC) list(APPEND BOOST_INCLUDE_LIBRARIES beast xpressive) else() @@ -3029,7 +3026,6 @@ function(build_cares) set(CARES_BUILD_TOOLS OFF) fetchcontent_makeavailable(cares) - # -AL- getting issue here. Resolved issue on macOS Intel with `c-ares` if(APPLE) # libresolv must be linked from c-ares version 1.16.1 find_library(LIBRESOLV_LIBRARY NAMES resolv libresolv REQUIRED) diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists-backup.txt b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists-backup.txt deleted file mode 100644 index be4f42aed0e..00000000000 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists-backup.txt +++ /dev/null @@ -1,229 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# -AL- TODO try to create a arrow_odbc_spi_impl_static/shared static build AND shared build. -# The ODBC driver can still link to static build as before on unix, and test can link to the shared build. - -set(ARROW_ODBC_SPI_IMPL_SOURCES accessors/binary_array_accessor.cc - accessors/binary_array_accessor.h - accessors/boolean_array_accessor.cc - accessors/boolean_array_accessor.h - accessors/common.h - accessors/date_array_accessor.cc - accessors/date_array_accessor.h - accessors/decimal_array_accessor.cc - accessors/decimal_array_accessor.h - accessors/primitive_array_accessor.cc - accessors/primitive_array_accessor.h - accessors/string_array_accessor.cc - accessors/string_array_accessor.h - accessors/time_array_accessor.cc - accessors/time_array_accessor.h - accessors/timestamp_array_accessor.cc - accessors/timestamp_array_accessor.h - address_info.cc - address_info.h - attribute_utils.h - blocking_queue.h - calendar_utils.cc - calendar_utils.h - config/configuration.cc - config/configuration.h - config/connection_string_parser.cc - config/connection_string_parser.h - diagnostics.cc - diagnostics.h - encoding.cc - encoding.h - encoding_utils.h - error_codes.h - exceptions.cc - exceptions.h - flight_sql_auth_method.cc - flight_sql_auth_method.h - flight_sql_connection.cc - flight_sql_connection.h - flight_sql_driver.cc - flight_sql_driver.h - flight_sql_get_tables_reader.cc - flight_sql_get_tables_reader.h - flight_sql_get_type_info_reader.cc - flight_sql_get_type_info_reader.h - flight_sql_result_set.cc - flight_sql_result_set.h - flight_sql_result_set_accessors.cc - flight_sql_result_set_accessors.h - flight_sql_result_set_column.cc - flight_sql_result_set_column.h - flight_sql_result_set_metadata.cc - flight_sql_result_set_metadata.h - flight_sql_ssl_config.cc - flight_sql_ssl_config.h - flight_sql_statement.cc - flight_sql_statement.h - flight_sql_statement_get_columns.cc - flight_sql_statement_get_columns.h - flight_sql_statement_get_tables.cc - flight_sql_statement_get_tables.h - flight_sql_statement_get_type_info.cc - flight_sql_statement_get_type_info.h - flight_sql_stream_chunk_buffer.cc - flight_sql_stream_chunk_buffer.h - get_info_cache.cc - get_info_cache.h - json_converter.cc - json_converter.h - odbc_connection.cc - odbc_connection.h - odbc_descriptor.cc - odbc_descriptor.h - odbc_environment.cc - odbc_environment.h - odbc_handle.h - odbc_statement.cc - odbc_statement.h - platform.h - record_batch_transformer.cc - record_batch_transformer.h - scalar_function_reporter.cc - scalar_function_reporter.h - spi/connection.h - spi/driver.h - spi/result_set.h - spi/result_set_metadata.h - spi/statement.h - system_trust_store.cc - system_trust_store.h - types.h - type_utilities.h - util.cc - util.h) - -add_library(arrow_odbc_spi_impl STATIC - ${ARROW_ODBC_SPI_IMPL_SOURCES}) -target_compile_definitions(arrow_odbc_spi_impl PUBLIC UNICODE) -target_include_directories(arrow_odbc_spi_impl PUBLIC include include/odbc_impl) -target_include_directories(arrow_odbc_spi_impl PUBLIC ${CMAKE_CURRENT_LIST_DIR}) - -if(WIN32) -list(APPEND ARROW_ODBC_SPI_IMPL_SOURCES ui/add_property_window.cc - ui/add_property_window.h - ui/custom_window.cc - ui/custom_window.h - ui/dsn_configuration_window.cc - ui/dsn_configuration_window.h - ui/window.cc - ui/window.h - win_system_dsn.cc - system_dsn.cc - system_dsn.h) -endif() - -message(STATUS "-AL- random msg in odbc_impl") - -if(WIN32) - target_link_libraries(arrow_odbc_spi_impl - PUBLIC arrow_flight_sql_shared arrow_compute_shared Boost::locale - ${ODBCINST}) -else() - # unix - - # find_package(Arrow REQUIRED) #-AL- tried this line for static linking, but it doesn't work because when we build - # `arrow_odbc_spi_impl`, we are still in the process of building the Arrow library - - # message(STATUS "-AL- 2 random msg in odbc_impl 2 ") - # find_dependency(Arrow CONFIG) # -AL- new issue: Could NOT find Arrow (missing: Arrow_DIR) error - # message(STATUS "-AL- 3 random msg in odbc_impl 3") - # find_dependency(ArrowCompute CONFIG) - - # -AL- if I can link arrow_odbc_spi_impl with static libs, I will begin to understand how it works. - # (it is also possible that both ODBC and `flightsql-odbc` are needed to be statically linking to work) - target_link_libraries(arrow_odbc_spi_impl - # -AL- shared libs are required for linking to work properly. - # -AL- used to switch to `_static` when shared libraries are turned off. - # Requires `find_package(Arrow REQUIRED)` so it won't work. - # PUBLIC Arrow::arrow_flight_sql_static ArrowCompute::arrow_compute_static - # -AL- below is the format used by ARROW_EXAMPLE_LINK_LIBS example. - PUBLIC arrow_flight_sql_static - arrow_compute_static - Boost::locale - Boost::headers - RapidJSON) -endif() - -set_target_properties(arrow_odbc_spi_impl - PROPERTIES ARCHIVE_OUTPUT_DIRECTORY - ${CMAKE_BINARY_DIR}/$/lib - LIBRARY_OUTPUT_DIRECTORY - ${CMAKE_BINARY_DIR}/$/lib - RUNTIME_OUTPUT_DIRECTORY - ${CMAKE_BINARY_DIR}/$/lib) - -# CLI -add_executable(arrow_odbc_spi_impl_cli main.cc) -set_target_properties(arrow_odbc_spi_impl_cli - PROPERTIES RUNTIME_OUTPUT_DIRECTORY - ${CMAKE_BINARY_DIR}/$/bin) -target_link_libraries(arrow_odbc_spi_impl_cli arrow_odbc_spi_impl) - -# Unit tests -# if(WIN32) -add_arrow_test(odbc_spi_impl_test - SOURCES - accessors/boolean_array_accessor_test.cc - accessors/binary_array_accessor_test.cc - accessors/date_array_accessor_test.cc - accessors/decimal_array_accessor_test.cc - accessors/primitive_array_accessor_test.cc - accessors/string_array_accessor_test.cc - accessors/time_array_accessor_test.cc - accessors/timestamp_array_accessor_test.cc - flight_sql_connection_test.cc - flight_sql_stream_chunk_buffer_test.cc - parse_table_types_test.cc - json_converter_test.cc - record_batch_transformer_test.cc - util_test.cc - EXTRA_LINK_LIBS - arrow_odbc_spi_impl - arrow_flight_testing_shared) -# Using below code causes build issues -# else() -# # Unix -# # Link Arrow libs statically on Unix for unit tests -# #-AL- nicer way to do it might be like example in cpp/src/arrow/c/CMakeLists.txt -# add_arrow_test(odbc_spi_impl_test -# SOURCES -# accessors/boolean_array_accessor_test.cc -# accessors/binary_array_accessor_test.cc -# accessors/date_array_accessor_test.cc -# accessors/decimal_array_accessor_test.cc -# accessors/primitive_array_accessor_test.cc -# accessors/string_array_accessor_test.cc -# accessors/time_array_accessor_test.cc -# accessors/timestamp_array_accessor_test.cc -# flight_sql_connection_test.cc -# flight_sql_stream_chunk_buffer_test.cc -# parse_table_types_test.cc -# json_converter_test.cc -# record_batch_transformer_test.cc -# util_test.cc -# EXTRA_LINK_LIBS -# arrow_odbc_spi_impl -# STATIC_LINK_LIBS -# arrow_flight_testing_static) -# endif() diff --git a/cpp/src/arrow/flight/sql/odbc/tests/temp_odbc_test.cc b/cpp/src/arrow/flight/sql/odbc/tests/temp_odbc_test.cc deleted file mode 100644 index 091e7cdefa4..00000000000 --- a/cpp/src/arrow/flight/sql/odbc/tests/temp_odbc_test.cc +++ /dev/null @@ -1,38 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -// #include "arrow/flight/sql/odbc/odbc_impl/platform.h" - -// #include -// #include -// #include - -#include - -namespace arrow::flight::sql::odbc { - -TEST(TEMP, DUMMY) { - int x = 1; - ASSERT_EQ(1, x); -} - -TEST(TEMP, DUMMYFails) { - int x = 1; - ASSERT_EQ(2, x); -} - -} // namespace arrow::flight::sql::odbc From 64fe7f92f5aa4184c692b400d0b300be6c1953ee Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Wed, 28 Jan 2026 15:43:27 -0800 Subject: [PATCH 17/22] Attempt to revert c-ares change --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 67bcdbbeede..119ade1839f 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -3029,12 +3029,12 @@ function(build_cares) if(APPLE) # libresolv must be linked from c-ares version 1.16.1 find_library(LIBRESOLV_LIBRARY NAMES resolv libresolv REQUIRED) - # set_target_properties(c-ares::cares PROPERTIES INTERFACE_LINK_LIBRARIES - # "${LIBRESOLV_LIBRARY}") + set_target_properties(c-ares::cares PROPERTIES INTERFACE_LINK_LIBRARIES + "${LIBRESOLV_LIBRARY}") # -AL- Changed to below code to get pass # `set_target_properties can not be used on an ALIAS target.` error. - set_target_properties(c-ares PROPERTIES INTERFACE_LINK_LIBRARIES - "${LIBRESOLV_LIBRARY}") + # set_target_properties(c-ares PROPERTIES INTERFACE_LINK_LIBRARIES + # "${LIBRESOLV_LIBRARY}") endif() set(ARROW_BUNDLED_STATIC_LIBS From 7ed2f88a986c160ed1f39359d9333d548091b36b Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Thu, 29 Jan 2026 10:12:34 -0800 Subject: [PATCH 18/22] Fix `set_target_properties can not be used on an ALIAS target.` error. Example of failed run in forked repo: https://github.com/Bit-Quill/arrow/actions/runs/21459770235/job/61809740997?pr=153#step:7:540 --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 119ade1839f..3108374ff42 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -3029,12 +3029,8 @@ function(build_cares) if(APPLE) # libresolv must be linked from c-ares version 1.16.1 find_library(LIBRESOLV_LIBRARY NAMES resolv libresolv REQUIRED) - set_target_properties(c-ares::cares PROPERTIES INTERFACE_LINK_LIBRARIES - "${LIBRESOLV_LIBRARY}") - # -AL- Changed to below code to get pass - # `set_target_properties can not be used on an ALIAS target.` error. - # set_target_properties(c-ares PROPERTIES INTERFACE_LINK_LIBRARIES - # "${LIBRESOLV_LIBRARY}") + set_target_properties(c-ares PROPERTIES INTERFACE_LINK_LIBRARIES + "${LIBRESOLV_LIBRARY}") endif() set(ARROW_BUNDLED_STATIC_LIBS From 87cfd5602275290877fdabc8b98fba4655f2cbe7 Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Thu, 29 Jan 2026 16:31:21 -0800 Subject: [PATCH 19/22] Fix descriptor pointer tests on static macOS --- .../sql/odbc/tests/statement_attr_test.cc | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/cpp/src/arrow/flight/sql/odbc/tests/statement_attr_test.cc b/cpp/src/arrow/flight/sql/odbc/tests/statement_attr_test.cc index ac2cbb79864..07d309fa9f5 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/statement_attr_test.cc +++ b/cpp/src/arrow/flight/sql/odbc/tests/statement_attr_test.cc @@ -480,26 +480,25 @@ TYPED_TEST(StatementAttributeTest, TestSQLSetStmtAttrFetchBookmarkPointer) { TYPED_TEST(StatementAttributeTest, TestSQLSetStmtAttrIMPParamDesc) { // Invalid use of an automatically allocated descriptor handle ValidateSetStmtAttrErrorCode(this->stmt, SQL_ATTR_IMP_PARAM_DESC, - static_cast(0), + static_cast(0), SQL_ERROR, #ifdef __APPLE__ - // iODBC on MacOS returns SQL_INVALID_HANDLE for this case - SQL_INVALID_HANDLE, + // static iODBC on MacOS returns IM001 for this case + kErrorStateIM001); #else - SQL_ERROR, -#endif kErrorStateHY017); +#endif // __APPLE__ } TYPED_TEST(StatementAttributeTest, TestSQLSetStmtAttrIMPRowDesc) { // Invalid use of an automatically allocated descriptor handle ValidateSetStmtAttrErrorCode(this->stmt, SQL_ATTR_IMP_ROW_DESC, static_cast(0), + SQL_ERROR, #ifdef __APPLE__ - // iODBC on MacOS returns SQL_INVALID_HANDLE for this case - SQL_INVALID_HANDLE, + // static iODBC on MacOS returns IM001 for this case + kErrorStateIM001); #else - SQL_ERROR, -#endif kErrorStateHY017); +#endif // __APPLE__ } TYPED_TEST(StatementAttributeTest, TestSQLSetStmtAttrKeysetSizeUnsupported) { From 89466c0c61fc4ef95d30d3305da2108b8ab622de Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Thu, 29 Jan 2026 17:44:13 -0800 Subject: [PATCH 20/22] Fix mimalloc issue Fixes issue: ``` mimalloc: assertion failed: at "arrow/cpp/debug-build/mimalloc_ep-prefix/src/mimalloc_ep/include/mimalloc/internal.h":658, _mi_ptr_page assertion: "p==NULL || mi_is_in_heap_region(p)" zsh: abort debug/arrow-flight-sql-odbc-test ``` --- .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 48b6ba7660a..d443c2c1823 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -359,6 +359,7 @@ jobs: ARROW_HOME: /tmp/local ARROW_DEPENDENCY_USE_SHARED: OFF ARROW_DEPENDENCY_SOURCE: BUNDLED + ARROW_MIMALLOC: OFF CMAKE_CXX_STANDARD: "20" steps: - name: Checkout Arrow From d3c0914aeb894c5458418a8e68d851ae39f1d48b Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Tue, 3 Feb 2026 10:58:22 -0800 Subject: [PATCH 21/22] Enable ODBC tests for static build --- .github/workflows/cpp_extra.yml | 4 ++++ ci/scripts/cpp_test.sh | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index d443c2c1823..8060681faa8 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -411,6 +411,10 @@ jobs: export ODBC_INCLUDE_DIR=$LIBIODBC_DIR/include export CXXFLAGS="$CXXFLAGS -I$ODBC_INCLUDE_DIR" ci/scripts/cpp_build.sh $(pwd) $(pwd)/build + - name: Register Flight SQL ODBC Driver + run: | + chmod +x cpp/src/arrow/flight/sql/odbc/install/mac/install_odbc.sh + sudo cpp/src/arrow/flight/sql/odbc/install/mac/install_odbc.sh $(pwd)/build/cpp/debug/libarrow_flight_sql_odbc.dylib - name: Test shell: bash run: | diff --git a/ci/scripts/cpp_test.sh b/ci/scripts/cpp_test.sh index 88239a0bd1e..5d6d5e099ab 100755 --- a/ci/scripts/cpp_test.sh +++ b/ci/scripts/cpp_test.sh @@ -59,7 +59,6 @@ case "$(uname)" in ;; Darwin) n_jobs=$(sysctl -n hw.ncpu) - exclude_tests+=("arrow-flight-sql-odbc-test") # TODO: https://github.com/apache/arrow/issues/40410 exclude_tests+=("arrow-s3fs-test") ;; From 3f098f19a5b1d31c244585c2b6404f4bc8ee1ac5 Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Tue, 3 Feb 2026 12:10:24 -0800 Subject: [PATCH 22/22] Add iodbc link to macOS build on ODBC layer --- cpp/src/arrow/flight/sql/odbc/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt index f52707bbe48..54083948cb1 100644 --- a/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt @@ -110,6 +110,7 @@ else() SHARED_LINK_FLAGS ${ARROW_VERSION_SCRIPT_FLAGS} # Defined in cpp/arrow/CMakeLists.txt STATIC_LINK_LIBS + iodbc ODBC::ODBC ${ODBCINST} SHARED_LINK_LIBS