apache / apache/arrow-nanoarrow

Can't link to dynamic flatcc dependency

Open
#922 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
249
Forks
68
Avg merge
2d 16h
Merged PRs (30d)
12

Description

For Homebrew and vcpkg, where we can get shared flatcc dependency libraries, the IPC feature can't use the dynamic version of the library. Claude came up with

```path
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -227,13 +227,13 @@ if(NANOARROW_IPC)

elseif(NOT NANOARROW_FLATCC_INCLUDE_DIR)
set(NANOARROW_FLATCC_INCLUDE_DIR "${NANOARROW_FLATCC_ROOT_DIR}/include")
- add_library(flatccrt STATIC IMPORTED)
+ add_library(flatccrt SHARED IMPORTED)
set_target_properties(flatccrt
PROPERTIES IMPORTED_LOCATION
- "${NANOARROW_FLATCC_ROOT_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}flatccrt${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ "${NANOARROW_FLATCC_ROOT_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}flatccrt${CMAKE_SHARED_LIBRARY_SUFFIX}"
IMPORTED_LOCATION_DEBUG
- "${NANOARROW_FLATCC_ROOT_DIR}/debug/lib/${CMAKE_STATIC_LIBRARY_PREFIX}flatccrt_d${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ "${NANOARROW_FLATCC_ROOT_DIR}/debug/lib/${CMAKE_SHARED_LIBRARY_PREFIX}flatccrt_d${CMAKE_SHARED_LIBRARY_SUFFIX}"
IMPORTED_LOCATION_RELEASE
- "${NANOARROW_FLATCC_ROOT_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}flatccrt${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ "${NANOARROW_FLATCC_ROOT_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}flatccrt${CMAKE_SHARED_LIBRARY_SUFFIX}"
INTERFACE_INCLUDE_DIRECTORIES
"${NANOARROW_FLATCC_INCLUDE_DIR}")
```

for Homebrew but there may be a better solution.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in CMakeLists.txt around the NANOARROW_IPC configuration and the flatccrt imported-target setup. Reproduce the Homebrew or vcpkg configuration with a shared flatcc dependency, then inspect how the target is located and linked. Done means the IPC feature configures and links successfully against the dynamic flatcc library in those environments.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cmake
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.