This is an automated email from the ASF dual-hosted git repository.

raulcd pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new 7700dd4cb9 GH-47748: [C++][Dataset] Fix link error on macOS (#47749)
7700dd4cb9 is described below

commit 7700dd4cb9ea92edd0f6e6f66b8025f27fee233f
Author: Sutou Kouhei <[email protected]>
AuthorDate: Fri Oct 10 18:44:58 2025 +0900

    GH-47748: [C++][Dataset] Fix link error on macOS (#47749)
    
    ### Rationale for this change
    
    There are link errors with build options for JNI on macOS.
    
    ### What changes are included in this PR?
    
    `ARROW_BUNDLED_STATIC_LIBS` has CMake target names defined in Apache Arrow 
not `find_package()`-ed target names. So we should use `aws-c-common` not 
`AWS::aws-c-common`.
    
    Recent aws-c-common or something use the Network framework. So add 
`Network` to `Arrow::arrow_bundled_dependencies` dependencies.
    
    Don't use `compute/kernels/temporal_internal.cc` in `libarrow.dylib` and 
`libarrow_compute.dylib` to avoid duplicated symbols error.
    
    ### Are these changes tested?
    
    Yes.
    
    ### Are there any user-facing changes?
    
    Yes.
    * GitHub Issue: #47748
    
    Authored-by: Sutou Kouhei <[email protected]>
    Signed-off-by: Raúl Cumplido <[email protected]>
---
 cpp/src/arrow/ArrowConfig.cmake.in                | 4 +++-
 cpp/src/arrow/CMakeLists.txt                      | 1 -
 cpp/src/arrow/compute/kernels/temporal_internal.h | 2 +-
 cpp/src/arrow/meson.build                         | 1 -
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/cpp/src/arrow/ArrowConfig.cmake.in 
b/cpp/src/arrow/ArrowConfig.cmake.in
index ee462663d6..cbadad4d74 100644
--- a/cpp/src/arrow/ArrowConfig.cmake.in
+++ b/cpp/src/arrow/ArrowConfig.cmake.in
@@ -124,11 +124,13 @@ if(TARGET Arrow::arrow_static AND NOT TARGET 
Arrow::arrow_bundled_dependencies)
   # https://cmake.org/cmake/help/latest/policy/CMP0057.html
   cmake_policy(PUSH)
   cmake_policy(SET CMP0057 NEW)
-  if("AWS::aws-c-common" IN_LIST ARROW_BUNDLED_STATIC_LIBS)
+  if("aws-c-common" IN_LIST ARROW_BUNDLED_STATIC_LIBS)
     if(APPLE)
       find_library(CORE_FOUNDATION CoreFoundation)
       target_link_libraries(Arrow::arrow_bundled_dependencies
                             INTERFACE ${CORE_FOUNDATION})
+      find_library(NETWORK Network)
+      target_link_libraries(Arrow::arrow_bundled_dependencies INTERFACE 
${NETWORK})
       find_library(SECURITY Security)
       target_link_libraries(Arrow::arrow_bundled_dependencies INTERFACE 
${SECURITY})
     elseif(WIN32)
diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt
index 771505f8c9..e299e8f616 100644
--- a/cpp/src/arrow/CMakeLists.txt
+++ b/cpp/src/arrow/CMakeLists.txt
@@ -780,7 +780,6 @@ if(ARROW_COMPUTE)
        compute/kernels/scalar_temporal_binary.cc
        compute/kernels/scalar_temporal_unary.cc
        compute/kernels/scalar_validity.cc
-       compute/kernels/temporal_internal.cc
        compute/kernels/util_internal.cc
        compute/kernels/vector_array_sort.cc
        compute/kernels/vector_cumulative_ops.cc
diff --git a/cpp/src/arrow/compute/kernels/temporal_internal.h 
b/cpp/src/arrow/compute/kernels/temporal_internal.h
index 68e09e91d7..3674c233dc 100644
--- a/cpp/src/arrow/compute/kernels/temporal_internal.h
+++ b/cpp/src/arrow/compute/kernels/temporal_internal.h
@@ -80,7 +80,7 @@ inline int64_t GetQuarter(const year_month_day& ymd) {
   return static_cast<int64_t>((static_cast<uint32_t>(ymd.month()) - 1) / 3);
 }
 
-Result<ArrowTimeZone> LocateZone(const std::string_view timezone);
+ARROW_EXPORT Result<ArrowTimeZone> LocateZone(const std::string_view timezone);
 
 static inline const std::string& GetInputTimezone(const DataType& type) {
   static const std::string no_timezone = "";
diff --git a/cpp/src/arrow/meson.build b/cpp/src/arrow/meson.build
index 1872f96df6..5590ba41c9 100644
--- a/cpp/src/arrow/meson.build
+++ b/cpp/src/arrow/meson.build
@@ -525,7 +525,6 @@ if needs_compute
         'compute/kernels/scalar_temporal_binary.cc',
         'compute/kernels/scalar_temporal_unary.cc',
         'compute/kernels/scalar_validity.cc',
-        'compute/kernels/temporal_internal.cc',
         'compute/kernels/util_internal.cc',
         'compute/kernels/vector_array_sort.cc',
         'compute/kernels/vector_cumulative_ops.cc',

Reply via email to