Skip to content

Commit fb07302

Browse files
author
Rafał Hibner
committed
Merge branch 'optionalConversionTraits' into combined2
2 parents ee5e754 + d208f70 commit fb07302

27 files changed

+719
-288
lines changed

.pre-commit-config.yaml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,16 +192,35 @@ repos:
192192
# TODO: Remove this when we fix all lint failures
193193
files: >-
194194
(
195+
?^c_glib/test/run-test\.sh$|
195196
?^ci/scripts/c_glib_build\.sh$|
196197
?^ci/scripts/c_glib_test\.sh$|
197-
?^c_glib/test/run-test\.sh$|
198+
?^ci/scripts/conan_setup\.sh$|
199+
?^ci/scripts/download_tz_database\.sh$|
200+
?^ci/scripts/install_azurite\.sh$|
201+
?^ci/scripts/install_ccache\.sh$|
202+
?^ci/scripts/install_ceph\.sh$|
203+
?^ci/scripts/install_spark\.sh$|
204+
?^ci/scripts/integration_dask\.sh$|
205+
?^ci/scripts/msys2_system_upgrade\.sh$|
206+
?^ci/scripts/util_free_space\.sh$|
207+
?^cpp/build-support/build-lz4-lib\.sh$|
208+
?^cpp/build-support/build-zstd-lib\.sh$|
209+
?^cpp/build-support/get-upstream-commit\.sh$|
210+
?^cpp/build-support/update-thrift\.sh$|
211+
?^cpp/examples/minimal_build/run\.sh$|
212+
?^cpp/examples/tutorial_examples/run\.sh$|
198213
?^dev/release/05-binary-upload\.sh$|
199214
?^dev/release/07-binary-verify\.sh$|
200215
?^dev/release/binary-recover\.sh$|
201216
?^dev/release/post-03-binary\.sh$|
202217
?^dev/release/post-10-docs\.sh$|
203218
?^dev/release/post-11-python\.sh$|
219+
?^dev/release/setup-rhel-rebuilds\.sh$|
204220
?^dev/release/utils-generate-checksum\.sh$|
221+
?^python/asv-install\.sh$|
222+
?^python/asv-uninstall\.sh$|
223+
?^swift/gen-protobuffers\.sh$|
205224
)
206225
- repo: https://github.com/scop/pre-commit-shfmt
207226
rev: v3.11.0-1

c_glib/arrow-glib/basic-data-type.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2300,6 +2300,8 @@ garrow_fixed_shape_tensor_data_type_class_init(GArrowFixedShapeTensorDataTypeCla
23002300
* @error: (nullable): Return location for a #GError or %NULL.
23012301
*
23022302
* Returns: The newly created fixed shape tensor data type.
2303+
*
2304+
* Since: 21.0.0
23032305
*/
23042306
GArrowFixedShapeTensorDataType *
23052307
garrow_fixed_shape_tensor_data_type_new(GArrowDataType *value_type,
@@ -2353,6 +2355,8 @@ garrow_fixed_shape_tensor_data_type_new(GArrowDataType *value_type,
23532355
* @length: (out): Return location for the number of dimensions of the tensor.
23542356
*
23552357
* Returns: (array length=length): Shape of the tensor.
2358+
*
2359+
* Since: 21.0.0
23562360
*/
23572361
const gint64 *
23582362
garrow_fixed_shape_tensor_data_type_get_shape(GArrowFixedShapeTensorDataType *data_type,
@@ -2372,6 +2376,8 @@ garrow_fixed_shape_tensor_data_type_get_shape(GArrowFixedShapeTensorDataType *da
23722376
* @length: (out): Return location for the number of elements of permutation.
23732377
*
23742378
* Returns: (array length=length): Permutation of the tensor.
2379+
*
2380+
* Since: 21.0.0
23752381
*/
23762382
const gint64 *
23772383
garrow_fixed_shape_tensor_data_type_get_permutation(
@@ -2394,6 +2400,8 @@ garrow_fixed_shape_tensor_data_type_get_permutation(
23942400
*
23952401
* It's a %NULL-terminated string array. It must be freed with
23962402
* g_strfreev() when no longer needed.
2403+
*
2404+
* Since: 21.0.0
23972405
*/
23982406
gchar **
23992407
garrow_fixed_shape_tensor_data_type_get_dim_names(

ci/scripts/install_ccache.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,23 @@ case $(uname) in
3232
MINGW64*)
3333
url="https://github.com/ccache/ccache/releases/download/v${version}/ccache-${version}-windows-x86_64.zip"
3434
pushd /tmp/ccache
35-
curl --fail --location --remote-name ${url}
36-
unzip -j ccache-${version}-windows-x86_64.zip
35+
curl --fail --location --remote-name "${url}"
36+
unzip -j "ccache-${version}-windows-x86_64.zip"
3737
chmod +x ccache.exe
38-
mv ccache.exe ${prefix}/bin/
38+
mv ccache.exe "${prefix}/bin/"
3939
popd
4040
;;
4141
*)
4242
url="https://github.com/ccache/ccache/archive/v${version}.tar.gz"
4343

44-
wget -q ${url} -O - | tar -xzf - --directory /tmp/ccache --strip-components=1
44+
wget -q "${url}" -O - | tar -xzf - --directory /tmp/ccache --strip-components=1
4545

4646
mkdir /tmp/ccache/build
4747
pushd /tmp/ccache/build
4848
cmake \
4949
-GNinja \
5050
-DCMAKE_BUILD_TYPE=Release \
51-
-DCMAKE_INSTALL_PREFIX=${prefix} \
51+
-DCMAKE_INSTALL_PREFIX="${prefix}" \
5252
-DZSTD_FROM_INTERNET=ON \
5353
..
5454
ninja install

cpp/cmake_modules/FindBrotliAlt.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ if(BrotliAlt_FOUND)
2121
return()
2222
endif()
2323

24-
if(ARROW_PACKAGE_KIND STREQUAL "vcpkg" OR ARROW_PACKAGE_KIND STREQUAL "conan")
24+
if(ARROW_VCPKG OR ARROW_PACKAGE_KIND STREQUAL "conan")
2525
set(find_package_args "")
2626
if(BrotliAlt_FIND_VERSION)
2727
list(APPEND find_package_args ${BrotliAlt_FIND_VERSION})
@@ -32,14 +32,14 @@ if(ARROW_PACKAGE_KIND STREQUAL "vcpkg" OR ARROW_PACKAGE_KIND STREQUAL "conan")
3232
if(BrotliAlt_FIND_REQUIRED)
3333
list(APPEND find_package_args REQUIRED)
3434
endif()
35-
if(ARROW_PACKAGE_KIND STREQUAL "vcpkg")
35+
if(ARROW_VCPKG)
3636
find_package(BrotliAlt NAMES unofficial-brotli ${find_package_args})
3737
else()
3838
find_package(BrotliAlt NAMES brotli ${find_package_args})
3939
endif()
4040
set(Brotli_FOUND ${BrotliAlt_FOUND})
4141
if(BrotliAlt_FOUND)
42-
if(ARROW_PACKAGE_KIND STREQUAL "vcpkg")
42+
if(ARROW_VCPKG)
4343
add_library(Brotli::brotlicommon ALIAS unofficial::brotli::brotlicommon)
4444
add_library(Brotli::brotlienc ALIAS unofficial::brotli::brotlienc)
4545
add_library(Brotli::brotlidec ALIAS unofficial::brotli::brotlidec)

cpp/cmake_modules/Findutf8proc.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if(utf8proc_FOUND)
1919
return()
2020
endif()
2121

22-
if(ARROW_PACKAGE_KIND STREQUAL "vcpkg" OR VCPKG_TOOLCHAIN)
22+
if(ARROW_VCPKG)
2323
set(find_package_args "")
2424
if(utf8proc_FIND_VERSION)
2525
list(APPEND find_package_args ${utf8proc_FIND_VERSION})

cpp/cmake_modules/ThirdpartyToolchain.cmake

Lines changed: 50 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -607,8 +607,6 @@ else()
607607
# our currently used packages and doesn't fall out of sync with
608608
# ${ARROW_BOOST_BUILD_VERSION_UNDERSCORES}
609609
"${THIRDPARTY_MIRROR_URL}/boost_${ARROW_BOOST_BUILD_VERSION_UNDERSCORES}.tar.gz"
610-
"https://boostorg.jfrog.io/artifactory/main/release/${ARROW_BOOST_BUILD_VERSION}/source/boost_${ARROW_BOOST_BUILD_VERSION_UNDERSCORES}.tar.gz"
611-
"https://sourceforge.net/projects/boost/files/boost/${ARROW_BOOST_BUILD_VERSION}/boost_${ARROW_BOOST_BUILD_VERSION_UNDERSCORES}.tar.gz"
612610
)
613611
endif()
614612

@@ -2652,33 +2650,40 @@ if(ARROW_WITH_ZLIB)
26522650
endif()
26532651

26542652
macro(build_lz4)
2655-
message(STATUS "Building LZ4 from source")
2653+
message(STATUS "Building LZ4 from source using FetchContent")
26562654

2657-
set(LZ4_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/lz4_ep-install")
2655+
# Set LZ4 as vendored
2656+
set(LZ4_VENDORED TRUE)
26582657

2659-
set(LZ4_STATIC_LIB
2660-
"${LZ4_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}lz4${CMAKE_STATIC_LIBRARY_SUFFIX}")
2658+
# Declare the content
2659+
fetchcontent_declare(lz4
2660+
URL ${LZ4_SOURCE_URL}
2661+
URL_HASH "SHA256=${ARROW_LZ4_BUILD_SHA256_CHECKSUM}"
2662+
SOURCE_SUBDIR "build/cmake")
26612663

2662-
set(LZ4_CMAKE_ARGS ${EP_COMMON_CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
2663-
-DLZ4_BUILD_CLI=OFF -DLZ4_BUILD_LEGACY_LZ4C=OFF)
2664+
# Prepare fetch content environment
2665+
prepare_fetchcontent()
26642666

2665-
# We need to copy the header in lib to directory outside of the build
2666-
externalproject_add(lz4_ep
2667-
${EP_COMMON_OPTIONS}
2668-
CMAKE_ARGS ${LZ4_CMAKE_ARGS}
2669-
SOURCE_SUBDIR "build/cmake"
2670-
INSTALL_DIR ${LZ4_PREFIX}
2671-
URL ${LZ4_SOURCE_URL}
2672-
URL_HASH "SHA256=${ARROW_LZ4_BUILD_SHA256_CHECKSUM}"
2673-
BUILD_BYPRODUCTS ${LZ4_STATIC_LIB})
2674-
2675-
file(MAKE_DIRECTORY "${LZ4_PREFIX}/include")
2676-
add_library(LZ4::lz4 STATIC IMPORTED)
2677-
set_target_properties(LZ4::lz4 PROPERTIES IMPORTED_LOCATION "${LZ4_STATIC_LIB}")
2678-
target_include_directories(LZ4::lz4 BEFORE INTERFACE "${LZ4_PREFIX}/include")
2679-
add_dependencies(LZ4::lz4 lz4_ep)
2680-
2681-
list(APPEND ARROW_BUNDLED_STATIC_LIBS LZ4::lz4)
2667+
# Set LZ4-specific build options as cache variables
2668+
set(LZ4_BUILD_CLI
2669+
OFF
2670+
CACHE BOOL "Don't build LZ4 CLI" FORCE)
2671+
set(LZ4_BUILD_LEGACY_LZ4C
2672+
OFF
2673+
CACHE BOOL "Don't build legacy LZ4 tools" FORCE)
2674+
2675+
# Make the dependency available - this will actually perform the download and configure
2676+
fetchcontent_makeavailable(lz4)
2677+
2678+
# Use LZ4::lz4 as an imported library not an alias of lz4_static so other targets such as orc
2679+
# can depend on it as an external library. External libraries are ignored in
2680+
# install(TARGETS orc EXPORT orc_targets) and install(EXPORT orc_targets).
2681+
add_library(LZ4::lz4 INTERFACE IMPORTED)
2682+
target_link_libraries(LZ4::lz4 INTERFACE lz4_static)
2683+
2684+
# Add to bundled static libs.
2685+
# We must use lz4_static (not imported target) not LZ4::lz4 (imported target).
2686+
list(APPEND ARROW_BUNDLED_STATIC_LIBS lz4_static)
26822687
endmacro()
26832688

26842689
if(ARROW_WITH_LZ4)
@@ -2908,7 +2913,7 @@ endmacro()
29082913

29092914
if(ARROW_WITH_UTF8PROC)
29102915
set(utf8proc_resolve_dependency_args utf8proc PC_PACKAGE_NAMES libutf8proc)
2911-
if(NOT VCPKG_TOOLCHAIN)
2916+
if(NOT ARROW_VCPKG)
29122917
# utf8proc in vcpkg doesn't provide version information:
29132918
# https://github.com/microsoft/vcpkg/issues/39176
29142919
list(APPEND utf8proc_resolve_dependency_args REQUIRED_VERSION "2.2.0")
@@ -4589,6 +4594,17 @@ target_include_directories(arrow::hadoop INTERFACE "${HADOOP_HOME}/include")
45894594
function(build_orc)
45904595
message(STATUS "Building Apache ORC from source")
45914596

4597+
if(LZ4_VENDORED)
4598+
set(ORC_LZ4_TARGET lz4_static)
4599+
set(ORC_LZ4_ROOT "${lz4_SOURCE_DIR}")
4600+
set(ORC_LZ4_INCLUDE_DIR "${lz4_SOURCE_DIR}/lib")
4601+
else()
4602+
set(ORC_LZ4_TARGET LZ4::lz4)
4603+
get_target_property(ORC_LZ4_INCLUDE_DIR ${ORC_LZ4_TARGET}
4604+
INTERFACE_INCLUDE_DIRECTORIES)
4605+
get_filename_component(ORC_LZ4_ROOT "${ORC_LZ4_INCLUDE_DIR}" DIRECTORY)
4606+
endif()
4607+
45924608
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.29)
45934609
fetchcontent_declare(orc
45944610
${FC_DECLARE_COMMON_OPTIONS}
@@ -4601,16 +4617,14 @@ function(build_orc)
46014617
set(ORC_PREFER_STATIC_LZ4
46024618
OFF
46034619
CACHE BOOL "" FORCE)
4604-
get_target_property(LZ4_INCLUDE_DIR LZ4::lz4 INTERFACE_INCLUDE_DIRECTORIES)
4605-
if(NOT LZ4_INCLUDE_DIR)
4606-
find_path(LZ4_INCLUDE_DIR NAMES lz4.h)
4607-
endif()
4608-
get_filename_component(LZ4_ROOT "${LZ4_INCLUDE_DIR}" DIRECTORY)
46094620
set(LZ4_HOME
4610-
"${LZ4_ROOT}"
4621+
"${ORC_LZ4_ROOT}"
4622+
CACHE STRING "" FORCE)
4623+
set(LZ4_INCLUDE_DIR
4624+
"${ORC_LZ4_INCLUDE_DIR}"
46114625
CACHE STRING "" FORCE)
46124626
set(LZ4_LIBRARY
4613-
LZ4::lz4
4627+
${ORC_LZ4_TARGET}
46144628
CACHE STRING "" FORCE)
46154629

46164630
set(ORC_PREFER_STATIC_PROTOBUF
@@ -4709,9 +4723,6 @@ function(build_orc)
47094723
INTERFACE_INCLUDE_DIRECTORIES)
47104724
get_filename_component(ORC_SNAPPY_ROOT "${ORC_SNAPPY_INCLUDE_DIR}" DIRECTORY)
47114725

4712-
get_target_property(ORC_LZ4_ROOT LZ4::lz4 INTERFACE_INCLUDE_DIRECTORIES)
4713-
get_filename_component(ORC_LZ4_ROOT "${ORC_LZ4_ROOT}" DIRECTORY)
4714-
47154726
get_target_property(ORC_ZSTD_ROOT ${ARROW_ZSTD_LIBZSTD} INTERFACE_INCLUDE_DIRECTORIES)
47164727
get_filename_component(ORC_ZSTD_ROOT "${ORC_ZSTD_ROOT}" DIRECTORY)
47174728

@@ -4735,9 +4746,9 @@ function(build_orc)
47354746
"-DSNAPPY_HOME=${ORC_SNAPPY_ROOT}"
47364747
"-DSNAPPY_LIBRARY=$<TARGET_FILE:${Snappy_TARGET}>"
47374748
"-DLZ4_HOME=${ORC_LZ4_ROOT}"
4738-
"-DLZ4_LIBRARY=$<TARGET_FILE:LZ4::lz4>"
4739-
"-DLZ4_STATIC_LIB=$<TARGET_FILE:LZ4::lz4>"
4740-
"-DLZ4_INCLUDE_DIR=${ORC_LZ4_ROOT}/include"
4749+
"-DLZ4_LIBRARY=$<TARGET_FILE:${ORC_LZ4_TARGET}>"
4750+
"-DLZ4_STATIC_LIB=$<TARGET_FILE:${ORC_LZ4_TARGET}>"
4751+
"-DLZ4_INCLUDE_DIR=${ORC_LZ4_INCLUDE_DIR}"
47414752
"-DSNAPPY_INCLUDE_DIR=${ORC_SNAPPY_INCLUDE_DIR}"
47424753
"-DZSTD_HOME=${ORC_ZSTD_ROOT}"
47434754
"-DZSTD_INCLUDE_DIR=$<TARGET_PROPERTY:${ARROW_ZSTD_LIBZSTD},INTERFACE_INCLUDE_DIRECTORIES>"

0 commit comments

Comments
 (0)