From 600f03a28f7dd933b2f97c2232b8cd58644ec30f Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Wed, 1 Apr 2026 16:41:43 -0700 Subject: [PATCH 1/2] Resolve segfault issue on Linux and pass `ARROW_TEST_LINKAGE=static` Pass `ARROW_TEST_LINKAGE=static` --- ci/scripts/cpp_test.sh | 3 ++- compose.yaml | 1 + cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ci/scripts/cpp_test.sh b/ci/scripts/cpp_test.sh index 2f88cdc819b2..3a9041cf6e7f 100755 --- a/ci/scripts/cpp_test.sh +++ b/ci/scripts/cpp_test.sh @@ -55,7 +55,8 @@ if ! type minio >/dev/null 2>&1; then fi case "$(uname)" in Linux) - exclude_tests+=("arrow-flight-sql-odbc-test") + # -AL- check CI output not segfault right away. + # exclude_tests+=("arrow-flight-sql-odbc-test") n_jobs=$(nproc) ;; Darwin) diff --git a/compose.yaml b/compose.yaml index 513136c86ac9..8f80e7ce2def 100644 --- a/compose.yaml +++ b/compose.yaml @@ -565,6 +565,7 @@ services: ARROW_PARQUET: "OFF" ARROW_S3: "OFF" ARROW_SUBSTRAIT: "OFF" + ARROW_TEST_LINKAGE: "static" # Register ODBC before running tests command: > /bin/bash -c " diff --git a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt index e0e562f2d255..3822e019252d 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt @@ -65,6 +65,12 @@ else() # Unix list(APPEND ARROW_FLIGHT_SQL_ODBC_TEST_STATIC_LINK_LIBS ${ARROW_FLIGHT_SQL_ODBC_TEST_LIBS} ${ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS}) + + if(NOT APPLE) + # Explicitly link to boost on Linux // -AL- trying to make `ARROW_TEST_LINKAGE=static` work. + list(APPEND ARROW_FLIGHT_SQL_ODBC_TEST_STATIC_LINK_LIBS arrow_odbc_spi_impl Boost::headers ${ARROW_PROTOBUF_LIBPROTOBUF}) + endif() + endif() add_arrow_test(flight_sql_odbc_test From 879f1cbf0db34000cdc88d4cab476cca2a2416d7 Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Thu, 2 Apr 2026 10:42:24 -0700 Subject: [PATCH 2/2] Clean up --- ci/scripts/cpp_test.sh | 3 +-- compose.yaml | 1 + cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt | 10 ++++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ci/scripts/cpp_test.sh b/ci/scripts/cpp_test.sh index 3a9041cf6e7f..2f88cdc819b2 100755 --- a/ci/scripts/cpp_test.sh +++ b/ci/scripts/cpp_test.sh @@ -55,8 +55,7 @@ if ! type minio >/dev/null 2>&1; then fi case "$(uname)" in Linux) - # -AL- check CI output not segfault right away. - # exclude_tests+=("arrow-flight-sql-odbc-test") + exclude_tests+=("arrow-flight-sql-odbc-test") n_jobs=$(nproc) ;; Darwin) diff --git a/compose.yaml b/compose.yaml index 8f80e7ce2def..bd417c524e4f 100644 --- a/compose.yaml +++ b/compose.yaml @@ -565,6 +565,7 @@ services: ARROW_PARQUET: "OFF" ARROW_S3: "OFF" ARROW_SUBSTRAIT: "OFF" + # GH-49651 Link ODBC tests statically on Linux to fix segfault ARROW_TEST_LINKAGE: "static" # Register ODBC before running tests command: > diff --git a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt index 3822e019252d..a0e8685b63fc 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt @@ -42,6 +42,7 @@ set(ARROW_FLIGHT_SQL_ODBC_TEST_SRCS # GH-46889: move protobuf_test_util to a more common location ../../../../engine/substrait/protobuf_test_util.cc) +# GH-49652: TODO support static test linkage on macOS if(ARROW_TEST_LINKAGE STREQUAL "static") set(ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS arrow_flight_sql_odbc_static ${ARROW_TEST_STATIC_LINK_LIBS}) @@ -65,12 +66,13 @@ else() # Unix list(APPEND ARROW_FLIGHT_SQL_ODBC_TEST_STATIC_LINK_LIBS ${ARROW_FLIGHT_SQL_ODBC_TEST_LIBS} ${ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS}) - + if(NOT APPLE) - # Explicitly link to boost on Linux // -AL- trying to make `ARROW_TEST_LINKAGE=static` work. - list(APPEND ARROW_FLIGHT_SQL_ODBC_TEST_STATIC_LINK_LIBS arrow_odbc_spi_impl Boost::headers ${ARROW_PROTOBUF_LIBPROTOBUF}) + # Links static dependencies on Linux to support ARROW_TEST_LINKAGE=static + list(APPEND ARROW_FLIGHT_SQL_ODBC_TEST_STATIC_LINK_LIBS arrow_odbc_spi_impl + ${ARROW_PROTOBUF_LIBPROTOBUF}) endif() - + endif() add_arrow_test(flight_sql_odbc_test