From 9ca7f11d198a1b02a27e6fe932ae8a302d9b7a97 Mon Sep 17 00:00:00 2001 From: Tadeja Kadunc Date: Thu, 10 Sep 2026 11:09:45 +0200 Subject: [PATCH 01/23] Test static linking with S3 --- cpp/examples/minimal_build/CMakeLists.txt | 13 +++++++++++++ cpp/examples/minimal_build/example.cc | 9 +++++++++ 2 files changed, 22 insertions(+) diff --git a/cpp/examples/minimal_build/CMakeLists.txt b/cpp/examples/minimal_build/CMakeLists.txt index d0a0a1e0a221..9a261789f5a2 100644 --- a/cpp/examples/minimal_build/CMakeLists.txt +++ b/cpp/examples/minimal_build/CMakeLists.txt @@ -49,3 +49,16 @@ if(ARROW_LINK_SHARED) else() target_link_libraries(arrow-example PRIVATE Arrow::arrow_static) endif() + +option(ARROW_EXAMPLE_S3 "Use S3 of installed Arrow packages" OFF) +if(ARROW_EXAMPLE_S3) + find_package(ARROWS3 QUIET) + if(ArrowS3_FOUND) + if(ARROW_LINK_SHARED) + target_link_libraries(arrow-example PRIVATE ArrowS3::arrow_s3_shared) + else() + target_link_libraries(arrow-example PRIVATE ArrowS3::arrow_s3_static) + endif() + endif() + target_compile_definitions(arrow-example PRIVATE ARROW_EXAMPLE_S3) +endif() diff --git a/cpp/examples/minimal_build/example.cc b/cpp/examples/minimal_build/example.cc index 9bfb9953edca..86f28d70c52a 100644 --- a/cpp/examples/minimal_build/example.cc +++ b/cpp/examples/minimal_build/example.cc @@ -16,6 +16,9 @@ // under the License. #include +#ifdef ARROW_EXAMPLE_S3 +# include +#endif #include #include #include @@ -54,6 +57,12 @@ Status RunMain(int argc, char** argv) { ARROW_RETURN_NOT_OK(batch_writer->WriteTable(*table)); ARROW_RETURN_NOT_OK(batch_writer->Close()); +#ifdef ARROW_EXAMPLE_S3 + std::cerr << "* Verify S3 initializes and finalizes" << std::endl; + ARROW_RETURN_NOT_OK(arrow::fs::EnsureS3Initialized()); + ARROW_RETURN_NOT_OK(arrow::fs::EnsureS3Finalized()); +#endif + return Status::OK(); } From 6e9d919276c9736192f4cf8b5e87c03967395e55 Mon Sep 17 00:00:00 2001 From: Tadeja Kadunc Date: Thu, 10 Sep 2026 12:27:48 +0200 Subject: [PATCH 02/23] Add cpp_test.sh and improve CMakeLists.txt --- ci/scripts/cpp_test.sh | 5 +++++ cpp/examples/minimal_build/CMakeLists.txt | 18 ++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/ci/scripts/cpp_test.sh b/ci/scripts/cpp_test.sh index 18c301c5fdac..c7cdd859fc33 100755 --- a/ci/scripts/cpp_test.sh +++ b/ci/scripts/cpp_test.sh @@ -146,12 +146,17 @@ if [ "${ARROW_USE_MESON:-OFF}" = "OFF" ] && \ cmake \ -S "${source_dir}/examples/minimal_build" \ -B "${build_dir}/examples/minimal_build" \ + -DARROW_EXAMPLE_S3="${ARROW_S3:-OFF}" \ -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" cmake --build "${build_dir}/examples/minimal_build" pushd "${source_dir}/examples/minimal_build" # PATH= is for Windows. PATH="${CMAKE_INSTALL_PREFIX:-${ARROW_HOME}}/bin:${PATH}" \ "${build_dir}/examples/minimal_build/arrow-example" + # Test static linking with S3 + if [ -e "${build_dir}/examples/minimal_build/arrow-example-s3-static" ]; then + "${build_dir}/examples/minimal_build/arrow-example-s3-static" + fi popd fi diff --git a/cpp/examples/minimal_build/CMakeLists.txt b/cpp/examples/minimal_build/CMakeLists.txt index 9a261789f5a2..ce7e009f0e71 100644 --- a/cpp/examples/minimal_build/CMakeLists.txt +++ b/cpp/examples/minimal_build/CMakeLists.txt @@ -50,15 +50,13 @@ else() target_link_libraries(arrow-example PRIVATE Arrow::arrow_static) endif() -option(ARROW_EXAMPLE_S3 "Use S3 of installed Arrow packages" OFF) -if(ARROW_EXAMPLE_S3) - find_package(ARROWS3 QUIET) - if(ArrowS3_FOUND) - if(ARROW_LINK_SHARED) - target_link_libraries(arrow-example PRIVATE ArrowS3::arrow_s3_shared) - else() - target_link_libraries(arrow-example PRIVATE ArrowS3::arrow_s3_static) - endif() +option(ARROW_EXAMPLE_S3 "Verify S3 and static linking" OFF) +if(ARROW_EXAMPLE_S3 AND TARGET Arrow::arrow_static) + add_executable(arrow-example-s3-static example.cc) + target_compile_definitions(arrow-example-s3-static PRIVATE ARROW_EXAMPLE_S3) + target_link_libraries(arrow-example-s3-static PRIVATE Arrow::arrow_static) + find_package(ArrowS3 QUIET) + if(TARGET ArrowS3::arrow_s3_static) + target_link_libraries(arrow-example-s3-static PRIVATE ArrowS3::arrow_s3_static) endif() - target_compile_definitions(arrow-example PRIVATE ARROW_EXAMPLE_S3) endif() From 2b18aa66a878dc295e753465e2224e243333f927 Mon Sep 17 00:00:00 2001 From: Tadeja Kadunc Date: Thu, 10 Sep 2026 12:30:44 +0200 Subject: [PATCH 03/23] Fix for undefined reference to Azure:: --- cpp/src/arrow/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt index d2b3eac7792e..25659f4405ef 100644 --- a/cpp/src/arrow/CMakeLists.txt +++ b/cpp/src/arrow/CMakeLists.txt @@ -39,6 +39,12 @@ if(ARROW_GCS) endif() endif() +if(ARROW_AZURE) + if(Azure_SOURCE STREQUAL "SYSTEM") + list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS ${AZURE_SDK_LINK_LIBRARIES}) + endif() +endif() + if(ARROW_USE_OPENSSL) list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS ${ARROW_OPENSSL_LIBS}) endif() From 1cf97bb913ec33ab3e18cc2652b741d11c07e331 Mon Sep 17 00:00:00 2001 From: Tadeja Kadunc Date: Thu, 10 Sep 2026 13:25:11 +0200 Subject: [PATCH 04/23] Additional fixes for bundled Azure/GCS --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 5 +++++ cpp/src/arrow/CMakeLists.txt | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 2b703a3e1ca3..c86a63f63009 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -4346,6 +4346,11 @@ if(ARROW_WITH_AZURE_SDK) resolve_dependency(Azure REQUIRED_VERSION 1.10.2) set(AZURE_SDK_LINK_LIBRARIES Azure::azure-storage-files-datalake Azure::azure-storage-blobs Azure::azure-identity) + if(AZURE_SDK_VENDORED AND NOT WIN32) + find_curl() + find_package(LibXml2 REQUIRED) + list(APPEND ARROW_SYSTEM_DEPENDENCIES LibXml2) + endif() endif() # ---------------------------------------------------------------------- diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt index 25659f4405ef..746c8d907f10 100644 --- a/cpp/src/arrow/CMakeLists.txt +++ b/cpp/src/arrow/CMakeLists.txt @@ -36,12 +36,20 @@ set(ARROW_STATIC_INSTALL_INTERFACE_LIBS) if(ARROW_GCS) if(google_cloud_cpp_storage_SOURCE STREQUAL "SYSTEM") list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS google-cloud-cpp::storage) + elseif(google_cloud_cpp_storage_SOURCE STREQUAL "BUNDLED") + if(UNIX) + list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS CURL::libcurl) + endif() endif() endif() if(ARROW_AZURE) if(Azure_SOURCE STREQUAL "SYSTEM") list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS ${AZURE_SDK_LINK_LIBRARIES}) + elseif(Azure_SOURCE STREQUAL "BUNDLED") + if(UNIX) + list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS CURL::libcurl LibXml2::LibXml2) + endif() endif() endif() From d983858da39504fa1ec5249970218d130e86d848 Mon Sep 17 00:00:00 2001 From: Tadeja Kadunc Date: Tue, 25 Aug 2026 17:44:07 +0200 Subject: [PATCH 05/23] 2.WORKAROUND until S3 is moved in GH-50194 --- compose.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compose.yaml b/compose.yaml index 1741d00db431..a8410edb41cf 100644 --- a/compose.yaml +++ b/compose.yaml @@ -303,8 +303,10 @@ services: volumes: &conda-volumes - .:/arrow:delegated - ${DOCKER_VOLUME_PREFIX}conda-ccache:/ccache:delegated + # WORKAROUND: Revert export after S3 is moved out of libarrow (GH-50194) command: &conda-cpp-command [" + export ARROW_CMAKE_ARGS=-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON && /arrow/ci/scripts/cpp_build.sh /arrow /build && /arrow/ci/scripts/cpp_test.sh /arrow /build"] From eb183efb49dec5f20dad481a08c4b7a8ee3309f9 Mon Sep 17 00:00:00 2001 From: Tadeja Kadunc Date: Thu, 10 Sep 2026 20:57:28 +0200 Subject: [PATCH 06/23] Revert temporary workaround --- compose.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/compose.yaml b/compose.yaml index a8410edb41cf..1741d00db431 100644 --- a/compose.yaml +++ b/compose.yaml @@ -303,10 +303,8 @@ services: volumes: &conda-volumes - .:/arrow:delegated - ${DOCKER_VOLUME_PREFIX}conda-ccache:/ccache:delegated - # WORKAROUND: Revert export after S3 is moved out of libarrow (GH-50194) command: &conda-cpp-command [" - export ARROW_CMAKE_ARGS=-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON && /arrow/ci/scripts/cpp_build.sh /arrow /build && /arrow/ci/scripts/cpp_test.sh /arrow /build"] From c0379e5cb54a3bd19f5c2d6388ec6b03425b2818 Mon Sep 17 00:00:00 2001 From: Tadeja Kadunc Date: Thu, 10 Sep 2026 20:58:25 +0200 Subject: [PATCH 07/23] Move find_curl before resolve_dependency --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index c86a63f63009..0c29c8801798 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -4343,11 +4343,13 @@ function(build_azure_sdk) endfunction() if(ARROW_WITH_AZURE_SDK) + if(NOT WIN32) + find_curl() + endif() resolve_dependency(Azure REQUIRED_VERSION 1.10.2) set(AZURE_SDK_LINK_LIBRARIES Azure::azure-storage-files-datalake Azure::azure-storage-blobs Azure::azure-identity) if(AZURE_SDK_VENDORED AND NOT WIN32) - find_curl() find_package(LibXml2 REQUIRED) list(APPEND ARROW_SYSTEM_DEPENDENCIES LibXml2) endif() From 88ca24bcf1999d3230f423ab713736ee9119d1b0 Mon Sep 17 00:00:00 2001 From: Tadeja Kadunc Date: Tue, 15 Sep 2026 01:22:02 +0200 Subject: [PATCH 08/23] Add pkg-config fix --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 0c29c8801798..47d13dcc7ff7 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -3800,6 +3800,11 @@ if(ARROW_WITH_GOOGLE_CLOUD_CPP) # avoid conflict. find_curl(ARROW) resolve_dependency(google_cloud_cpp_storage PC_PACKAGE_NAMES google_cloud_cpp_storage) + if(ARROW_BUILD_STATIC + AND google_cloud_cpp_storage_SOURCE STREQUAL "BUNDLED" + AND UNIX) + string(APPEND ARROW_PC_REQUIRES_PRIVATE " libcurl") + endif() get_target_property(google_cloud_cpp_storage_INCLUDE_DIR google-cloud-cpp::storage INTERFACE_INCLUDE_DIRECTORIES) message(STATUS "Found google-cloud-cpp::storage headers: ${google_cloud_cpp_storage_INCLUDE_DIR}" @@ -4352,6 +4357,9 @@ if(ARROW_WITH_AZURE_SDK) if(AZURE_SDK_VENDORED AND NOT WIN32) find_package(LibXml2 REQUIRED) list(APPEND ARROW_SYSTEM_DEPENDENCIES LibXml2) + if(ARROW_BUILD_STATIC) + string(APPEND ARROW_PC_REQUIRES_PRIVATE " libcurl libxml-2.0") + endif() endif() endif() From 22355126c62d12ca48eb5e047a36509c5f7fc988 Mon Sep 17 00:00:00 2001 From: Tadeja Kadunc Date: Tue, 15 Sep 2026 01:35:16 +0200 Subject: [PATCH 09/23] Broader fix --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 4 +--- cpp/src/arrow/CMakeLists.txt | 6 ++---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 47d13dcc7ff7..2bc7cd74eb4c 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -3800,9 +3800,7 @@ if(ARROW_WITH_GOOGLE_CLOUD_CPP) # avoid conflict. find_curl(ARROW) resolve_dependency(google_cloud_cpp_storage PC_PACKAGE_NAMES google_cloud_cpp_storage) - if(ARROW_BUILD_STATIC - AND google_cloud_cpp_storage_SOURCE STREQUAL "BUNDLED" - AND UNIX) + if(ARROW_BUILD_STATIC AND google_cloud_cpp_storage_SOURCE STREQUAL "BUNDLED") string(APPEND ARROW_PC_REQUIRES_PRIVATE " libcurl") endif() get_target_property(google_cloud_cpp_storage_INCLUDE_DIR google-cloud-cpp::storage diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt index 746c8d907f10..21aeabfa153c 100644 --- a/cpp/src/arrow/CMakeLists.txt +++ b/cpp/src/arrow/CMakeLists.txt @@ -37,9 +37,7 @@ if(ARROW_GCS) if(google_cloud_cpp_storage_SOURCE STREQUAL "SYSTEM") list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS google-cloud-cpp::storage) elseif(google_cloud_cpp_storage_SOURCE STREQUAL "BUNDLED") - if(UNIX) - list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS CURL::libcurl) - endif() + list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS CURL::libcurl) endif() endif() @@ -47,7 +45,7 @@ if(ARROW_AZURE) if(Azure_SOURCE STREQUAL "SYSTEM") list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS ${AZURE_SDK_LINK_LIBRARIES}) elseif(Azure_SOURCE STREQUAL "BUNDLED") - if(UNIX) + if(NOT WIN32) list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS CURL::libcurl LibXml2::LibXml2) endif() endif() From 93db5e9f3d5f3a1e7480924e82a5df561d98577e Mon Sep 17 00:00:00 2001 From: Tadeja Kadunc Date: Fri, 18 Sep 2026 14:30:07 +0200 Subject: [PATCH 10/23] Post #50195 change QUIET to REQUIRED for ArrowS3 --- ci/scripts/cpp_test.sh | 9 +++++++-- cpp/cmake_modules/ThirdpartyToolchain.cmake | 2 +- cpp/examples/minimal_build/CMakeLists.txt | 10 +++++----- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/ci/scripts/cpp_test.sh b/ci/scripts/cpp_test.sh index c7cdd859fc33..81562e84b60c 100755 --- a/ci/scripts/cpp_test.sh +++ b/ci/scripts/cpp_test.sh @@ -143,10 +143,14 @@ if [ "${ARROW_USE_MESON:-OFF}" = "OFF" ] && \ # Search vcpkg before /lib/cmake. CMAKE_PREFIX_PATH="${VCPKG_ROOT}/installed/${VCPKG_DEFAULT_TRIPLET};${CMAKE_PREFIX_PATH}" fi + ARROW_EXAMPLE_S3="${ARROW_S3:-OFF}" + if [ "${ARROW_ENABLE_THREADING:-ON}" = "OFF" ]; then + ARROW_EXAMPLE_S3=OFF + fi cmake \ -S "${source_dir}/examples/minimal_build" \ -B "${build_dir}/examples/minimal_build" \ - -DARROW_EXAMPLE_S3="${ARROW_S3:-OFF}" \ + -DARROW_EXAMPLE_S3="${ARROW_EXAMPLE_S3}" \ -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" cmake --build "${build_dir}/examples/minimal_build" pushd "${source_dir}/examples/minimal_build" @@ -154,7 +158,8 @@ if [ "${ARROW_USE_MESON:-OFF}" = "OFF" ] && \ PATH="${CMAKE_INSTALL_PREFIX:-${ARROW_HOME}}/bin:${PATH}" \ "${build_dir}/examples/minimal_build/arrow-example" # Test static linking with S3 - if [ -e "${build_dir}/examples/minimal_build/arrow-example-s3-static" ]; then + if [ "${ARROW_EXAMPLE_S3}" = "ON" ] && [ "${ARROW_BUILD_STATIC:-ON}" = "ON" ]; then + PATH="${CMAKE_INSTALL_PREFIX:-${ARROW_HOME}}/bin:${PATH}" \ "${build_dir}/examples/minimal_build/arrow-example-s3-static" fi popd diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 2bc7cd74eb4c..d16672eb514b 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -4347,7 +4347,7 @@ endfunction() if(ARROW_WITH_AZURE_SDK) if(NOT WIN32) - find_curl() + find_curl(ARROW) endif() resolve_dependency(Azure REQUIRED_VERSION 1.10.2) set(AZURE_SDK_LINK_LIBRARIES Azure::azure-storage-files-datalake diff --git a/cpp/examples/minimal_build/CMakeLists.txt b/cpp/examples/minimal_build/CMakeLists.txt index ce7e009f0e71..da1fa2785d8f 100644 --- a/cpp/examples/minimal_build/CMakeLists.txt +++ b/cpp/examples/minimal_build/CMakeLists.txt @@ -52,11 +52,11 @@ endif() option(ARROW_EXAMPLE_S3 "Verify S3 and static linking" OFF) if(ARROW_EXAMPLE_S3 AND TARGET Arrow::arrow_static) + find_package(ArrowS3 REQUIRED) + if(NOT TARGET ArrowS3::arrow_s3_static) + message(FATAL_ERROR "ArrowS3::arrow_s3_static not found") + endif() add_executable(arrow-example-s3-static example.cc) target_compile_definitions(arrow-example-s3-static PRIVATE ARROW_EXAMPLE_S3) - target_link_libraries(arrow-example-s3-static PRIVATE Arrow::arrow_static) - find_package(ArrowS3 QUIET) - if(TARGET ArrowS3::arrow_s3_static) - target_link_libraries(arrow-example-s3-static PRIVATE ArrowS3::arrow_s3_static) - endif() + target_link_libraries(arrow-example-s3-static PRIVATE ArrowS3::arrow_s3_static) endif() From 5683f834d8657a981f30ea33a1dc9ee66dcd3672 Mon Sep 17 00:00:00 2001 From: Tadeja Kadunc Date: Fri, 18 Sep 2026 16:44:59 +0200 Subject: [PATCH 11/23] Check binary per Copilot --- ci/scripts/cpp_test.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ci/scripts/cpp_test.sh b/ci/scripts/cpp_test.sh index 81562e84b60c..cfc6281758d8 100755 --- a/ci/scripts/cpp_test.sh +++ b/ci/scripts/cpp_test.sh @@ -158,9 +158,10 @@ if [ "${ARROW_USE_MESON:-OFF}" = "OFF" ] && \ PATH="${CMAKE_INSTALL_PREFIX:-${ARROW_HOME}}/bin:${PATH}" \ "${build_dir}/examples/minimal_build/arrow-example" # Test static linking with S3 - if [ "${ARROW_EXAMPLE_S3}" = "ON" ] && [ "${ARROW_BUILD_STATIC:-ON}" = "ON" ]; then + s3_example="${build_dir}/examples/minimal_build/arrow-example-s3-static" + if [ -x "${s3_example}" ]; then PATH="${CMAKE_INSTALL_PREFIX:-${ARROW_HOME}}/bin:${PATH}" \ - "${build_dir}/examples/minimal_build/arrow-example-s3-static" + "${s3_example}" fi popd fi From 86d94020e62826189192a6be928d9578e455bf10 Mon Sep 17 00:00:00 2001 From: Tadeja Kadunc Date: Fri, 18 Sep 2026 18:32:36 +0200 Subject: [PATCH 12/23] Deduplicate libcurl when both GCS and Azure need it --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index d16672eb514b..4bc4a788bba5 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -3800,7 +3800,9 @@ if(ARROW_WITH_GOOGLE_CLOUD_CPP) # avoid conflict. find_curl(ARROW) resolve_dependency(google_cloud_cpp_storage PC_PACKAGE_NAMES google_cloud_cpp_storage) - if(ARROW_BUILD_STATIC AND google_cloud_cpp_storage_SOURCE STREQUAL "BUNDLED") + if(ARROW_BUILD_STATIC + AND google_cloud_cpp_storage_SOURCE STREQUAL "BUNDLED" + AND NOT ARROW_PC_REQUIRES_PRIVATE MATCHES "libcurl") string(APPEND ARROW_PC_REQUIRES_PRIVATE " libcurl") endif() get_target_property(google_cloud_cpp_storage_INCLUDE_DIR google-cloud-cpp::storage @@ -4356,7 +4358,10 @@ if(ARROW_WITH_AZURE_SDK) find_package(LibXml2 REQUIRED) list(APPEND ARROW_SYSTEM_DEPENDENCIES LibXml2) if(ARROW_BUILD_STATIC) - string(APPEND ARROW_PC_REQUIRES_PRIVATE " libcurl libxml-2.0") + if(NOT ARROW_PC_REQUIRES_PRIVATE MATCHES "libcurl") + string(APPEND ARROW_PC_REQUIRES_PRIVATE " libcurl") + endif() + string(APPEND ARROW_PC_REQUIRES_PRIVATE " libxml-2.0") endif() endif() endif() From c50eccd6eac69c99699480e88f523bb2f10b99af Mon Sep 17 00:00:00 2001 From: Tadeja Kadunc Date: Thu, 24 Sep 2026 13:54:15 +0200 Subject: [PATCH 13/23] Add libxml2-dev --- dev/tasks/linux-packages/apache-arrow/debian/control.in | 2 ++ dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in | 1 + 2 files changed, 3 insertions(+) diff --git a/dev/tasks/linux-packages/apache-arrow/debian/control.in b/dev/tasks/linux-packages/apache-arrow/debian/control.in index b66fe53dbaaf..45438772c854 100644 --- a/dev/tasks/linux-packages/apache-arrow/debian/control.in +++ b/dev/tasks/linux-packages/apache-arrow/debian/control.in @@ -18,6 +18,7 @@ Build-Depends: libgrpc++-dev, libgtest-dev, liblz4-dev, + libxml2-dev, @USE_SYSTEM_OPEN_TELEMETRY@ libopentelemetry-proto-dev, libprotobuf-dev, libprotoc-dev, @@ -179,6 +180,7 @@ Depends: libcurl4-openssl-dev, @SYSTEM_OPEN_TELEMETRY_REQUIRE_GRPC@ libgrpc++-dev, liblz4-dev, + libxml2-dev, libprotobuf-dev, libprotoc-dev, libre2-dev, diff --git a/dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in b/dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in index 5e6646f3864e..584490fad92e 100644 --- a/dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in +++ b/dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in @@ -278,6 +278,7 @@ Requires: curl-devel Requires: json-devel %endif Requires: libzstd-devel +Requires: libxml2-devel Requires: lz4-devel %{lz4_requirement} Requires: openssl-devel %if %{have_orc} From 2f6822b52d1ccddb70cbe0496614863c68a74503 Mon Sep 17 00:00:00 2001 From: Tadeja Kadunc Date: Mon, 28 Sep 2026 11:55:48 +0200 Subject: [PATCH 14/23] Fix wrong order --- dev/tasks/linux-packages/apache-arrow/debian/control.in | 4 ++-- dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/tasks/linux-packages/apache-arrow/debian/control.in b/dev/tasks/linux-packages/apache-arrow/debian/control.in index 45438772c854..2aad235b9362 100644 --- a/dev/tasks/linux-packages/apache-arrow/debian/control.in +++ b/dev/tasks/linux-packages/apache-arrow/debian/control.in @@ -18,7 +18,6 @@ Build-Depends: libgrpc++-dev, libgtest-dev, liblz4-dev, - libxml2-dev, @USE_SYSTEM_OPEN_TELEMETRY@ libopentelemetry-proto-dev, libprotobuf-dev, libprotoc-dev, @@ -27,6 +26,7 @@ Build-Depends: libssl-dev, libthrift-dev, libutf8proc-dev, + libxml2-dev, libxxhash-dev, libzstd-dev, meson, @@ -180,13 +180,13 @@ Depends: libcurl4-openssl-dev, @SYSTEM_OPEN_TELEMETRY_REQUIRE_GRPC@ libgrpc++-dev, liblz4-dev, - libxml2-dev, libprotobuf-dev, libprotoc-dev, libre2-dev, libsnappy-dev, libssl-dev, libutf8proc-dev, + libxml2-dev, libxxhash-dev, libzstd-dev, nlohmann-json-dev | nlohmann-json3-dev, diff --git a/dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in b/dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in index 584490fad92e..91255b8c2740 100644 --- a/dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in +++ b/dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in @@ -277,8 +277,8 @@ Requires: curl-devel %if %{use_gcs} && !%{use_bundled_nlohmann_json} Requires: json-devel %endif -Requires: libzstd-devel Requires: libxml2-devel +Requires: libzstd-devel Requires: lz4-devel %{lz4_requirement} Requires: openssl-devel %if %{have_orc} From 2bd3ca5b839dd4435d12058a9aa699dea3198e9e Mon Sep 17 00:00:00 2001 From: Tadeja Kadunc Date: Mon, 28 Sep 2026 14:12:43 +0200 Subject: [PATCH 15/23] Rename for clarity --- ci/scripts/cpp_test.sh | 6 +++--- cpp/examples/minimal_build/CMakeLists.txt | 6 +++--- cpp/examples/minimal_build/example.cc | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ci/scripts/cpp_test.sh b/ci/scripts/cpp_test.sh index cfc6281758d8..fc65be02a8db 100755 --- a/ci/scripts/cpp_test.sh +++ b/ci/scripts/cpp_test.sh @@ -143,14 +143,14 @@ if [ "${ARROW_USE_MESON:-OFF}" = "OFF" ] && \ # Search vcpkg before /lib/cmake. CMAKE_PREFIX_PATH="${VCPKG_ROOT}/installed/${VCPKG_DEFAULT_TRIPLET};${CMAKE_PREFIX_PATH}" fi - ARROW_EXAMPLE_S3="${ARROW_S3:-OFF}" + ARROW_EXAMPLE_S3_STATIC_CHECK="${ARROW_S3:-OFF}" if [ "${ARROW_ENABLE_THREADING:-ON}" = "OFF" ]; then - ARROW_EXAMPLE_S3=OFF + ARROW_EXAMPLE_S3_STATIC_CHECK=OFF fi cmake \ -S "${source_dir}/examples/minimal_build" \ -B "${build_dir}/examples/minimal_build" \ - -DARROW_EXAMPLE_S3="${ARROW_EXAMPLE_S3}" \ + -DARROW_EXAMPLE_S3_STATIC_CHECK="${ARROW_EXAMPLE_S3_STATIC_CHECK}" \ -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" cmake --build "${build_dir}/examples/minimal_build" pushd "${source_dir}/examples/minimal_build" diff --git a/cpp/examples/minimal_build/CMakeLists.txt b/cpp/examples/minimal_build/CMakeLists.txt index da1fa2785d8f..c7af4d2af8f3 100644 --- a/cpp/examples/minimal_build/CMakeLists.txt +++ b/cpp/examples/minimal_build/CMakeLists.txt @@ -50,13 +50,13 @@ else() target_link_libraries(arrow-example PRIVATE Arrow::arrow_static) endif() -option(ARROW_EXAMPLE_S3 "Verify S3 and static linking" OFF) -if(ARROW_EXAMPLE_S3 AND TARGET Arrow::arrow_static) +option(ARROW_EXAMPLE_S3_STATIC_CHECK "Verify S3 and static linking" OFF) +if(ARROW_EXAMPLE_S3_STATIC_CHECK AND TARGET Arrow::arrow_static) find_package(ArrowS3 REQUIRED) if(NOT TARGET ArrowS3::arrow_s3_static) message(FATAL_ERROR "ArrowS3::arrow_s3_static not found") endif() add_executable(arrow-example-s3-static example.cc) - target_compile_definitions(arrow-example-s3-static PRIVATE ARROW_EXAMPLE_S3) + target_compile_definitions(arrow-example-s3-static PRIVATE ARROW_EXAMPLE_S3_STATIC_CHECK) target_link_libraries(arrow-example-s3-static PRIVATE ArrowS3::arrow_s3_static) endif() diff --git a/cpp/examples/minimal_build/example.cc b/cpp/examples/minimal_build/example.cc index 86f28d70c52a..f600f9429d6f 100644 --- a/cpp/examples/minimal_build/example.cc +++ b/cpp/examples/minimal_build/example.cc @@ -16,7 +16,7 @@ // under the License. #include -#ifdef ARROW_EXAMPLE_S3 +#ifdef ARROW_EXAMPLE_S3_STATIC_CHECK # include #endif #include @@ -57,7 +57,7 @@ Status RunMain(int argc, char** argv) { ARROW_RETURN_NOT_OK(batch_writer->WriteTable(*table)); ARROW_RETURN_NOT_OK(batch_writer->Close()); -#ifdef ARROW_EXAMPLE_S3 +#ifdef ARROW_EXAMPLE_S3_STATIC_CHECK std::cerr << "* Verify S3 initializes and finalizes" << std::endl; ARROW_RETURN_NOT_OK(arrow::fs::EnsureS3Initialized()); ARROW_RETURN_NOT_OK(arrow::fs::EnsureS3Finalized()); From c1fa4988d694cf013d8fcd68de00d20d2202e1f2 Mon Sep 17 00:00:00 2001 From: Tadeja Kadunc Date: Mon, 28 Sep 2026 14:17:00 +0200 Subject: [PATCH 16/23] CMake Format --- cpp/examples/minimal_build/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpp/examples/minimal_build/CMakeLists.txt b/cpp/examples/minimal_build/CMakeLists.txt index c7af4d2af8f3..78c8030b77f0 100644 --- a/cpp/examples/minimal_build/CMakeLists.txt +++ b/cpp/examples/minimal_build/CMakeLists.txt @@ -57,6 +57,7 @@ if(ARROW_EXAMPLE_S3_STATIC_CHECK AND TARGET Arrow::arrow_static) message(FATAL_ERROR "ArrowS3::arrow_s3_static not found") endif() add_executable(arrow-example-s3-static example.cc) - target_compile_definitions(arrow-example-s3-static PRIVATE ARROW_EXAMPLE_S3_STATIC_CHECK) + target_compile_definitions(arrow-example-s3-static + PRIVATE ARROW_EXAMPLE_S3_STATIC_CHECK) target_link_libraries(arrow-example-s3-static PRIVATE ArrowS3::arrow_s3_static) endif() From 9af899f822729d4baca694085059ede3c98f949f Mon Sep 17 00:00:00 2001 From: Tadeja Kadunc Date: Mon, 28 Sep 2026 14:21:45 +0200 Subject: [PATCH 17/23] Removal of no-treading guard --- ci/scripts/cpp_test.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/ci/scripts/cpp_test.sh b/ci/scripts/cpp_test.sh index fc65be02a8db..07e7fa2a2b64 100755 --- a/ci/scripts/cpp_test.sh +++ b/ci/scripts/cpp_test.sh @@ -144,9 +144,6 @@ if [ "${ARROW_USE_MESON:-OFF}" = "OFF" ] && \ CMAKE_PREFIX_PATH="${VCPKG_ROOT}/installed/${VCPKG_DEFAULT_TRIPLET};${CMAKE_PREFIX_PATH}" fi ARROW_EXAMPLE_S3_STATIC_CHECK="${ARROW_S3:-OFF}" - if [ "${ARROW_ENABLE_THREADING:-ON}" = "OFF" ]; then - ARROW_EXAMPLE_S3_STATIC_CHECK=OFF - fi cmake \ -S "${source_dir}/examples/minimal_build" \ -B "${build_dir}/examples/minimal_build" \ From bc38a7d30f91f2317232505d196e30f89ac35128 Mon Sep 17 00:00:00 2001 From: Tadeja Kadunc Date: Mon, 28 Sep 2026 15:11:31 +0200 Subject: [PATCH 18/23] Revert "Removal of no-threading guard" This reverts commit 9af899f822729d4baca694085059ede3c98f949f. --- ci/scripts/cpp_test.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ci/scripts/cpp_test.sh b/ci/scripts/cpp_test.sh index 07e7fa2a2b64..fc65be02a8db 100755 --- a/ci/scripts/cpp_test.sh +++ b/ci/scripts/cpp_test.sh @@ -144,6 +144,9 @@ if [ "${ARROW_USE_MESON:-OFF}" = "OFF" ] && \ CMAKE_PREFIX_PATH="${VCPKG_ROOT}/installed/${VCPKG_DEFAULT_TRIPLET};${CMAKE_PREFIX_PATH}" fi ARROW_EXAMPLE_S3_STATIC_CHECK="${ARROW_S3:-OFF}" + if [ "${ARROW_ENABLE_THREADING:-ON}" = "OFF" ]; then + ARROW_EXAMPLE_S3_STATIC_CHECK=OFF + fi cmake \ -S "${source_dir}/examples/minimal_build" \ -B "${build_dir}/examples/minimal_build" \ From dc78c96fe8167e988be44edbc7afcde61abf192d Mon Sep 17 00:00:00 2001 From: Tadeja Kadunc Date: Tue, 29 Sep 2026 10:17:25 +0200 Subject: [PATCH 19/23] Add libxml2-dev directly --- .../linux-packages/apache-arrow/apt/debian-forky/Dockerfile | 1 + .../linux-packages/apache-arrow/apt/debian-trixie/Dockerfile | 1 + .../linux-packages/apache-arrow/apt/ubuntu-jammy/Dockerfile | 1 + .../linux-packages/apache-arrow/apt/ubuntu-noble/Dockerfile | 1 + .../linux-packages/apache-arrow/apt/ubuntu-resolute/Dockerfile | 1 + 5 files changed, 5 insertions(+) diff --git a/dev/tasks/linux-packages/apache-arrow/apt/debian-forky/Dockerfile b/dev/tasks/linux-packages/apache-arrow/apt/debian-forky/Dockerfile index 674e16d705a8..d9246d37c917 100644 --- a/dev/tasks/linux-packages/apache-arrow/apt/debian-forky/Dockerfile +++ b/dev/tasks/linux-packages/apache-arrow/apt/debian-forky/Dockerfile @@ -68,6 +68,7 @@ RUN \ libssl-dev \ libthrift-dev \ libutf8proc-dev \ + libxml2-dev \ libxxhash-dev \ libzstd-dev \ llvm-dev \ diff --git a/dev/tasks/linux-packages/apache-arrow/apt/debian-trixie/Dockerfile b/dev/tasks/linux-packages/apache-arrow/apt/debian-trixie/Dockerfile index 2c9927684181..66548e8c2f00 100644 --- a/dev/tasks/linux-packages/apache-arrow/apt/debian-trixie/Dockerfile +++ b/dev/tasks/linux-packages/apache-arrow/apt/debian-trixie/Dockerfile @@ -68,6 +68,7 @@ RUN \ libssl-dev \ libthrift-dev \ libutf8proc-dev \ + libxml2-dev \ libxxhash-dev \ libzstd-dev \ llvm-dev \ diff --git a/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-jammy/Dockerfile b/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-jammy/Dockerfile index 644bc695bbd9..a5b732689bac 100644 --- a/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-jammy/Dockerfile +++ b/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-jammy/Dockerfile @@ -60,6 +60,7 @@ RUN \ libssl-dev \ libthrift-dev \ libutf8proc-dev \ + libxml2-dev \ libxxhash-dev \ libzstd-dev \ llvm-dev \ diff --git a/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-noble/Dockerfile b/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-noble/Dockerfile index 496609a8925b..7e9119d313ed 100644 --- a/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-noble/Dockerfile +++ b/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-noble/Dockerfile @@ -61,6 +61,7 @@ RUN \ libssl-dev \ libthrift-dev \ libutf8proc-dev \ + libxml2-dev \ libxxhash-dev \ libzstd-dev \ llvm-dev \ diff --git a/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-resolute/Dockerfile b/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-resolute/Dockerfile index 19f1434b7f6d..b1bc2f4dd173 100644 --- a/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-resolute/Dockerfile +++ b/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-resolute/Dockerfile @@ -61,6 +61,7 @@ RUN \ libssl-dev \ libthrift-dev \ libutf8proc-dev \ + libxml2-dev \ libxxhash-dev \ libzstd-dev \ llvm-dev \ From b66bc875cd6ae76826f34db627472eeb3d81aff7 Mon Sep 17 00:00:00 2001 From: Tadeja Kadunc Date: Tue, 29 Sep 2026 11:30:37 +0200 Subject: [PATCH 20/23] Filter at ArrowOptions.cmake instead at env --- ci/scripts/cpp_test.sh | 6 +----- cpp/examples/minimal_build/CMakeLists.txt | 3 ++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/ci/scripts/cpp_test.sh b/ci/scripts/cpp_test.sh index fc65be02a8db..0863afc13a28 100755 --- a/ci/scripts/cpp_test.sh +++ b/ci/scripts/cpp_test.sh @@ -143,14 +143,10 @@ if [ "${ARROW_USE_MESON:-OFF}" = "OFF" ] && \ # Search vcpkg before /lib/cmake. CMAKE_PREFIX_PATH="${VCPKG_ROOT}/installed/${VCPKG_DEFAULT_TRIPLET};${CMAKE_PREFIX_PATH}" fi - ARROW_EXAMPLE_S3_STATIC_CHECK="${ARROW_S3:-OFF}" - if [ "${ARROW_ENABLE_THREADING:-ON}" = "OFF" ]; then - ARROW_EXAMPLE_S3_STATIC_CHECK=OFF - fi cmake \ -S "${source_dir}/examples/minimal_build" \ -B "${build_dir}/examples/minimal_build" \ - -DARROW_EXAMPLE_S3_STATIC_CHECK="${ARROW_EXAMPLE_S3_STATIC_CHECK}" \ + -DARROW_EXAMPLE_S3_STATIC_CHECK=ON \ -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" cmake --build "${build_dir}/examples/minimal_build" pushd "${source_dir}/examples/minimal_build" diff --git a/cpp/examples/minimal_build/CMakeLists.txt b/cpp/examples/minimal_build/CMakeLists.txt index 78c8030b77f0..e814e5544e47 100644 --- a/cpp/examples/minimal_build/CMakeLists.txt +++ b/cpp/examples/minimal_build/CMakeLists.txt @@ -51,7 +51,8 @@ else() endif() option(ARROW_EXAMPLE_S3_STATIC_CHECK "Verify S3 and static linking" OFF) -if(ARROW_EXAMPLE_S3_STATIC_CHECK AND TARGET Arrow::arrow_static) +# Check only when Arrow got built with S3 by ArrowOptions.cmake via find_package +if(ARROW_EXAMPLE_S3_STATIC_CHECK AND ARROW_S3 AND TARGET Arrow::arrow_static) find_package(ArrowS3 REQUIRED) if(NOT TARGET ArrowS3::arrow_s3_static) message(FATAL_ERROR "ArrowS3::arrow_s3_static not found") From 078ced1914b54a6319de2ee6c98106c06b2040d4 Mon Sep 17 00:00:00 2001 From: Tadeja Kadunc Date: Tue, 29 Sep 2026 13:42:43 +0200 Subject: [PATCH 21/23] Curl only for vendored Azure and log when skipping --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 4 +--- cpp/examples/minimal_build/CMakeLists.txt | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 4bc4a788bba5..b42a7b00bfd7 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -4348,13 +4348,11 @@ function(build_azure_sdk) endfunction() if(ARROW_WITH_AZURE_SDK) - if(NOT WIN32) - find_curl(ARROW) - endif() resolve_dependency(Azure REQUIRED_VERSION 1.10.2) set(AZURE_SDK_LINK_LIBRARIES Azure::azure-storage-files-datalake Azure::azure-storage-blobs Azure::azure-identity) if(AZURE_SDK_VENDORED AND NOT WIN32) + find_curl(ARROW) find_package(LibXml2 REQUIRED) list(APPEND ARROW_SYSTEM_DEPENDENCIES LibXml2) if(ARROW_BUILD_STATIC) diff --git a/cpp/examples/minimal_build/CMakeLists.txt b/cpp/examples/minimal_build/CMakeLists.txt index e814e5544e47..260d3a3fa3dc 100644 --- a/cpp/examples/minimal_build/CMakeLists.txt +++ b/cpp/examples/minimal_build/CMakeLists.txt @@ -61,4 +61,7 @@ if(ARROW_EXAMPLE_S3_STATIC_CHECK AND ARROW_S3 AND TARGET Arrow::arrow_static) target_compile_definitions(arrow-example-s3-static PRIVATE ARROW_EXAMPLE_S3_STATIC_CHECK) target_link_libraries(arrow-example-s3-static PRIVATE ArrowS3::arrow_s3_static) +elseif(ARROW_EXAMPLE_S3_STATIC_CHECK) + message(STATUS "Skipping arrow-example-s3-static: " + "requires ARROW_S3 and Arrow::arrow_static") endif() From a84bc1a2ad08379ac62f4239c83be543c9393693 Mon Sep 17 00:00:00 2001 From: Tadeja Kadunc Date: Tue, 29 Sep 2026 14:13:51 +0200 Subject: [PATCH 22/23] CMake Format --- cpp/examples/minimal_build/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cpp/examples/minimal_build/CMakeLists.txt b/cpp/examples/minimal_build/CMakeLists.txt index 260d3a3fa3dc..e1a9217401f2 100644 --- a/cpp/examples/minimal_build/CMakeLists.txt +++ b/cpp/examples/minimal_build/CMakeLists.txt @@ -52,7 +52,9 @@ endif() option(ARROW_EXAMPLE_S3_STATIC_CHECK "Verify S3 and static linking" OFF) # Check only when Arrow got built with S3 by ArrowOptions.cmake via find_package -if(ARROW_EXAMPLE_S3_STATIC_CHECK AND ARROW_S3 AND TARGET Arrow::arrow_static) +if(ARROW_EXAMPLE_S3_STATIC_CHECK + AND ARROW_S3 + AND TARGET Arrow::arrow_static) find_package(ArrowS3 REQUIRED) if(NOT TARGET ArrowS3::arrow_s3_static) message(FATAL_ERROR "ArrowS3::arrow_s3_static not found") From 5f66b0c35a2e51b878b7ffff81a796e17db92b1e Mon Sep 17 00:00:00 2001 From: Tadeja Kadunc Date: Tue, 29 Sep 2026 14:48:17 +0200 Subject: [PATCH 23/23] Fallback to Libs.private when .pc unavailable --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 46 ++++++++++++++++----- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index b42a7b00bfd7..9d2e1d2756bf 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -1419,6 +1419,27 @@ macro(find_curl ARROW_CURL_PACKAGE_PREFIX) endif() endmacro() +# ---------------------------------------------------------------------- +# pkg-config + +# SDK libraries (on macOS) may be available without .pc files +macro(arrow_append_pc_system_library PC_PACKAGE PC_PREFIX FALLBACK) + find_package(PkgConfig QUIET) + if(PkgConfig_FOUND) + pkg_check_modules(${PC_PREFIX} + ${PC_PACKAGE} + NO_CMAKE_PATH + NO_CMAKE_ENVIRONMENT_PATH + QUIET) + endif() + if(PkgConfig_FOUND AND ${PC_PREFIX}_FOUND) + string(APPEND ARROW_PC_REQUIRES_PRIVATE " ${PC_PACKAGE}") + else() + message(STATUS "No .pc for ${PC_PACKAGE}. Using ${FALLBACK} in arrow.pc") + string(APPEND ARROW_PC_LIBS_PRIVATE " ${FALLBACK}") + endif() +endmacro() + # ---------------------------------------------------------------------- # Snappy @@ -3800,11 +3821,6 @@ if(ARROW_WITH_GOOGLE_CLOUD_CPP) # avoid conflict. find_curl(ARROW) resolve_dependency(google_cloud_cpp_storage PC_PACKAGE_NAMES google_cloud_cpp_storage) - if(ARROW_BUILD_STATIC - AND google_cloud_cpp_storage_SOURCE STREQUAL "BUNDLED" - AND NOT ARROW_PC_REQUIRES_PRIVATE MATCHES "libcurl") - string(APPEND ARROW_PC_REQUIRES_PRIVATE " libcurl") - endif() get_target_property(google_cloud_cpp_storage_INCLUDE_DIR google-cloud-cpp::storage INTERFACE_INCLUDE_DIRECTORIES) message(STATUS "Found google-cloud-cpp::storage headers: ${google_cloud_cpp_storage_INCLUDE_DIR}" @@ -4355,12 +4371,20 @@ if(ARROW_WITH_AZURE_SDK) find_curl(ARROW) find_package(LibXml2 REQUIRED) list(APPEND ARROW_SYSTEM_DEPENDENCIES LibXml2) - if(ARROW_BUILD_STATIC) - if(NOT ARROW_PC_REQUIRES_PRIVATE MATCHES "libcurl") - string(APPEND ARROW_PC_REQUIRES_PRIVATE " libcurl") - endif() - string(APPEND ARROW_PC_REQUIRES_PRIVATE " libxml-2.0") - endif() + endif() +endif() + +if(ARROW_BUILD_STATIC) + if((ARROW_GCS AND google_cloud_cpp_storage_SOURCE STREQUAL "BUNDLED") + OR (ARROW_AZURE + AND AZURE_SDK_VENDORED + AND NOT WIN32)) + arrow_append_pc_system_library("libcurl" ARROW_CURL_PC "-lcurl") + endif() + if(ARROW_AZURE + AND AZURE_SDK_VENDORED + AND NOT WIN32) + arrow_append_pc_system_library("libxml-2.0" ARROW_LIBXML2_PC "-lxml2") endif() endif()