From 30c3d681bfc4169a496f7cb117c8a453517b53b5 Mon Sep 17 00:00:00 2001 From: Sreesh Maheshwar Date: Thu, 16 Apr 2026 15:49:29 -0700 Subject: [PATCH 1/2] fix: add platform link deps for Arrow bundled S3 libraries in CMake config When iceberg-cpp is built with ICEBERG_S3=ON using vendored Arrow, arrow_bundled_dependencies contains the AWS SDK C libraries which depend on platform-specific system libraries (CoreFoundation, Security, Network on macOS; winhttp, bcrypt, etc. on Windows). Without declaring these as transitive dependencies on the IMPORTED target, downstream consumers get unresolved symbols at link time. This mirrors Arrow's own ArrowConfig.cmake.in handling of the same issue for aws-c-common bundled dependencies. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/iceberg/iceberg-config.cmake.in | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/iceberg/iceberg-config.cmake.in b/src/iceberg/iceberg-config.cmake.in index 787fadcc6..b3f07dad6 100644 --- a/src/iceberg/iceberg-config.cmake.in +++ b/src/iceberg/iceberg-config.cmake.in @@ -32,6 +32,7 @@ @PACKAGE_INIT@ set(ICEBERG_BUILD_STATIC "@ICEBERG_BUILD_STATIC@") +set(ICEBERG_S3 "@ICEBERG_S3@") set(ICEBERG_SYSTEM_DEPENDENCIES "@ICEBERG_SYSTEM_DEPENDENCIES@") include(CMakeFindDependencyMacro) @@ -93,6 +94,35 @@ if(TARGET iceberg::arrow_static) "${arrow_lib_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}arrow_bundled_dependencies${CMAKE_STATIC_LIBRARY_SUFFIX}" ) endforeach() + + # When ICEBERG_S3 is enabled, Arrow's bundled static archive includes the + # AWS SDK C libraries (aws-c-common, etc.) which depend on platform-specific + # system libraries. Without these, downstream consumers get unresolved + # symbols at link time. + # Reference: Arrow's ArrowConfig.cmake.in handles this identically. + # https://github.com/apache/arrow/blob/main/cpp/src/arrow/ArrowConfig.cmake.in + if(ICEBERG_S3) + if(APPLE) + find_library(CORE_FOUNDATION CoreFoundation) + target_link_libraries(Arrow::arrow_bundled_dependencies + INTERFACE ${CORE_FOUNDATION}) + find_library(SECURITY Security) + target_link_libraries(Arrow::arrow_bundled_dependencies + INTERFACE ${SECURITY}) + find_library(NETWORK Network) + target_link_libraries(Arrow::arrow_bundled_dependencies INTERFACE ${NETWORK}) + elseif(WIN32) + target_link_libraries(Arrow::arrow_bundled_dependencies + INTERFACE "winhttp.lib" + "bcrypt.lib" + "wininet.lib" + "userenv.lib" + "version.lib" + "ncrypt.lib" + "Secur32.lib" + "Shlwapi.lib") + endif() + endif() endif() if(TARGET iceberg::parquet_static) From 3313c8592b4393929adad67066f5fbce38eb2be8 Mon Sep 17 00:00:00 2001 From: Sreesh Maheshwar Date: Sun, 10 May 2026 21:45:50 +0100 Subject: [PATCH 2/2] WIP: review fixes for CMake S3 deps --- src/iceberg/iceberg-config.cmake.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/iceberg/iceberg-config.cmake.in b/src/iceberg/iceberg-config.cmake.in index b3f07dad6..7dd117b9a 100644 --- a/src/iceberg/iceberg-config.cmake.in +++ b/src/iceberg/iceberg-config.cmake.in @@ -99,7 +99,7 @@ if(TARGET iceberg::arrow_static) # AWS SDK C libraries (aws-c-common, etc.) which depend on platform-specific # system libraries. Without these, downstream consumers get unresolved # symbols at link time. - # Reference: Arrow's ArrowConfig.cmake.in handles this identically. + # Reference: Arrow's ArrowConfig.cmake.in handles this similarly. # https://github.com/apache/arrow/blob/main/cpp/src/arrow/ArrowConfig.cmake.in if(ICEBERG_S3) if(APPLE) @@ -110,7 +110,8 @@ if(TARGET iceberg::arrow_static) target_link_libraries(Arrow::arrow_bundled_dependencies INTERFACE ${SECURITY}) find_library(NETWORK Network) - target_link_libraries(Arrow::arrow_bundled_dependencies INTERFACE ${NETWORK}) + target_link_libraries(Arrow::arrow_bundled_dependencies + INTERFACE ${NETWORK}) elseif(WIN32) target_link_libraries(Arrow::arrow_bundled_dependencies INTERFACE "winhttp.lib"