[arrow,gdal,arrow-adbc] Test and fix integration (#47958)

Co-authored-by: Matthias Kuhn <matthias@opengis.ch>
This commit is contained in:
Kai Pastor
2025-10-27 20:56:08 +01:00
committed by GitHub
parent 7046ed2a10
commit cf1490f511
13 changed files with 247 additions and 52 deletions

View File

@@ -1,13 +0,0 @@
diff --git a/cpp/cmake_modules/Findutf8proc.cmake b/cpp/cmake_modules/Findutf8proc.cmake
index e347414..83f2aa1 100644
--- a/cpp/cmake_modules/Findutf8proc.cmake
+++ b/cpp/cmake_modules/Findutf8proc.cmake
@@ -30,7 +30,7 @@ if(ARROW_PACKAGE_KIND STREQUAL "vcpkg")
if(utf8proc_FIND_REQUIRED)
list(APPEND find_package_args REQUIRED)
endif()
- find_package(utf8proc NAMES unofficial-utf8proc ${find_package_args})
+ find_package(utf8proc NAMES unofficial-utf8proc)
if(utf8proc_FOUND)
add_library(utf8proc::utf8proc ALIAS utf8proc)
return()

View File

@@ -9,13 +9,14 @@ vcpkg_extract_source_archive(
ARCHIVE ${ARCHIVE_PATH}
PATCHES
0001-msvc-static-name.patch
0002-utf8proc.patch
0003-android-musl.patch
0004-android-datetime.patch
0005-cmake-msvcruntime.patch
0006-pcg-msvc-arm64.patch
)
# Check cpp/cmake_modules/DefineOptions.cmake for option dependencies -
# they must be modeled as feature dependencies in vcpkg.json.
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
acero ARROW_ACERO
@@ -65,7 +66,6 @@ vcpkg_cmake_configure(
-DARROW_WITH_ZLIB=ON
-DARROW_WITH_ZSTD=ON
-DBUILD_WARNING_LEVEL=PRODUCTION
-DCMAKE_SYSTEM_PROCESSOR=${VCPKG_TARGET_ARCHITECTURE}
-DZSTD_MSVC_LIB_PREFIX=
MAYBE_UNUSED_VARIABLES
ZSTD_MSVC_LIB_PREFIX
@@ -106,7 +106,7 @@ endif()
if("flight" IN_LIST FEATURES)
vcpkg_cmake_config_fixup(
PACKAGE_NAME ArrowFlight
PACKAGE_NAME arrowflight
CONFIG_PATH lib/cmake/ArrowFlight
DO_NOT_DELETE_PARENT_CONFIG_PATH
)
@@ -114,7 +114,7 @@ endif()
if("flightsql" IN_LIST FEATURES)
vcpkg_cmake_config_fixup(
PACKAGE_NAME ArrowFlightSql
PACKAGE_NAME arrowflightsql
CONFIG_PATH lib/cmake/ArrowFlightSql
DO_NOT_DELETE_PARENT_CONFIG_PATH
)
@@ -127,36 +127,25 @@ if("parquet" IN_LIST FEATURES)
DO_NOT_DELETE_PARENT_CONFIG_PATH
)
endif()
file(GLOB main_configs "${CURRENT_PACKAGES_DIR}/lib/cmake/Arrow/*onfig.cmake")
file(GLOB extra_configs "${CURRENT_PACKAGES_DIR}/lib/cmake/*/*onfig.cmake")
list(REMOVE_ITEM extra_configs ${main_configs})
if(NOT "${extra_configs}" STREQUAL "")
message("${Z_VCPKG_BACKCOMPAT_MESSAGE_LEVEL}"
"Unhandled CMake config: ${extra_configs}\n"
"This might be caused by insufficient feature dependencies in ports/arrow/vcpkg.json."
)
endif()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Arrow)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
if("parquet" IN_LIST FEATURES)
file(READ "${CMAKE_CURRENT_LIST_DIR}/usage-parquet" usage-parquet)
file(APPEND "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" "${usage-parquet}")
endif()
if("dataset" IN_LIST FEATURES)
file(READ "${CMAKE_CURRENT_LIST_DIR}/usage-dataset" usage-dataset)
file(APPEND "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" "${usage-dataset}")
endif()
if("acero" IN_LIST FEATURES)
file(READ "${CMAKE_CURRENT_LIST_DIR}/usage-acero" usage-acero)
file(APPEND "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" "${usage-acero}")
endif()
if("compute" IN_LIST FEATURES)
file(READ "${CMAKE_CURRENT_LIST_DIR}/usage-compute" usage-compute)
file(APPEND "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" "${usage-compute}")
endif()
if("flight" IN_LIST FEATURES)
file(READ "${CMAKE_CURRENT_LIST_DIR}/usage-flight" usage-flight)
file(APPEND "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" "${usage-flight}")
endif()
if("flightsql" IN_LIST FEATURES)
file(READ "${CMAKE_CURRENT_LIST_DIR}/usage-flightsql" usage-flightsql)
file(APPEND "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" "${usage-flightsql}")
endif()
foreach(feature IN ITEMS parquet dataset acero compute flight flightsql)
if(feature IN_LIST FEATURES)
file(READ "${CMAKE_CURRENT_LIST_DIR}/usage-${feature}" feature_usage)
file(APPEND "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" "${feature_usage}")
endif()
endforeach()
if("example" IN_LIST FEATURES)
file(INSTALL "${SOURCE_PATH}/cpp/examples/minimal_build/" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}/example")

View File

@@ -1,7 +1,7 @@
{
"name": "arrow",
"version": "21.0.0",
"port-version": 1,
"port-version": 2,
"description": "Cross-language development platform for in-memory analytics",
"homepage": "https://arrow.apache.org",
"license": "Apache-2.0",
@@ -39,7 +39,16 @@
],
"features": {
"acero": {
"description": "Acero support"
"description": "Acero support",
"dependencies": [
{
"name": "arrow",
"default-features": false,
"features": [
"compute"
]
}
]
},
"compute": {
"description": "Build all computational kernel functions"
@@ -54,7 +63,17 @@
]
},
"dataset": {
"description": "Dataset support"
"description": "Dataset support",
"dependencies": [
{
"name": "arrow",
"default-features": false,
"features": [
"acero",
"filesystem"
]
}
]
},
"example": {
"description": "Install the minimal example (source code)"
@@ -86,6 +105,13 @@
"gcs": {
"description": "GCS support",
"dependencies": [
{
"name": "arrow",
"default-features": false,
"features": [
"filesystem"
]
},
{
"name": "google-cloud-cpp",
"default-features": false,
@@ -131,6 +157,13 @@
"s3": {
"description": "S3 support",
"dependencies": [
{
"name": "arrow",
"default-features": false,
"features": [
"filesystem"
]
},
{
"name": "aws-sdk-cpp",
"default-features": false,

View File

@@ -0,0 +1,17 @@
diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelper.cmake
index 9eb19d80f6..48f1b4bb30 100644
--- a/cmake/helpers/GdalDriverHelper.cmake
+++ b/cmake/helpers/GdalDriverHelper.cmake
@@ -360,7 +360,11 @@ endfunction()
function(gdal_target_interfaces _TARGET)
foreach (_LIB IN ITEMS ${ARGN})
- if (TARGET ${_LIB})
+ if (NOT TARGET ${_LIB})
+ continue()
+ elseif (CMAKE_VERSION VERSION_GREATER_EQUAL "3.27")
+ target_link_libraries(${_TARGET} PRIVATE "$<COMPILE_ONLY:${_LIB}>")
+ else ()
get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
if (_res)
target_include_directories(${_TARGET} PRIVATE ${_res})

View File

@@ -14,7 +14,9 @@ endif()
if(GDAL_USE_ARROW)
find_package(Arrow REQUIRED)
set(ARROW_USE_STATIC_LIBRARIES "${ARROW_BUILD_STATIC}" CACHE BOOL "")
set(ARROW_USE_STATIC_LIBRARIES "${ARROW_BUILD_STATIC}" CACHE INTERNAL "")
set(GDAL_USE_ARROWDATASET "${ARROW_DATASET}" CACHE INTERNAL "")
set(GDAL_USE_ARROWCOMPUTE "${ARROW_COMPUTE}" CACHE INTERNAL "")
endif()
if(GDAL_USE_SQLITE3)

View File

@@ -0,0 +1,139 @@
diff --git a/cmake/helpers/GdalGenerateConfig.cmake b/cmake/helpers/GdalGenerateConfig.cmake
index a2e9dfcdd1..debddd7062 100644
--- a/cmake/helpers/GdalGenerateConfig.cmake
+++ b/cmake/helpers/GdalGenerateConfig.cmake
@@ -21,24 +21,45 @@ function(gdal_join_and_quote _var)
set(${_var} "${string}" PARENT_SCOPE)
endfunction()
-# Return a flat list of libs including target linking requirements.
-function(gdal_flatten_link_libraries _result)
+# Return a flat list of libs including target linking requirements,
+# prepended to _result input. Targets appear only once, as late as possible.
+# Targets which are already in _result are not resolved/added again.
+function(gdal_flatten_link_libraries _result _is_debug_build)
+ set(_libs "${${_result}}")
+ gdal_process_link_keywords(working_list "${_is_debug_build}" ${ARGN})
+ while(working_list)
+ list(POP_BACK working_list _lib)
+ if(NOT TARGET "${_lib}")
+ list(PREPEND _libs "${_lib}")
+ elseif(_lib IN_LIST _libs)
+ # already resolved, do not repeat
+ continue()
+ else()
+ # new target
+ get_target_property(_link_libraries ${_lib} INTERFACE_LINK_LIBRARIES)
+ get_target_property(_type ${_lib} TYPE)
+ if(_link_libraries AND NOT TYPE STREQUAL "SHARED_LIBRARY")
+ gdal_flatten_link_libraries(_libs "${_is_debug_build}" ${_link_libraries})
+ endif()
+ list(PREPEND _libs "${_lib}")
+ endif()
+ endwhile()
+ set(${_result} "${_libs}" PARENT_SCOPE)
+endfunction()
+
+# Process link keywords and generator expressions for the purpose of exporting linker flags.
+function(gdal_process_link_keywords _result _is_debug_build)
set(_libs "")
- string(COMPARE EQUAL "${CMAKE_BUILD_TYPE}" "Debug" is_debug_build)
- if(CMAKE_BUILD_TYPE AND CMAKE_BUILD_TYPE IN_LIST DEBUG_CONFIGURATIONS)
- set(is_debug_build TRUE)
- endif()
while(ARGN)
- list(GET ARGN 0 _lib)
- list(REMOVE_AT ARGN 0)
+ list(POP_FRONT ARGN _lib)
if(_lib STREQUAL "debug")
- if(NOT is_debug_build)
- list(REMOVE_AT ARGN 0)
+ if(NOT _is_debug_build)
+ list(POP_FRONT ARGN)
endif()
continue()
elseif(_lib STREQUAL "optimized")
- if(is_debug_build)
- list(REMOVE_AT ARGN 0)
+ if(_is_debug_build)
+ list(POP_FRONT ARGN)
endif()
continue()
elseif(_lib STREQUAL "general")
@@ -47,13 +68,6 @@ function(gdal_flatten_link_libraries _result)
gdal_resolve_link_genex(_lib "${_lib}")
if(_lib)
list(APPEND _libs "${_lib}")
- if(TARGET "${_lib}")
- get_target_property(_link_libraries ${_lib} INTERFACE_LINK_LIBRARIES)
- get_target_property(_type ${_lib} TYPE)
- if(_link_libraries AND NOT TYPE STREQUAL "SHARED_LIBRARY")
- list(INSERT ARGN 0 ${_link_libraries})
- endif()
- endif()
endif()
endwhile()
set(${_result} "${_libs}" PARENT_SCOPE)
@@ -107,6 +121,20 @@ function(gdal_evaluate_link_genex _result _keyword _params)
else()
set(value 0)
endif()
+ elseif(_keyword STREQUAL "AND")
+ string(REPLACE "," ";" params_list "${_params}")
+ if("0" IN_LIST params_list)
+ set(value 0)
+ else()
+ set(value 1)
+ endif()
+ elseif(_keyword STREQUAL "OR")
+ string(REPLACE "," ";" params_list "${_params}")
+ if("1" IN_LIST params_list)
+ set(value 1)
+ else()
+ set(value 0)
+ endif()
elseif(_keyword STREQUAL "BOOL")
if("${_params}")
set(value 1)
@@ -117,9 +145,9 @@ function(gdal_evaluate_link_genex _result _keyword _params)
set(value "")
else()
if(NOT _params STREQUAL "")
- string(APPEND _keyword ":\${_params}")
+ string(APPEND _keyword ":${_params}")
endif()
- message(WARNING "Dropping unsupported generator expression: '\$<${_params}>'")
+ message(WARNING "Dropping unsupported generator expression: '\$<${_keyword}>'")
set(value "")
endif()
set(${_result} "${value}" PARENT_SCOPE)
@@ -198,11 +226,16 @@ endfunction()
# Get linker flags for cmake link libraries, with targets and generator
# expressions resolved for the current build type.
function(gdal_get_lflags _result)
- gdal_flatten_link_libraries(_libs_in ${ARGN})
+ string(COMPARE EQUAL "${CMAKE_BUILD_TYPE}" "Debug" is_debug_build)
+ if(CMAKE_BUILD_TYPE AND CMAKE_BUILD_TYPE IN_LIST DEBUG_CONFIGURATIONS)
+ set(is_debug_build TRUE)
+ endif()
+
+ set(_libs_in "")
+ gdal_flatten_link_libraries(_libs_in "${is_debug_build}" ${ARGN})
+
set(_libs_out "")
- while(_libs_in)
- list(GET _libs_in 0 _lib)
- list(REMOVE_AT _libs_in 0)
+ foreach(_lib IN LISTS _libs_in)
if(TARGET "${_lib}")
get_property(_type TARGET ${_lib} PROPERTY TYPE)
if(_type STREQUAL "INTERFACE_LIBRARY")
@@ -241,7 +274,7 @@ function(gdal_get_lflags _result)
list(REMOVE_ITEM _libs_out "${_lib}")
list(APPEND _libs_out "${_lib}")
endif()
- endwhile()
+ endforeach()
set(${_result} "${_libs_out}" PARENT_SCOPE)
endfunction()

View File

@@ -5,8 +5,10 @@ vcpkg_from_github(
SHA512 84a9bd58e9992d2d447788727228410184ef31e881026aee1f48766ed8b25039ab1b09afe95c97b66d3a0751bab524dc9bb57ab2c78af53632b52ec8dcd6f4ad
HEAD_REF master
PATCHES
adopt-compile-only.diff
find-link-libraries.patch
fix-gdal-target-interfaces.patch
generate-config.diff
libkml.patch
sqlite3.diff
target-is-valid.patch
@@ -24,6 +26,7 @@ vcpkg_replace_string("${SOURCE_PATH}/ogr/ogrsf_frmts/flatgeobuf/flatbuffers/base
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
arrow GDAL_USE_ARROW
arrow-adbc GDAL_USE_ADBCDRIVERMANAGER
archive GDAL_USE_ARCHIVE
cfitsio GDAL_USE_CFITSIO
curl GDAL_USE_CURL

View File

@@ -1,6 +1,7 @@
{
"name": "gdal",
"version-semver": "3.11.4",
"port-version": 1,
"description": "The Geographic Data Abstraction Library for reading and writing geospatial raster and vector data",
"homepage": "https://gdal.org",
"license": null,
@@ -85,6 +86,12 @@
}
]
},
"arrow-adbc": {
"description": "Arrow ADBC support",
"dependencies": [
"arrow-adbc"
]
},
"aws-ec2-windows": {
"description": "Optimized detection of AWS EC2 Windows hosts",
"dependencies": [
@@ -232,7 +239,7 @@
]
},
"parquet": {
"description": "Enable parquet reading support",
"description": "Enable parquet reading support. Combine with arrow[compute] or arrow[dataset] for additional capabilities.",
"dependencies": [
{
"name": "arrow",

View File

@@ -576,7 +576,6 @@ gazebo:x64-windows-static = cascade
gazebo:x64-windows-static-md = cascade
gazebo(arm | uwp | osx) = cascade
gdal[arrow,parquet](!(arm64 | x64)) = cascade
gdal[arrow,parquet](arm64 & windows) = cascade
gdal[aws-ec2-windows](!windows) = cascade
gdcm2:arm64-uwp = cascade
gdcm2:arm64-windows = cascade

View File

@@ -28,6 +28,15 @@
],
"platform": "native"
},
{
"name": "gdal",
"features": [
"arrow",
"arrow-adbc",
"parquet"
],
"platform": "(arm64 | x64) & !linux"
},
{
"name": "gdal",
"features": [

View File

@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "73ec101affdc45cc2932cedf85bcd4bd4ed90c31",
"version": "21.0.0",
"port-version": 2
},
{
"git-tree": "ecab846d4b97453e26953dcf553f1df260901ff3",
"version": "21.0.0",

View File

@@ -270,7 +270,7 @@
},
"arrow": {
"baseline": "21.0.0",
"port-version": 1
"port-version": 2
},
"arrow-adbc": {
"baseline": "16",
@@ -3198,7 +3198,7 @@
},
"gdal": {
"baseline": "3.11.4",
"port-version": 0
"port-version": 1
},
"gdbm": {
"baseline": "1.24",

View File

@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e75eccb3e4f9fa528839c5f4889c41520a7b1e22",
"version-semver": "3.11.4",
"port-version": 1
},
{
"git-tree": "3101928464079ad2f9846c45b5a964750b3ff3ff",
"version-semver": "3.11.4",