Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e4b4c69
Link ODBC library statically on unix
alinaliBQ Dec 3, 2025
9288a6f
in-progress changes to accomodate macos CI
alinaliBQ Jan 20, 2026
711b3e0
Test ODBC CI - to be reverted
alinaliBQ Jan 20, 2026
eea27ba
Only install ODBC dependencies in mac
alinaliBQ Jan 21, 2026
f27dad7
Uninstall absl as attempt to resolve build on Intel
alinaliBQ Jan 21, 2026
7b72564
Add C++ standard 20
alinaliBQ Jan 21, 2026
b80234c
Remove absl header from intel
alinaliBQ Jan 21, 2026
51b8526
Use static linking in dependency install step
alinaliBQ Jan 21, 2026
f6efc09
Use bundled boost for static linking
alinaliBQ Jan 22, 2026
27f4573
In-progress Fix Windows build
alinaliBQ Jan 21, 2026
f661478
Fix macOS (after Windows build)
alinaliBQ Jan 23, 2026
2eb9a5d
Remove unneeded ODBC link
alinaliBQ Jan 23, 2026
88c7c96
Fix ODBC double proto issue on macOS
alinaliBQ Jan 23, 2026
aac357d
Clean up PR
alinaliBQ Jan 28, 2026
c1de9c8
Revert "Test ODBC CI - to be reverted"
alinaliBQ Jan 28, 2026
10bf349
Remove unneeded code
alinaliBQ Jan 28, 2026
64fe7f9
Attempt to revert c-ares change
alinaliBQ Jan 28, 2026
7ed2f88
Fix `set_target_properties can not be used on an ALIAS target.` error.
alinaliBQ Jan 29, 2026
87cfd56
Fix descriptor pointer tests on static macOS
alinaliBQ Jan 30, 2026
89466c0
Fix mimalloc issue
alinaliBQ Jan 30, 2026
d3c0914
Enable ODBC tests for static build
alinaliBQ Feb 3, 2026
3f098f1
Add iodbc link to macOS build on ODBC layer
alinaliBQ Feb 3, 2026
b0f11c8
Add iodbc link to macOS build on ODBC Test
alinaliBQ Feb 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/cpp_extra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,10 @@ jobs:
ARROW_BUILD_TESTS: ON
ARROW_FLIGHT_SQL_ODBC: ON
ARROW_HOME: /tmp/local
ARROW_DEPENDENCY_USE_SHARED: OFF
ARROW_DEPENDENCY_SOURCE: BUNDLED
ARROW_MIMALLOC: OFF
CMAKE_CXX_STANDARD: "20"
steps:
- name: Checkout Arrow
uses: actions/checkout@v6.0.0
Expand All @@ -366,6 +370,19 @@ jobs:
- name: Install Dependencies
run: |
brew bundle --file=cpp/Brewfile
# We want to use bundled RE2 for static linking. If

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add some blank lines for readability?

# 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
# We want to use bundled Boost for static linking.
brew uninstall boost
- name: Setup ccache
run: |
ci/scripts/ccache_setup.sh
Expand Down Expand Up @@ -394,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: |
Expand Down Expand Up @@ -427,6 +448,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: |
Expand Down
1 change: 0 additions & 1 deletion ci/scripts/cpp_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")
;;
Expand Down
9 changes: 7 additions & 2 deletions cpp/cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,11 @@ function(build_boost)
else()
list(APPEND BOOST_EXCLUDE_LIBRARIES uuid)
endif()
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)
Expand Down Expand Up @@ -3024,8 +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)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this change, we have failed run with c-ares::cares: https://github.com/Bit-Quill/arrow/actions/runs/21459770235/job/61809740997?pr=153#step:7:540

Fixes error:

CMake Error at cmake_modules/ThirdpartyToolchain.cmake:3032 (set_target_properties):
  set_target_properties can not be used on an ALIAS target.

set_target_properties(c-ares::cares PROPERTIES INTERFACE_LINK_LIBRARIES
"${LIBRESOLV_LIBRARY}")
set_target_properties(c-ares PROPERTIES INTERFACE_LINK_LIBRARIES
"${LIBRESOLV_LIBRARY}")
endif()

set(ARROW_BUNDLED_STATIC_LIBS
Expand Down
82 changes: 55 additions & 27 deletions cpp/src/arrow/flight/sql/odbc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
# 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)
Expand Down Expand Up @@ -61,33 +66,56 @@ 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)
# 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
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
arrow_odbc_spi_impl
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})
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
iodbc
ODBC::ODBC
${ODBCINST}
SHARED_LINK_LIBS
arrow_odbc_spi_impl)
endif()

foreach(LIB_TARGET ${ARROW_FLIGHT_SQL_ODBC_LIBRARIES})
target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_FLIGHT_SQL_ODBC_EXPORTING)
Expand Down
29 changes: 17 additions & 12 deletions cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.

add_library(arrow_odbc_spi_impl
add_library(arrow_odbc_spi_impl STATIC
accessors/binary_array_accessor.cc
accessors/binary_array_accessor.h
accessors/boolean_array_accessor.cc
Expand Down Expand Up @@ -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_shared arrow_compute_shared Boost::locale
iodbc)
PUBLIC arrow_flight_sql_static
arrow_compute_static
Boost::locale
Boost::headers
RapidJSON)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need iodbc anymore?

else()
find_package(ODBC REQUIRED)
target_include_directories(arrow_odbc_spi_impl PUBLIC ${ODBC_INCLUDE_DIR})
Expand All @@ -143,14 +146,6 @@ else()
${ODBCINST})
endif()

set_target_properties(arrow_odbc_spi_impl
PROPERTIES ARCHIVE_OUTPUT_DIRECTORY
${CMAKE_BINARY_DIR}/$<CONFIG>/lib
LIBRARY_OUTPUT_DIRECTORY
${CMAKE_BINARY_DIR}/$<CONFIG>/lib
RUNTIME_OUTPUT_DIRECTORY
${CMAKE_BINARY_DIR}/$<CONFIG>/lib)

# CLI
add_executable(arrow_odbc_spi_impl_cli main.cc)
set_target_properties(arrow_odbc_spi_impl_cli
Expand All @@ -159,6 +154,16 @@ 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()
# unix
set(ODBC_SPI_IMPL_TEST_LINK_LIBS arrow_flight_testing_static)
endif()

add_arrow_test(odbc_spi_impl_test
SOURCES
accessors/boolean_array_accessor_test.cc
Expand All @@ -177,4 +182,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})
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include <string>

#include "config/configuration.h"
#include "arrow/flight/sql/odbc/odbc_impl/config/configuration.h"

namespace arrow::flight::sql::odbc {
namespace config {
Expand Down
1 change: 0 additions & 1 deletion cpp/src/arrow/flight/sql/odbc/odbc_impl/odbc_statement.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include <sql.h>
#include <sqlext.h>
#include <sqltypes.h>
#include <boost/variant.hpp>
#include <optional>
#include <utility>

Expand Down
1 change: 0 additions & 1 deletion cpp/src/arrow/flight/sql/odbc/odbc_impl/spi/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#pragma once

#include <boost/algorithm/string.hpp>
#include <boost/variant.hpp>
#include <functional>
#include <map>
#include <optional>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Windowsx.h>

Expand All @@ -25,8 +25,8 @@
#include <commctrl.h>

#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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <sstream>

#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 {
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/flight/sql/odbc/odbc_impl/ui/custom_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

#pragma once

#include "config/configuration.h"
#include "ui/custom_window.h"
#include "arrow/flight/sql/odbc/odbc_impl/config/configuration.h"
#include "arrow/flight/sql/odbc/odbc_impl/ui/custom_window.h"

namespace arrow::flight::sql::odbc {
namespace config {
Expand Down
1 change: 0 additions & 1 deletion cpp/src/arrow/flight/sql/odbc/odbc_impl/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

#pragma once

#include <boost/variant.hpp>
#include <boost/xpressive/xpressive.hpp>

#include <codecvt>
Expand Down
Loading
Loading