Skip to content

Commit

Permalink
arrow: add version 18.0.0 (#25798)
Browse files Browse the repository at this point in the history
* arrow: add version 18.0.0

* Conan v2 refactor

* arrow: fewer versions

---------

Co-authored-by: PerseoGI <[email protected]>
Co-authored-by: Luis Caro Campos <[email protected]>
  • Loading branch information
3 people authored Nov 22, 2024
1 parent 990f70c commit 008313c
Show file tree
Hide file tree
Showing 13 changed files with 81 additions and 1,492 deletions.
110 changes: 8 additions & 102 deletions recipes/arrow/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,29 @@
sources:
"18.0.0":
url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-18.0.0/apache-arrow-18.0.0.tar.gz?action=download"
sha256: "abcf1934cd0cdddd33664e9f2d9a251d6c55239d1122ad0ed223b13a583c82a9"
"17.0.0":
url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-17.0.0/apache-arrow-17.0.0.tar.gz?action=download"
sha256: "9d280d8042e7cf526f8c28d170d93bfab65e50f94569f6a790982a878d8d898d"
"16.1.0":
url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-16.1.0/apache-arrow-16.1.0.tar.gz?action=download"
sha256: "c9e60c7e87e59383d21b20dc874b17153729ee153264af6d21654b7dff2c60d7"
"16.0.0":
url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-16.0.0/apache-arrow-16.0.0.tar.gz?action=download"
sha256: "9f4051ae9473c97991d9af801e2f94ae3455067719ca7f90b8137f9e9a700b8d"
"15.0.0":
url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-15.0.0/apache-arrow-15.0.0.tar.gz?action=download"
sha256: "01dd3f70e85d9b5b933ec92c0db8a4ef504a5105f78d2d8622e84279fb45c25d"
"14.0.2":
url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-14.0.2/apache-arrow-14.0.2.tar.gz?action=download"
sha256: "1304dedb41896008b89fe0738c71a95d9b81752efc77fa70f264cb1da15d9bc2"
"14.0.1":
url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-14.0.1/apache-arrow-14.0.1.tar.gz?action=download"
sha256: "5c70eafb1011f9d124bafb328afe54f62cc5b9280b7080e1e3d668f78c0e407e"
"14.0.0":
url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-14.0.0/apache-arrow-14.0.0.tar.gz?action=download"
sha256: "4eb0da50ec071baf15fc163cb48058931e006f1c862c8def0e180fd07d531021"
"13.0.0":
url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-13.0.0/apache-arrow-13.0.0.tar.gz?action=download"
sha256: "35dfda191262a756be934eef8afee8d09762cad25021daa626eb249e251ac9e6"
"12.0.1":
url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-12.0.1/apache-arrow-12.0.1.tar.gz?action=download"
sha256: "3481c411393aa15c75e88d93cf8315faf7f43e180fe0790128d3840d417de858"
"12.0.0":
url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-12.0.0/apache-arrow-12.0.0.tar.gz?action=download"
sha256: "ddd8347882775e53af7d0965a1902b7d8fcd0a030fd14f783d4f85e821352d52"
"11.0.0":
url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-11.0.0/apache-arrow-11.0.0.tar.gz?action=download"
sha256: "2dd8f0ea0848a58785628ee3a57675548d509e17213a2f5d72b0d900b43f5430"
"10.0.1":
url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-10.0.1/apache-arrow-10.0.1.tar.gz?action=download"
sha256: "c814e0670112a22c1a6ec03ab420a52ae236a9a42e9e438c3cbd37f37e658fb3"
"10.0.0":
url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-10.0.0/apache-arrow-10.0.0.tar.gz?action=download"
sha256: "5b46fa4c54f53e5df0019fe0f9d421e93fc906b625ebe8e89eed010d561f1f12"
"8.0.1":
url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-8.0.1/apache-arrow-8.0.1.tar.gz?action=download"
sha256: "82d46929f7574715551da21700f100b39f99c3c4d6790f26cac86d869d64e94e"
"8.0.0":
url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-8.0.0/apache-arrow-8.0.0.tar.gz?action=download"
sha256: "ad9a05705117c989c116bae9ac70492fe015050e1b80fb0e38fde4b5d863aaa3"
"7.0.0":
url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-7.0.0/apache-arrow-7.0.0.tar.gz?action=download"
sha256: "e8f49b149a15ecef4e40fcfab1b87c113c6b1ee186005c169e5cdf95d31a99de"
patches:
"17.0.0":
- patch_file: "patches/16.0.0-0001-fix-cmake.patch"
"18.0.0":
- patch_file: "patches/18.0.0-0001-fix-cmake.patch"
patch_description: "use cci package"
patch_type: "conan"
"16.1.0":
"17.0.0":
- patch_file: "patches/16.0.0-0001-fix-cmake.patch"
patch_description: "use cci package"
patch_type: "conan"
"16.0.0":
"16.1.0":
- patch_file: "patches/16.0.0-0001-fix-cmake.patch"
patch_description: "use cci package"
patch_type: "conan"
Expand All @@ -68,65 +35,4 @@ patches:
- patch_file: "patches/11.0.0-0001-fix-cmake.patch"
patch_description: "use cci package"
patch_type: "conan"
"14.0.1":
- patch_file: "patches/11.0.0-0001-fix-cmake.patch"
patch_description: "use cci package"
patch_type: "conan"
"14.0.0":
- patch_file: "patches/11.0.0-0001-fix-cmake.patch"
patch_description: "use cci package"
patch_type: "conan"
"13.0.0":
- patch_file: "patches/11.0.0-0001-fix-cmake.patch"
patch_description: "use cci package"
patch_type: "conan"
"12.0.1":
- patch_file: "patches/11.0.0-0001-fix-cmake.patch"
patch_description: "use cci package"
patch_type: "conan"
"12.0.0":
- patch_file: "patches/11.0.0-0001-fix-cmake.patch"
patch_description: "use cci package"
patch_type: "conan"
"11.0.0":
- patch_file: "patches/11.0.0-0001-fix-cmake.patch"
patch_description: "use cci package"
patch_type: "conan"
"8.0.1":
- patch_file: "patches/8.0.0-0001-static-analyzers.patch"
patch_description: "do not look for static analyzers"
patch_type: "conan"
- patch_file: "patches/8.0.0-0002-install-utils.patch"
patch_description: "enable utils installation"
patch_type: "conan"
- patch_file: "patches/8.0.0-0003-fix-cmake.patch"
patch_description: "use cci package"
patch_type: "conan"
- patch_file: "patches/8.0.0-0004-fix-msvc-build.patch"
patch_description: "patch Arrow such that it can be built using MSVC"
patch_type: "backport"
patch_source: "https://github.com/apache/arrow/pull/13108"
"8.0.0":
- patch_file: "patches/8.0.0-0001-static-analyzers.patch"
patch_description: "do not look for static analyzers"
patch_type: "conan"
- patch_file: "patches/8.0.0-0002-install-utils.patch"
patch_description: "enable utils installation"
patch_type: "conan"
- patch_file: "patches/8.0.0-0003-fix-cmake.patch"
patch_description: "use cci package"
patch_type: "conan"
- patch_file: "patches/8.0.0-0004-fix-msvc-build.patch"
patch_description: "patch Arrow such that it can be built using MSVC"
patch_type: "backport"
patch_source: "https://github.com/apache/arrow/pull/13108"
"7.0.0":
- patch_file: "patches/7.0.0-0001-static-analyzers.patch"
patch_description: "do not look for static analyzers"
patch_type: "conan"
- patch_file: "patches/7.0.0-0002-install-utils.patch"
patch_description: "enable utils installation"
patch_type: "conan"
- patch_file: "patches/7.0.0-0003-fix-cmake.patch"
patch_description: "use cci package"
patch_type: "conan"

88 changes: 11 additions & 77 deletions recipes/arrow/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
from conan.errors import ConanInvalidConfiguration, ConanException
from conan.tools.build import check_min_cppstd, cross_building
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save, replace_in_file
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir
from conan.tools.microsoft import is_msvc, is_msvc_static_runtime
from conan.tools.scm import Version

import os
import glob
import textwrap

required_conan_version = ">=1.53.0"
required_conan_version = ">=2.1.0"

class ArrowConan(ConanFile):
name = "arrow"
Expand Down Expand Up @@ -123,21 +122,6 @@ def _min_cppstd(self):
# https://github.com/apache/arrow/pull/13991
return "11" if Version(self.version) < "10.0.0" else "17"

@property
def _compilers_minimum_version(self):
return {
"11": {
"clang": "3.9",
},
"17": {
"gcc": "8",
"clang": "7",
"apple-clang": "10",
"Visual Studio": "15",
"msvc": "191",
},
}.get(self._min_cppstd, {})

def export_sources(self):
export_conandata_patches(self)
copy(self, "conan_cmake_project_include.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src"))
Expand Down Expand Up @@ -247,10 +231,13 @@ def validate(self):
if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, self._min_cppstd)

minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False)
if minimum_version and Version(self.settings.compiler.version) < minimum_version:
if (
Version(self.version) < "10.0.0"
and self.settings.compiler == "clang"
and Version(self.settings.compiler.version) < "3.9"
):
raise ConanInvalidConfiguration(
f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support."
f"{self.ref} requires C++11, which needs at least clang-3.9"
)

if self.options.get_safe("skyhook", False):
Expand Down Expand Up @@ -454,31 +441,10 @@ def package(self):
if self.options.with_flight_rpc:
alias_map[f"ArrowFlight::arrow_flight_sql_{cmake_suffix}"] = f"arrow::arrow_flight_sql_{cmake_suffix}"


self._create_cmake_module_alias_targets(
os.path.join(self.package_folder, self._module_file_rel_path), alias_map
)

def _create_cmake_module_alias_targets(self, module_file, targets):
content = ""
for alias, aliased in targets.items():
content += textwrap.dedent("""\
if(TARGET {aliased} AND NOT TARGET {alias})
add_library({alias} INTERFACE IMPORTED)
set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased})
endif()
""".format(alias=alias, aliased=aliased))
save(self, module_file, content)

@property
def _module_subfolder(self):
return os.path.join("lib", "cmake")

@property
def _module_file_rel_path(self):
return os.path.join(self._module_subfolder,
f"conan-official-{self.name}-targets.cmake")

def package_info(self):
# FIXME: fix CMake targets of components

Expand Down Expand Up @@ -534,6 +500,9 @@ def package_info(self):
self.cpp_info.components["libarrow_flight"].set_property("cmake_target_name", f"ArrowFlight::arrow_flight_{cmake_suffix}")
self.cpp_info.components["libarrow_flight"].libs = [f"arrow_flight{suffix}"]
self.cpp_info.components["libarrow_flight"].requires = ["libarrow"]
# https://github.com/apache/arrow/pull/43137#pullrequestreview-2267476893
if Version(self.version) >= "18.0.0" and self.options.with_openssl:
self.cpp_info.components["libarrow_flight"].requires.append("openssl::openssl")

if self.options.get_safe("with_flight_sql"):
self.cpp_info.components["libarrow_flight_sql"].set_property("pkg_config_name", "flight_sql")
Expand Down Expand Up @@ -616,38 +585,3 @@ def package_info(self):
self.cpp_info.components["libarrow"].requires.append("grpc::grpc")
if self.options.with_flight_rpc:
self.cpp_info.components["libarrow_flight"].requires.append("protobuf::protobuf")

# TODO: to remove in conan v2
self.cpp_info.filenames["cmake_find_package"] = "Arrow"
self.cpp_info.filenames["cmake_find_package_multi"] = "Arrow"
self.cpp_info.components["libarrow"].names["cmake_find_package"] = f"arrow_{cmake_suffix}"
self.cpp_info.components["libarrow"].names["cmake_find_package_multi"] = f"arrow_{cmake_suffix}"
self.cpp_info.components["libarrow"].build_modules["cmake_find_package"] = [self._module_file_rel_path]
self.cpp_info.components["libarrow"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path]
if self.options.parquet:
self.cpp_info.components["libparquet"].names["cmake_find_package"] = f"parquet_{cmake_suffix}"
self.cpp_info.components["libparquet"].names["cmake_find_package_multi"] = f"parquet_{cmake_suffix}"
self.cpp_info.components["libparquet"].build_modules["cmake_find_package"] = [self._module_file_rel_path]
self.cpp_info.components["libparquet"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path]
if self.options.get_safe("substrait"):
self.cpp_info.components["libarrow_substrait"].names["cmake_find_package"] = f"arrow_substrait_{cmake_suffix}"
self.cpp_info.components["libarrow_substrait"].names["cmake_find_package_multi"] = f"arrow_substrait_{cmake_suffix}"
self.cpp_info.components["libarrow_substrait"].build_modules["cmake_find_package"] = [self._module_file_rel_path]
self.cpp_info.components["libarrow_substrait"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path]
if self.options.gandiva:
self.cpp_info.components["libgandiva"].names["cmake_find_package"] = "gandiva"
self.cpp_info.components["libgandiva"].names["cmake_find_package_multi"] = "gandiva"
self.cpp_info.components["libgandiva"].build_modules["cmake_find_package"] = [self._module_file_rel_path]
self.cpp_info.components["libgandiva"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path]
if self.options.with_flight_rpc:
self.cpp_info.components["libarrow_flight"].names["cmake_find_package"] = "flight_rpc"
self.cpp_info.components["libarrow_flight"].names["cmake_find_package_multi"] = "flight_rpc"
self.cpp_info.components["libarrow_flight"].build_modules["cmake_find_package"] = [self._module_file_rel_path]
self.cpp_info.components["libarrow_flight"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path]
if self.options.get_safe("with_flight_sql"):
self.cpp_info.components["libarrow_flight_sql"].names["cmake_find_package"] = "flight_sql"
self.cpp_info.components["libarrow_flight_sql"].names["cmake_find_package_multi"] = "flight_sql"
self.cpp_info.components["libarrow_flight_sql"].build_modules["cmake_find_package"] = [self._module_file_rel_path]
self.cpp_info.components["libarrow_flight_sql"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path]
if self.options.cli and (self.options.with_cuda or self.options.with_flight_rpc or self.options.parquet):
self.env_info.PATH.append(os.path.join(self.package_folder, "bin"))
59 changes: 59 additions & 0 deletions recipes/arrow/all/patches/18.0.0-0001-fix-cmake.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
diff --git a/cpp/cmake_modules/FindThriftAlt.cmake b/cpp/cmake_modules/FindThriftAlt.cmake
index 98a706d..edf195e 100644
--- a/cpp/cmake_modules/FindThriftAlt.cmake
+++ b/cpp/cmake_modules/FindThriftAlt.cmake
@@ -45,22 +45,20 @@ endif()
# * https://github.com/apache/thrift/pull/2725
# * https://github.com/apache/thrift/pull/2726
# * https://github.com/conda-forge/thrift-cpp-feedstock/issues/68
-if(NOT WIN32)
- set(find_package_args "")
- if(ThriftAlt_FIND_VERSION)
- list(APPEND find_package_args ${ThriftAlt_FIND_VERSION})
- endif()
- if(ThriftAlt_FIND_QUIETLY)
- list(APPEND find_package_args QUIET)
- endif()
- find_package(Thrift ${find_package_args})
- if(Thrift_FOUND)
- set(ThriftAlt_FOUND TRUE)
- add_executable(thrift::compiler IMPORTED)
- set_target_properties(thrift::compiler PROPERTIES IMPORTED_LOCATION
- "${THRIFT_COMPILER}")
- return()
- endif()
+set(find_package_args "")
+if(ThriftAlt_FIND_VERSION)
+ list(APPEND find_package_args ${ThriftAlt_FIND_VERSION})
+endif()
+if(ThriftAlt_FIND_QUIETLY)
+ list(APPEND find_package_args QUIET)
+endif()
+find_package(Thrift ${find_package_args})
+if(Thrift_FOUND)
+ set(ThriftAlt_FOUND TRUE)
+ add_executable(thrift::compiler IMPORTED)
+ set_target_properties(thrift::compiler PROPERTIES IMPORTED_LOCATION
+ "${THRIFT_COMPILER}")
+ return()
endif()

function(extract_thrift_version)
diff --git a/cpp/src/parquet/CMakeLists.txt b/cpp/src/parquet/CMakeLists.txt
index b984ef7..429fc6d 100644
--- a/cpp/src/parquet/CMakeLists.txt
+++ b/cpp/src/parquet/CMakeLists.txt
@@ -263,11 +263,11 @@ if(NOT PARQUET_MINIMAL_DEPENDENCY)

# These are libraries that we will link privately with parquet_shared (as they
# do not need to be linked transitively by other linkers)
- list(APPEND PARQUET_SHARED_PRIVATE_LINK_LIBS thrift::thrift)
+ list(APPEND PARQUET_SHARED_PRIVATE_LINK_LIBS Boost::headers thrift::thrift)

# Link publicly with parquet_static (because internal users need to
# transitively link all dependencies)
- list(APPEND PARQUET_STATIC_LINK_LIBS thrift::thrift)
+ list(APPEND PARQUET_STATIC_LINK_LIBS Boost::headers thrift::thrift)
if(NOT THRIFT_VENDORED)
list(APPEND PARQUET_STATIC_INSTALL_INTERFACE_LIBS thrift::thrift)
endif()
17 changes: 0 additions & 17 deletions recipes/arrow/all/patches/7.0.0-0001-static-analyzers.patch

This file was deleted.

17 changes: 0 additions & 17 deletions recipes/arrow/all/patches/7.0.0-0002-install-utils.patch

This file was deleted.

Loading

0 comments on commit 008313c

Please sign in to comment.