diff --git a/.env b/.env index fd3ce26887c..5c73161ac10 100644 --- a/.env +++ b/.env @@ -93,6 +93,14 @@ DEVTOOLSET_VERSION=-1 # Please also update the crossbow configuration in order to keep the github # actions cache up to date for the macOS wheels: # https://github.com/ursacomputing/crossbow/blob/master/.github/workflows/cache_vcpkg.yml -# After commit 89295c9 openssl is only available as 3.0.2 which is -# incompatible with aws-sdk-cpp 1.8.3 see https://github.com/aws/aws-sdk-cpp/issues/1582 and causes issues on manylinux2010 +# +# After commit 89295c9 openssl is only available as 3.0.2 which is +# incompatible with aws-sdk-cpp 1.8.3 see +# https://github.com/aws/aws-sdk-cpp/issues/1582 and causes issues on +# manylinux2010 VCPKG="89295c9" + +# Use conanio/${CONAN} for "docker-compose run --rm conan". See +# https://github.com/conan-io/conan-docker-tools#readme for available +# images. +CONAN=gcc11 diff --git a/LICENSE.txt b/LICENSE.txt index 8fe852f20bd..ec00d3a7293 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -2256,3 +2256,27 @@ distributions. opentelemetry-cpp is made available under the Apache License 2.0. Copyright The OpenTelemetry Authors SPDX-License-Identifier: Apache-2.0 + +-------------------------------------------------------------------------------- + +ci/conan/ is based on code from Conan Package and Dependency Manager. + +Copyright (c) 2019 Conan.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/ci/conan/.gitignore b/ci/conan/.gitignore new file mode 100644 index 00000000000..0c6872560be --- /dev/null +++ b/ci/conan/.gitignore @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +/all/test_package/build/ diff --git a/ci/conan/all/CMakeLists.txt b/ci/conan/all/CMakeLists.txt new file mode 100644 index 00000000000..cb849a6633c --- /dev/null +++ b/ci/conan/all/CMakeLists.txt @@ -0,0 +1,29 @@ +# MIT License +# +# Copyright (c) 2019 Conan.io +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder/cpp) diff --git a/ci/conan/all/conandata.yml b/ci/conan/all/conandata.yml new file mode 100644 index 00000000000..1e32a6f4468 --- /dev/null +++ b/ci/conan/all/conandata.yml @@ -0,0 +1,68 @@ +# MIT License +# +# Copyright (c) 2019 Conan.io +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +sources: + "7.0.0": + url: "https://github.com/apache/arrow/archive/apache-arrow-7.0.0.tar.gz" + sha256: "57e13c62f27b710e1de54fd30faed612aefa22aa41fa2c0c3bacd204dd18a8f3" + "2.0.0": + url: "https://github.com/apache/arrow/archive/apache-arrow-2.0.0.tar.gz" + sha256: "ea299df9cf440cfc43393ce12ee6d9a4c9d0dfa9fde33c3bc9b70ec25520a844" + "1.0.0": + url: "https://github.com/apache/arrow/archive/apache-arrow-1.0.0.tar.gz" + sha256: "08fbd4c633c08939850d619ca0224c75d7a0526467c721c0838b8aa7efccb270" +patches: + "7.0.0": + - base_path: "source_subfolder" + patch_file: "patches/7.0.0-0001-cmake.patch" + - base_path: "source_subfolder" + patch_file: "patches/7.0.0-0002-jemalloc.patch" + - base_path: "source_subfolder" + patch_file: "patches/7.0.0-0003-mallctl-takes-size_t.patch" + - base_path: "source_subfolder" + patch_file: "patches/7.0.0-0004-remove-find-modules.patch" + - base_path: "source_subfolder" + patch_file: "patches/7.0.0-0005-use-find-package.patch" + "2.0.0": + - base_path: "source_subfolder" + patch_file: "patches/2.0.0-0001-cmake.patch" + - base_path: "source_subfolder" + patch_file: "patches/2.0.0-0002-jemalloc.patch" + - base_path: "source_subfolder" + patch_file: "patches/2.0.0-0003-fix-shared-msvc.patch" + - base_path: "source_subfolder" + patch_file: "patches/1.0.0-0004-mallctl-takes-size_t.patch" + - base_path: "source_subfolder" + patch_file: "patches/2.0.0-0005-gandiva-engine.patch" + - base_path: "source_subfolder" + patch_file: "patches/2.0.0-0006-gandiva-llvm-re2.patch" + - base_path: "source_subfolder" + patch_file: "patches/2.0.0-0007-fix-protoc-cmake.patch" + "1.0.0": + - base_path: "source_subfolder" + patch_file: "patches/1.0.0-0001-cmake.patch" + - base_path: "source_subfolder" + patch_file: "patches/1.0.0-0002-jemalloc.patch" + - base_path: "source_subfolder" + patch_file: "patches/1.0.0-0003-fix-shared-msvc.patch" + - base_path: "source_subfolder" + patch_file: "patches/1.0.0-0004-mallctl-takes-size_t.patch" diff --git a/ci/conan/all/conanfile.py b/ci/conan/all/conanfile.py new file mode 100644 index 00000000000..0edbb947815 --- /dev/null +++ b/ci/conan/all/conanfile.py @@ -0,0 +1,584 @@ +# MIT License +# +# Copyright (c) 2019 Conan.io +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +from conans import ConanFile, tools, CMake +from conans.errors import ConanInvalidConfiguration +import os + + +required_conan_version = ">=1.33.0" + + +class ArrowConan(ConanFile): + name = "arrow" + description = "Apache Arrow is a cross-language development platform for in-memory data" + topics = ("arrow", "memory") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://arrow.apache.org/" + license = ("Apache-2.0",) + generators = "cmake", "cmake_find_package_multi" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "gandiva": [True, False], + "parquet": [True, False], + "plasma": [True, False], + "cli": [True, False], + "compute": ["auto", True, False], + "dataset_modules": [True, False], + "deprecated": [True, False], + "encryption": [True, False], + "filesystem_layer": [True, False], + "hdfs_bridgs": [True, False], + "simd_level": [None, "default", "sse4_2", "avx2", "avx512", "neon", ], + "runtime_simd_level": [None, "sse4_2", "avx2", "avx512", "max"], + "with_backtrace": [True, False], + "with_boost": ["auto", True, False], + "with_csv": [True, False], + "with_cuda": [True, False], + "with_flight_rpc": [True, False], + "with_gflags": ["auto", True, False], + "with_glog": ["auto", True, False], + "with_grpc": ["auto", True, False], + "with_hiveserver2": [True, False], + "with_jemalloc": ["auto", True, False], + "with_json": [True, False], + "with_llvm": ["auto", True, False], + "with_openssl": ["auto", True, False], + "with_orc": [True, False], + "with_protobuf": ["auto", True, False], + "with_re2": ["auto", True, False], + "with_s3": [True, False], + "with_utf8proc": ["auto", True, False], + "with_brotli": [True, False], + "with_bz2": [True, False], + "with_lz4": [True, False], + "with_snappy": [True, False], + "with_zlib": [True, False], + "with_zstd": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "gandiva": False, + "parquet": False, + "plasma": False, + "cli": False, + "compute": "auto", + "dataset_modules": False, + "deprecated": True, + "encryption": False, + "filesystem_layer": False, + "hdfs_bridgs": False, + "simd_level": "default", + "runtime_simd_level": "max", + "with_backtrace": False, + "with_boost": "auto", + "with_brotli": False, + "with_bz2": False, + "with_csv": False, + "with_cuda": False, + "with_flight_rpc": False, + "with_gflags": "auto", + "with_jemalloc": "auto", + "with_glog": "auto", + "with_grpc": "auto", + "with_hiveserver2": False, + "with_json": False, + "with_llvm": "auto", + "with_openssl": "auto", + "with_orc": False, + "with_protobuf": "auto", + "with_re2": "auto", + "with_s3": False, + "with_utf8proc": "auto", + "with_lz4": False, + "with_snappy": False, + "with_zlib": False, + "with_zstd": False, + } + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def export_sources(self): + self.copy("CMakeLists.txt") + for patch in self.conan_data.get("patches", {}).get(self.version, []): + self.copy(patch["patch_file"]) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if tools.Version(self.version) < "2.0.0": + del self.options.simd_level + del self.options.runtime_simd_level + elif tools.Version(self.version) < "6.0.0": + self.options.simd_level = "sse4_2" + + def validate(self): + if self.settings.compiler == "clang" and self.settings.compiler.version <= tools.Version("3.9"): + raise ConanInvalidConfiguration("This recipe does not support this compiler version") + + if self.options.shared: + del self.options.fPIC + if self.options.compute == False and not self._compute(True): + raise ConanInvalidConfiguration("compute options is required (or choose auto)") + if self.options.with_jemalloc == False and self._with_jemalloc(True): + raise ConanInvalidConfiguration("with_jemalloc option is required (or choose auto)") + if self.options.with_re2 == False and self._with_re2(True): + raise ConanInvalidConfiguration("with_re2 option is required (or choose auto)") + if self.options.with_protobuf == False and self._with_protobuf(True): + raise ConanInvalidConfiguration("with_protobuf option is required (or choose auto)") + if self.options.with_gflags == False and self._with_gflags(True): + raise ConanInvalidConfiguration("with_gflags options is required (or choose auto)") + if self.options.with_grpc == False and self._with_grpc(True): + raise ConanInvalidConfiguration("with_grpc options is required (or choose auto)") + if self.options.with_boost == False and self._with_boost(True): + raise ConanInvalidConfiguration("with_boost options is required (or choose auto)") + if self.options.with_openssl == False and self._with_openssl(True): + raise ConanInvalidConfiguration("with_openssl options is required (or choose auto)") + if self.options.with_llvm == False and self._with_llvm(True): + raise ConanInvalidConfiguration("with_openssl options is required (or choose auto)") + if self.options.with_cuda: + raise ConanInvalidConfiguration("CCI has no cuda recipe (yet)") + if self.options.with_hiveserver2: + raise ConanInvalidConfiguration("CCI has no hiveserver2 recipe (yet)") + if self.options.with_orc: + raise ConanInvalidConfiguration("CCI has no orc recipe (yet)") + + if self.options.shared and self._with_jemalloc(): + if self.options["jemalloc"].enable_cxx: + raise ConanInvalidConfiguration("jemmalloc.enable_cxx of a static jemalloc must be disabled") + + if tools.Version(self.version) < "6.0.0" and self.options.get_safe("simd_level") == "default": + raise ConanInvalidConfiguration("In {}/{}, simd_level options is not supported `default` value.".format(self.name, self.version)) + + def _compute(self, required=False): + if required or self.options.compute == "auto": + return bool(self.options.dataset_modules) + else: + return bool(self.options.compute) + + def _with_jemalloc(self, required=False): + if required or self.options.with_jemalloc == "auto": + return bool("BSD" in str(self.settings.os)) + else: + return bool(self.options.with_jemalloc) + + def _with_re2(self, required=False): + if required or self.options.with_re2 == "auto": + return bool(self.options.gandiva) + else: + return bool(self.options.with_re2) + + def _with_protobuf(self, required=False): + if required or self.options.with_protobuf == "auto": + return bool(self.options.gandiva or self.options.with_flight_rpc or self.options.with_orc) + else: + return bool(self.options.with_protobuf) + + def _with_gflags(self, required=False): + if required or self.options.with_gflags == "auto": + return bool(self.options.plasma or self._with_glog() or self._with_grpc()) + else: + return bool(self.options.with_gflags) + + def _with_glog(self, required=False): + if required or self.options.with_glog == "auto": + return False + else: + return bool(self.options.with_glog) + + def _with_grpc(self, required=False): + if required or self.options.with_grpc == "auto": + return bool(self.options.with_flight_rpc) + else: + return bool(self.options.with_grpc) + + def _with_boost(self, required=False): + if required or self.options.with_boost == "auto": + if self.options.gandiva: + return True + version = tools.Version(self.version) + if version.major == "1": + if self.options.parquet and self.settings.compiler == "gcc" and self.settings.compiler.version < tools.Version("4.9"): + return True + elif version.major >= "2": + if self.settings.compiler == "Visual Studio": + return True + return False + else: + return bool(self.options.with_boost) + + def _with_thrift(self, required=False): + # No self.options.with_thift exists + return bool(required or self.options.with_hiveserver2 or self.options.parquet) + + def _with_utf8proc(self, required=False): + if required or self.options.with_utf8proc == "auto": + return False + else: + return bool(self.options.with_utf8proc) + + def _with_llvm(self, required=False): + if required or self.options.with_llvm == "auto": + return bool(self.options.gandiva) + else: + return bool(self.options.with_openssl) + + def _with_openssl(self, required=False): + if required or self.options.with_openssl == "auto": + return bool(self.options.encryption or self.options.with_flight_rpc or self.options.with_s3) + else: + return bool(self.options.with_openssl) + + def requirements(self): + if self._with_thrift(): + self.requires("thrift/0.15.0") + if self._with_protobuf(): + self.requires("protobuf/3.19.2") + if self._with_jemalloc(): + self.requires("jemalloc/5.2.1") + if self._with_boost(): + self.requires("boost/1.78.0") + if self._with_gflags(): + self.requires("gflags/2.2.2") + if self._with_glog(): + self.requires("glog/0.5.0") + if self._with_grpc(): + self.requires("grpc/1.44.0") + if self.options.with_json: + self.requires("rapidjson/1.1.0") + if self._with_llvm(): + self.requires("llvm-core/13.0.0") + if self._with_openssl(): + self.requires("openssl/1.1.1m") + if self.options.with_s3: + self.requires("aws-sdk-cpp/1.9.100") + if self.options.with_brotli: + self.requires("brotli/1.0.9") + if self.options.with_bz2: + self.requires("bzip2/1.0.8") + if self.options.with_lz4: + self.requires("lz4/1.9.3") + if self.options.with_snappy: + self.requires("snappy/1.1.9") + if tools.Version(self.version) >= "6.0.0" and \ + self.options.get_safe("simd_level") != None or \ + self.options.get_safe("runtime_simd_level") != None: + if tools.Version(self.version) >= "8.0.0": + # TODO: Requires xsimd/master + pass + else: + self.requires("xsimd/8.0.3") + if self.options.with_zlib: + self.requires("zlib/1.2.11") + if self.options.with_zstd: + self.requires("zstd/1.5.2") + if self._with_re2(): + self.requires("re2/20211101") + if self._with_utf8proc(): + self.requires("utf8proc/2.7.0") + if self.options.with_backtrace: + self.requires("libbacktrace/cci.20210118") + + def source(self): + # START + # This block should be removed when we update upstream: + # https://github.com/conan-io/conan-center-index/tree/master/recipes/arrow/ + if not self.version in self.conan_data.get("sources", {}): + import shutil + top_level = os.environ.get("ARROW_HOME") + shutil.copytree(os.path.join(top_level, "cpp"), + os.path.join(self._source_subfolder, "cpp")) + top_level_files = [ + ".env", + "LICENSE.txt", + "NOTICE.txt", + ] + for top_level_file in top_level_files: + shutil.copy(os.path.join(top_level, top_level_file), + self._source_subfolder) + return + # END + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + if tools.cross_building(self): + cmake_system_processor = { + "armv8": "aarch64", + "armv8.3": "aarch64", + }.get(str(self.settings.arch), str(self.settings.arch)) + self._cmake.definitions["CMAKE_SYSTEM_PROCESSOR"] = cmake_system_processor + if self.settings.compiler == "Visual Studio": + self._cmake.definitions["ARROW_USE_STATIC_CRT"] = "MT" in str(self.settings.compiler.runtime) + self._cmake.definitions["ARROW_DEPENDENCY_SOURCE"] = "SYSTEM" + self._cmake.definitions["ARROW_GANDIVA"] = self.options.gandiva + self._cmake.definitions["ARROW_PARQUET"] = self.options.parquet + self._cmake.definitions["ARROW_PLASMA"] = self.options.plasma + self._cmake.definitions["ARROW_DATASET"] = self.options.dataset_modules + self._cmake.definitions["ARROW_FILESYSTEM"] = self.options.filesystem_layer + self._cmake.definitions["PARQUET_REQUIRE_ENCRYPTION"] = self.options.encryption + self._cmake.definitions["ARROW_HDFS"] = self.options.hdfs_bridgs + self._cmake.definitions["ARROW_VERBOSE_THIRDPARTY_BUILD"] = True + self._cmake.definitions["ARROW_BUILD_SHARED"] = self.options.shared + self._cmake.definitions["ARROW_BUILD_STATIC"] = not self.options.shared + self._cmake.definitions["ARROW_NO_DEPRECATED_API"] = not self.options.deprecated + self._cmake.definitions["ARROW_FLIGHT"] = self.options.with_flight_rpc + self._cmake.definitions["ARROW_HIVESERVER2"] = self.options.with_hiveserver2 + self._cmake.definitions["ARROW_COMPUTE"] = self._compute() + self._cmake.definitions["ARROW_CSV"] = self.options.with_csv + self._cmake.definitions["ARROW_CUDA"] = self.options.with_cuda + self._cmake.definitions["ARROW_JEMALLOC"] = self._with_jemalloc() + self._cmake.definitions["ARROW_JSON"] = self.options.with_json + + self._cmake.definitions["BOOST_SOURCE"] = "SYSTEM" + self._cmake.definitions["Protobuf_SOURCE"] = "SYSTEM" + if self._with_protobuf(): + self._cmake.definitions["ARROW_PROTOBUF_USE_SHARED"] = self.options["protobuf"].shared + self._cmake.definitions["gRPC_SOURCE"] = "SYSTEM" + if self._with_grpc(): + self._cmake.definitions["ARROW_GRPC_USE_SHARED"] = self.options["grpc"].shared + self._cmake.definitions["ARROW_HDFS"] = self.options.hdfs_bridgs + self._cmake.definitions["ARROW_USE_GLOG"] = self._with_glog() + self._cmake.definitions["GLOG_SOURCE"] = "SYSTEM" + self._cmake.definitions["ARROW_WITH_BACKTRACE"] = self.options.with_backtrace + self._cmake.definitions["ARROW_WITH_BROTLI"] = self.options.with_brotli + self._cmake.definitions["Brotli_SOURCE"] = "SYSTEM" + if self.options.with_brotli: + self._cmake.definitions["ARROW_BROTLI_USE_SHARED"] = self.options["brotli"].shared + self._cmake.definitions["gflags_SOURCE"] = "SYSTEM" + if self._with_gflags(): + self._cmake.definitions["ARROW_BROTLI_USE_SHARED"] = self.options["gflags"].shared + self._cmake.definitions["ARROW_WITH_BZ2"] = self.options.with_bz2 + self._cmake.definitions["BZip2_SOURCE"] = "SYSTEM" + if self.options.with_bz2: + self._cmake.definitions["ARROW_BZ2_USE_SHARED"] = self.options["bzip2"].shared + self._cmake.definitions["ARROW_WITH_LZ4"] = self.options.with_lz4 + self._cmake.definitions["Lz4_SOURCE"] = "SYSTEM" + if self.options.with_lz4: + self._cmake.definitions["ARROW_LZ4_USE_SHARED"] = self.options["lz4"].shared + self._cmake.definitions["ARROW_WITH_SNAPPY"] = self.options.with_snappy + self._cmake.definitions["Snappy_SOURCE"] = "SYSTEM" + if self.options.with_snappy: + self._cmake.definitions["ARROW_SNAPPY_USE_SHARED"] = self.options["snappy"].shared + self._cmake.definitions["ARROW_WITH_ZLIB"] = self.options.with_zlib + self._cmake.definitions["RE2_SOURCE"] = "SYSTEM" + self._cmake.definitions["ZLIB_SOURCE"] = "SYSTEM" + + self._cmake.definitions["ARROW_WITH_ZSTD"] = self.options.with_zstd + if tools.Version(self.version) >= "2.0": + self._cmake.definitions["zstd_SOURCE"] = "SYSTEM" + self._cmake.definitions["ARROW_SIMD_LEVEL"] = str(self.options.simd_level).upper() + self._cmake.definitions["ARROW_RUNTIME_SIMD_LEVEL"] = str(self.options.runtime_simd_level).upper() + else: + self._cmake.definitions["ZSTD_SOURCE"] = "SYSTEM" + if self.options.with_zstd: + self._cmake.definitions["ARROW_ZSTD_USE_SHARED"] = self.options["zstd"].shared + self._cmake.definitions["ORC_SOURCE"] = "SYSTEM" + self._cmake.definitions["ARROW_WITH_THRIFT"] = self._with_thrift() + self._cmake.definitions["Thrift_SOURCE"] = "SYSTEM" + self._cmake.definitions["THRIFT_VERSION"] = "1.0" # a recent thrift does not require boost + if self._with_thrift(): + self._cmake.definitions["ARROW_THRIFT_USE_SHARED"] = self.options["thrift"].shared + self._cmake.definitions["ARROW_USE_OPENSSL"] = self._with_openssl() + if self._with_openssl(): + self._cmake.definitions["OPENSSL_ROOT_DIR"] = self.deps_cpp_info["openssl"].rootpath.replace("\\", "/") + self._cmake.definitions["ARROW_OPENSSL_USE_SHARED"] = self.options["openssl"].shared + if self._with_boost(): + self._cmake.definitions["ARROW_BOOST_USE_SHARED"] = self.options["boost"].shared + self._cmake.definitions["ARROW_S3"] = self.options.with_s3 + self._cmake.definitions["AWSSDK_SOURCE"] = "SYSTEM" + + self._cmake.definitions["ARROW_BUILD_UTILITIES"] = self.options.cli + self._cmake.definitions["ARROW_BUILD_INTEGRATION"] = False + self._cmake.definitions["ARROW_INSTALL_NAME_RPATH"] = False + self._cmake.definitions["ARROW_BUILD_EXAMPLES"] = False + self._cmake.definitions["ARROW_BUILD_TESTS"] = False + self._cmake.definitions["ARROW_ENABLE_TIMING_TESTS"] = False + self._cmake.definitions["ARROW_BUILD_BENCHMARKS"] = False + self._cmake.definitions["LLVM_SOURCE"] = "SYSTEM" + self._cmake.definitions["ARROW_WITH_UTF8PROC"] = self._with_utf8proc() + self._cmake.definitions["utf8proc_SOURCE"] = "SYSTEM" + if self._with_utf8proc(): + self._cmake.definitions["ARROW_UTF8PROC_USE_SHARED"] = self.options["utf8proc"].shared + self._cmake.definitions["BUILD_WARNING_LEVEL"] = "PRODUCTION" + if self.settings.compiler == "Visual Studio": + self._cmake.definitions["ARROW_USE_STATIC_CRT"] = "MT" in str(self.settings.compiler.runtime) + + if self._with_llvm(): + self._cmake.definitions["LLVM_DIR"] = self.deps_cpp_info["llvm-core"].rootpath.replace("\\", "/") + self._cmake.configure() + return self._cmake + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE.txt", src=self._source_subfolder, dst="licenses") + self.copy("NOTICE.txt", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "share")) + + def _lib_name(self, name): + if self.settings.compiler == "Visual Studio" and not self.options.shared: + return "{}_static".format(name) + else: + return "{}".format(name) + + def package_id(self): + self.info.options.with_jemalloc = self._with_jemalloc() + self.info.options.with_gflags = self._with_gflags() + self.info.options.with_protobuf = self._with_protobuf() + self.info.options.with_re2 = self._with_re2() + self.info.options.with_jemalloc = self._with_jemalloc() + self.info.options.with_openssl = self._with_openssl() + self.info.options.with_boost = self._with_boost() + self.info.options.with_glog = self._with_glog() + self.info.options.with_grpc = self._with_grpc() + + def package_info(self): + self.cpp_info.filenames["cmake_find_package"] = "Arrow" + self.cpp_info.filenames["cmake_find_package_multi"] = "Arrow" + self.cpp_info.components["libarrow"].libs = [self._lib_name("arrow")] + self.cpp_info.components["libarrow"].names["cmake_find_package"] = "arrow" + self.cpp_info.components["libarrow"].names["cmake_find_package_multi"] = "arrow" + self.cpp_info.components["libarrow"].names["pkg_config"] = "arrow" + if not self.options.shared: + self.cpp_info.components["libarrow"].defines = ["ARROW_STATIC"] + if self.settings.os == "Linux": + self.cpp_info.components["libarrow"].system_libs = ["pthread"] + + if self.options.parquet: + self.cpp_info.components["libparquet"].libs = [self._lib_name("parquet")] + self.cpp_info.components["libparquet"].names["cmake_find_package"] = "parquet" + self.cpp_info.components["libparquet"].names["cmake_find_package_multi"] = "parquet" + self.cpp_info.components["libparquet"].names["pkg_config"] = "parquet" + self.cpp_info.components["libparquet"].requires = ["libarrow"] + + if self.options.plasma: + self.cpp_info.components["libplasma"].libs = [self._lib_name("plasma")] + self.cpp_info.components["libplasma"].names["cmake_find_package"] = "plasma" + self.cpp_info.components["libplasma"].names["cmake_find_package_multi"] = "plasma" + self.cpp_info.components["libplasma"].names["pkg_config"] = "plasma" + self.cpp_info.components["libplasma"].requires = ["libarrow"] + + if self.options.gandiva: + self.cpp_info.components["libgandiva"].libs = [self._lib_name("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"].names["pkg_config"] = "gandiva" + self.cpp_info.components["libgandiva"].requires = ["libarrow"] + + if self.options.with_flight_rpc: + self.cpp_info.components["libarrow_flight"].libs = [self._lib_name("arrow_flight")] + 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"].names["pkg_config"] = "flight_rpc" + self.cpp_info.components["libarrow_flight"].requires = ["libarrow"] + + if self.options.dataset_modules: + self.cpp_info.components["dataset"].libs = ["arrow_dataset"] + + if self.options.cli: + binpath = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH env var: {}".format(binpath)) + self.env_info.PATH.append(binpath) + + if self._with_boost(): + if self.options.gandiva: + # FIXME: only filesystem component is used + self.cpp_info.components["libgandiva"].requires.append("boost::boost") + if self.options.parquet and self.settings.compiler == "gcc" and self.settings.compiler.version < tools.Version("4.9"): + self.cpp_info.components["libparquet"].requires.append("boost::boost") + if tools.Version(self.version) >= "2.0": + # FIXME: only headers components is used + self.cpp_info.components["libarrow"].requires.append("boost::boost") + if self._with_openssl(): + self.cpp_info.components["libarrow"].requires.append("openssl::openssl") + if self._with_gflags(): + self.cpp_info.components["libarrow"].requires.append("gflags::gflags") + if self._with_glog(): + self.cpp_info.components["libarrow"].requires.append("glog::glog") + if self._with_jemalloc(): + self.cpp_info.components["libarrow"].requires.append("jemalloc::jemalloc") + if self._with_re2(): + self.cpp_info.components["libgandiva"].requires.append("re2::re2") + if self._with_llvm(): + self.cpp_info.components["libgandiva"].requires.append("llvm-core::llvm-core") + if self._with_protobuf(): + self.cpp_info.components["libarrow"].requires.append("protobuf::protobuf") + if self._with_utf8proc(): + self.cpp_info.components["libarrow"].requires.append("uff8proc::uff8proc") + if self._with_thrift(): + self.cpp_info.components["libarrow"].requires.append("thrift::thrift") + if self.options.with_backtrace: + self.cpp_info.components["libarrow"].requires.append("libbacktrace::libbacktrace") + if self.options.with_cuda: + self.cpp_info.components["libarrow"].requires.append("cuda::cuda") + if self.options.with_hiveserver2: + self.cpp_info.components["libarrow"].requires.append("hiveserver2::hiveserver2") + if self.options.with_json: + self.cpp_info.components["libarrow"].requires.append("rapidjson::rapidjson") + if self.options.with_s3: + self.cpp_info.components["libarrow"].requires.append("aws-sdk-cpp::filesystem") + if self.options.with_orc: + self.cpp_info.components["libarrow"].requires.append("orc::orc") + if self.options.with_brotli: + self.cpp_info.components["libarrow"].requires.append("brotli::brotli") + if self.options.with_bz2: + self.cpp_info.components["libarrow"].requires.append("bzip2::bzip2") + if self.options.with_lz4: + self.cpp_info.components["libarrow"].requires.append("lz4::lz4") + if self.options.with_snappy: + self.cpp_info.components["libarrow"].requires.append("snappy::snappy") + if self.options.get_safe("simd_level") != None or self.options.get_safe("runtime_simd_level") != None: + if tools.Version(self.version) >= "8.0.0": + # Requires xsimd/master + pass + else: + self.cpp_info.components["libarrow"].requires.append("xsimd::xsimd") + if self.options.with_zlib: + self.cpp_info.components["libarrow"].requires.append("zlib::zlib") + if self.options.with_zstd: + self.cpp_info.components["libarrow"].requires.append("zstd::zstd") + if self.options.with_flight_rpc: + self.cpp_info.components["libarrow_flight"].requires.append("grpc::grpc") + self.cpp_info.components["libarrow_flight"].requires.append("protobuf::protobuf") diff --git a/ci/conan/all/patches/1.0.0-0001-cmake.patch b/ci/conan/all/patches/1.0.0-0001-cmake.patch new file mode 100644 index 00000000000..9da894a127b --- /dev/null +++ b/ci/conan/all/patches/1.0.0-0001-cmake.patch @@ -0,0 +1,114 @@ +MIT License + +Copyright (c) 2019 Conan.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- cpp/cmake_modules/DefineOptions.cmake ++++ cpp/cmake_modules/DefineOptions.cmake +@@ -76,7 +76,7 @@ macro(define_option_string name description default) + endmacro() + + # Top level cmake dir +-if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") ++if(1) + #---------------------------------------------------------------------- + set_option_category("Compile and link") + +--- cpp/cmake_modules/ThirdpartyToolchain.cmake ++++ cpp/cmake_modules/ThirdpartyToolchain.cmake +@@ -854,7 +854,7 @@ if(ARROW_WITH_SNAPPY) + # location. + # https://bugzilla.redhat.com/show_bug.cgi?id=1679727 + # https://src.fedoraproject.org/rpms/snappy/pull-request/1 +- find_package(Snappy QUIET HINTS "${CMAKE_ROOT}/Modules/") ++ find_package(Snappy REQUIRED) + if(NOT Snappy_FOUND) + find_package(SnappyAlt) + endif() +@@ -866,7 +866,7 @@ + elseif(Snappy_SOURCE STREQUAL "SYSTEM") + # SnappyConfig.cmake is not installed on Ubuntu/Debian + # TODO: Make a bug report upstream +- find_package(Snappy HINTS "${CMAKE_ROOT}/Modules/") ++ find_package(Snappy REQUIRED) + if(NOT Snappy_FOUND) + find_package(SnappyAlt REQUIRED) + endif() +@@ -1139,8 +1139,8 @@ + build_gflags() + elseif(gflags_SOURCE STREQUAL "SYSTEM") +- # gflagsConfig.cmake is not installed on Ubuntu/Debian +- # TODO: Make a bug report upstream +- find_package(gflags ${ARROW_GFLAGS_REQUIRED_VERSION}) ++ find_package(gflags REQUIRED) ++ add_library(gflags-shared INTERFACE) ++ target_link_libraries(gflags-shared INTERFACE gflags::gflags) + if(NOT gflags_FOUND) + find_package(gflagsAlt ${ARROW_GFLAGS_REQUIRED_VERSION} REQUIRED) + endif() +@@ -1329,6 +1329,6 @@ macro(build_protobuf) + endmacro() +- + if(ARROW_WITH_PROTOBUF) ++ find_package(Protobuf REQUIRED) + if(ARROW_WITH_GRPC) + # gRPC 1.21.0 or later require Protobuf 3.7.0 or later. + set(ARROW_PROTOBUF_REQUIRED_VERSION "3.7.0") +@@ -1365,9 +1365,9 @@ if(ARROW_WITH_PROTOBUF) + set(ARROW_PROTOBUF_LIBPROTOC arrow::protobuf::libprotoc) + else() + if(NOT TARGET protobuf::libprotoc) ++ set(Protobuf_PROTOC_LIBRARY protoc) + if(PROTOBUF_PROTOC_LIBRARY AND NOT Protobuf_PROTOC_LIBRARY) +- # Old CMake versions have a different casing. +- set(Protobuf_PROTOC_LIBRARY ${PROTOBUF_PROTOC_LIBRARY}) ++ set(Protobuf_PROTOC_LIBRARY protoc) + endif() + if(NOT Protobuf_PROTOC_LIBRARY) + message(FATAL_ERROR "libprotoc was set to ${Protobuf_PROTOC_LIBRARY}") +@@ -1802,7 +1802,7 @@ if(ARROW_WITH_RAPIDJSON) + elseif(RapidJSON_SOURCE STREQUAL "SYSTEM") + # Fedora packages place the package information at the wrong location. + # https://bugzilla.redhat.com/show_bug.cgi?id=1680400 +- find_package(RapidJSON ${ARROW_RAPIDJSON_REQUIRED_VERSION} HINTS "${CMAKE_ROOT}") ++ find_package(RapidJSON REQUIRED) + if(RapidJSON_FOUND) + set(RAPIDJSON_INCLUDE_DIR ${RAPIDJSON_INCLUDE_DIRS}) + else() +@@ -2088,7 +2088,7 @@ if(ARROW_WITH_BZ2) + PROPERTIES IMPORTED_LOCATION "${BZIP2_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${BZIP2_INCLUDE_DIR}") + endif() +- include_directories(SYSTEM "${BZIP2_INCLUDE_DIR}") ++ include_directories(SYSTEM "${BZip2_INCLUDE_DIR}") + endif() + + macro(build_utf8proc) +--- cpp/cmake_modules/SetupCxxFlags.cmake ++++ cpp/cmake_modules/SetupCxxFlags.cmake +@@ -188,7 +188,7 @@ + message(STATUS "Arrow build warning level: ${BUILD_WARNING_LEVEL}") + + macro(arrow_add_werror_if_debug) +- if("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG") ++ if(0) + # Treat all compiler warnings as errors + if(MSVC) + set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} /WX") diff --git a/ci/conan/all/patches/1.0.0-0002-jemalloc.patch b/ci/conan/all/patches/1.0.0-0002-jemalloc.patch new file mode 100644 index 00000000000..30402fd4b0f --- /dev/null +++ b/ci/conan/all/patches/1.0.0-0002-jemalloc.patch @@ -0,0 +1,65 @@ +MIT License + +Copyright (c) 2019 Conan.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- cpp/cmake_modules/ThirdpartyToolchain.cmake ++++ cpp/cmake_modules/ThirdpartyToolchain.cmake +@@ -1407,6 +1407,6 @@ endif() + # jemalloc - Unix-only high-performance allocator +- + if(ARROW_JEMALLOC) ++if(0) + message(STATUS "Building (vendored) jemalloc from source") + # We only use a vendored jemalloc as we want to control its version. + # Also our build of jemalloc is specially prefixed so that it will not +@@ -1465,6 +1465,8 @@ if(ARROW_JEMALLOC) + add_dependencies(jemalloc::jemalloc jemalloc_ep) + + list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc::jemalloc) ++else() ++ find_package(jemalloc REQUIRED) ++endif() + endif() +- + # ---------------------------------------------------------------------- + # mimalloc - Cross-platform high-performance allocator, from Microsoft +--- cpp/src/arrow/CMakeLists.txt ++++ cpp/src/arrow/CMakeLists.txt +@@ -292,7 +292,7 @@ + + set(_allocator_dependencies "") # Empty list + if(ARROW_JEMALLOC) +- list(APPEND _allocator_dependencies jemalloc_ep) ++ list(APPEND _allocator_dependencies jemalloc::jemalloc) + endif() + if(ARROW_MIMALLOC) + list(APPEND _allocator_dependencies mimalloc_ep) +--- cpp/src/arrow/memory_pool.cc ++++ cpp/src/arrow/memory_pool.cc +@@ -31,7 +31,7 @@ + // Needed to support jemalloc 3 and 4 + #define JEMALLOC_MANGLE + // Explicitly link to our version of jemalloc +-#include "jemalloc_ep/dist/include/jemalloc/jemalloc.h" ++#include "jemalloc/jemalloc.h" + #endif + + #ifdef ARROW_MIMALLOC diff --git a/ci/conan/all/patches/1.0.0-0003-fix-shared-msvc.patch b/ci/conan/all/patches/1.0.0-0003-fix-shared-msvc.patch new file mode 100644 index 00000000000..45210d1b8cc --- /dev/null +++ b/ci/conan/all/patches/1.0.0-0003-fix-shared-msvc.patch @@ -0,0 +1,35 @@ +MIT License + +Copyright (c) 2019 Conan.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- cpp/src/arrow/CMakeLists.txt ++++ cpp/src/arrow/CMakeLists.txt +@@ -490,6 +490,10 @@ + target_compile_definitions(arrow_static PUBLIC ARROW_STATIC) + endif() + ++if(ARROW_BUILD_SHARED AND WIN32) ++target_compile_definitions(arrow_shared PRIVATE ARROW_EXPORTING) ++endif() ++ + if(ARROW_WITH_BACKTRACE) + find_package(Backtrace) + diff --git a/ci/conan/all/patches/1.0.0-0004-mallctl-takes-size_t.patch b/ci/conan/all/patches/1.0.0-0004-mallctl-takes-size_t.patch new file mode 100644 index 00000000000..61189a1d773 --- /dev/null +++ b/ci/conan/all/patches/1.0.0-0004-mallctl-takes-size_t.patch @@ -0,0 +1,33 @@ +MIT License + +Copyright (c) 2019 Conan.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- cpp/src/arrow/memory_pool.cc ++++ cpp/src/arrow/CMakeLists.txt +@@ -427,7 +427,7 @@ + + Status jemalloc_set_decay_ms(int ms) { + #ifdef ARROW_JEMALLOC +- ssize_t decay_time_ms = static_cast(ms); ++ size_t decay_time_ms = static_cast(ms); + + int err = mallctl("arenas.dirty_decay_ms", nullptr, nullptr, &decay_time_ms, + sizeof(decay_time_ms)); diff --git a/ci/conan/all/patches/2.0.0-0001-cmake.patch b/ci/conan/all/patches/2.0.0-0001-cmake.patch new file mode 100644 index 00000000000..a41b8e5d20c --- /dev/null +++ b/ci/conan/all/patches/2.0.0-0001-cmake.patch @@ -0,0 +1,41 @@ +MIT License + +Copyright (c) 2019 Conan.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- cpp/cmake_modules/DefineOptions.cmake ++++ cpp/cmake_modules/DefineOptions.cmake +@@ -76,7 +76,7 @@ macro(define_option_string name description default) + endmacro() + + # Top level cmake dir +-if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") ++if(1) + #---------------------------------------------------------------------- + set_option_category("Compile and link") + +--- cpp/cmake_modules/ThirdpartyToolchain.cmake ++++ cpp/cmake_modules/ThirdpartyToolchain.cmake +@@ -1856,3 +1856,3 @@ +- find_package(RapidJSON ${ARROW_RAPIDJSON_REQUIRED_VERSION} HINTS "${CMAKE_ROOT}") ++ find_package(RapidJSON ${ARROW_RAPIDJSON_REQUIRED_VERSION} HINTS "${CMAKE_ROOT}" REQUIRED) + if(RapidJSON_FOUND) +- set(RAPIDJSON_INCLUDE_DIR ${RAPIDJSON_INCLUDE_DIRS}) ++ set(RAPIDJSON_INCLUDE_DIR ${RapidJSON_INCLUDE_DIRS}) diff --git a/ci/conan/all/patches/2.0.0-0002-jemalloc.patch b/ci/conan/all/patches/2.0.0-0002-jemalloc.patch new file mode 100644 index 00000000000..f1ff9eee78b --- /dev/null +++ b/ci/conan/all/patches/2.0.0-0002-jemalloc.patch @@ -0,0 +1,65 @@ +MIT License + +Copyright (c) 2019 Conan.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- cpp/cmake_modules/ThirdpartyToolchain.cmake ++++ cpp/cmake_modules/ThirdpartyToolchain.cmake +@@ -1461,6 +1461,6 @@ + # jemalloc - Unix-only high-performance allocator +- + if(ARROW_JEMALLOC) ++if(0) + message(STATUS "Building (vendored) jemalloc from source") + # We only use a vendored jemalloc as we want to control its version. + # Also our build of jemalloc is specially prefixed so that it will not +@@ -1519,6 +1519,8 @@ + add_dependencies(jemalloc::jemalloc jemalloc_ep) + + list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc::jemalloc) ++else() ++ find_package(jemalloc REQUIRED) ++endif() + endif() +- + # ---------------------------------------------------------------------- + # mimalloc - Cross-platform high-performance allocator, from Microsoft +--- cpp/src/arrow/CMakeLists.txt ++++ cpp/src/arrow/CMakeLists.txt +@@ -307,7 +307,7 @@ + + set(_allocator_dependencies "") # Empty list + if(ARROW_JEMALLOC) +- list(APPEND _allocator_dependencies jemalloc_ep) ++ list(APPEND _allocator_dependencies jemalloc::jemalloc) + endif() + if(ARROW_MIMALLOC) + list(APPEND _allocator_dependencies mimalloc_ep) +--- cpp/src/arrow/memory_pool.cc ++++ cpp/src/arrow/memory_pool.cc +@@ -31,7 +31,7 @@ + // Needed to support jemalloc 3 and 4 + #define JEMALLOC_MANGLE + // Explicitly link to our version of jemalloc +-#include "jemalloc_ep/dist/include/jemalloc/jemalloc.h" ++#include "jemalloc/jemalloc.h" + #endif + + #ifdef ARROW_MIMALLOC diff --git a/ci/conan/all/patches/2.0.0-0003-fix-shared-msvc.patch b/ci/conan/all/patches/2.0.0-0003-fix-shared-msvc.patch new file mode 100644 index 00000000000..3583e5c2217 --- /dev/null +++ b/ci/conan/all/patches/2.0.0-0003-fix-shared-msvc.patch @@ -0,0 +1,35 @@ +MIT License + +Copyright (c) 2019 Conan.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- cpp/src/arrow/CMakeLists.txt ++++ cpp/src/arrow/CMakeLists.txt +@@ -504,6 +504,10 @@ + target_compile_definitions(arrow_static PUBLIC ARROW_STATIC) + endif() + ++if(ARROW_BUILD_SHARED AND WIN32) ++target_compile_definitions(arrow_shared PRIVATE ARROW_EXPORTING) ++endif() ++ + if(ARROW_WITH_BACKTRACE) + find_package(Backtrace) + diff --git a/ci/conan/all/patches/2.0.0-0005-gandiva-engine.patch b/ci/conan/all/patches/2.0.0-0005-gandiva-engine.patch new file mode 100644 index 00000000000..6dc0c7947a5 --- /dev/null +++ b/ci/conan/all/patches/2.0.0-0005-gandiva-engine.patch @@ -0,0 +1,35 @@ +MIT License + +Copyright (c) 2019 Conan.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- cpp/src/gandiva/engine.cc ++++ cpp/src/gandiva/engine.cc +@@ -64,6 +64,10 @@ + #include + #include + ++#if GANDIVA_LLVM_VERSION >= 11 ++#include ++#endif ++ + #if defined(_MSC_VER) + #pragma warning(pop) + #endif diff --git a/ci/conan/all/patches/2.0.0-0006-gandiva-llvm-re2.patch b/ci/conan/all/patches/2.0.0-0006-gandiva-llvm-re2.patch new file mode 100644 index 00000000000..5e87d541a9d --- /dev/null +++ b/ci/conan/all/patches/2.0.0-0006-gandiva-llvm-re2.patch @@ -0,0 +1,100 @@ +MIT License + +Copyright (c) 2019 Conan.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- cpp/CMakeLists.txt ++++ cpp/CMakeLists.txt +@@ -109,7 +109,7 @@ set(BUILD_SUPPORT_DIR "${CMAKE_SOURCE_DIR}/build-support") + set(ARROW_CMAKE_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") + set(ARROW_DOC_DIR "share/doc/${PROJECT_NAME}") + +-set(ARROW_LLVM_VERSIONS "10" "9" "8" "7") ++set(ARROW_LLVM_VERSIONS "12" "11" "10" "9" "8" "7") + list(GET ARROW_LLVM_VERSIONS 0 ARROW_LLVM_VERSION_PRIMARY) + string(REGEX + REPLACE "^([0-9]+)(\\..+)?" "\\1" ARROW_LLVM_VERSION_PRIMARY_MAJOR + +--- cpp/cmake_modules/ThirdpartyToolchain.cmake ++++ cpp/cmake_modules/ThirdpartyToolchain.cmake +@@ -2092,10 +2092,11 @@ macro(build_re2) + endmacro() + + if(ARROW_GANDIVA) +- resolve_dependency(RE2) ++ find_package(re2 REQUIRED) ++ resolve_dependency(re2) + + # TODO: Don't use global includes but rather target_include_directories +- get_target_property(RE2_INCLUDE_DIR RE2::re2 INTERFACE_INCLUDE_DIRECTORIES) ++ get_target_property(RE2_INCLUDE_DIR re2::re2 INTERFACE_INCLUDE_DIRECTORIES) + include_directories(SYSTEM ${RE2_INCLUDE_DIR}) + endif() + +--- cpp/src/gandiva/CMakeLists.txt ++++ cpp/src/gandiva/CMakeLists.txt +@@ -25,8 +25,14 @@ add_custom_target(gandiva-benchmarks) + + add_dependencies(gandiva-all gandiva gandiva-tests gandiva-benchmarks) + ++# Now LLVMAlt is only for finding clang/llvm-link + find_package(LLVMAlt REQUIRED) + ++find_package(llvm-core REQUIRED) ++ ++string(REPLACE "." ";" VERSION_LIST ${llvm-core_VERSION}) ++list(GET VERSION_LIST 0 LLVM_VERSION_MAJOR) ++ + if(LLVM_VERSION_MAJOR LESS "10") + set(GANDIVA_CXX_STANDARD ${CMAKE_CXX_STANDARD}) + else() +@@ -88,9 +94,9 @@ set(SRC_FILES + random_generator_holder.cc + ${GANDIVA_PRECOMPILED_CC_PATH}) + +-set(GANDIVA_SHARED_PRIVATE_LINK_LIBS arrow_shared LLVM::LLVM_INTERFACE RE2::re2) ++set(GANDIVA_SHARED_PRIVATE_LINK_LIBS arrow_shared llvm-core::llvm-core re2::re2) + +-set(GANDIVA_STATIC_LINK_LIBS arrow_static LLVM::LLVM_INTERFACE RE2::re2) ++set(GANDIVA_STATIC_LINK_LIBS arrow_static llvm-core::llvm-core re2::re2) + + if(ARROW_GANDIVA_STATIC_LIBSTDCPP + AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)) +@@ -131,7 +137,7 @@ add_arrow_lib(gandiva + arrow_dependencies + precompiled + EXTRA_INCLUDES +- $ ++ $ + SHARED_LINK_FLAGS + ${GANDIVA_SHARED_LINK_FLAGS} + SHARED_LINK_LIBS +@@ -225,9 +231,9 @@ add_gandiva_test(internals-test + decimal_type_util_test.cc + random_generator_holder_test.cc + EXTRA_DEPENDENCIES +- LLVM::LLVM_INTERFACE ++ llvm-core::llvm-core + EXTRA_INCLUDES +- $ ++ $ + ${GANDIVA_INTERNALS_TEST_ARGUMENTS}) + + if(ARROW_GANDIVA_JAVA) diff --git a/ci/conan/all/patches/2.0.0-0007-fix-protoc-cmake.patch b/ci/conan/all/patches/2.0.0-0007-fix-protoc-cmake.patch new file mode 100644 index 00000000000..c7157f06e0c --- /dev/null +++ b/ci/conan/all/patches/2.0.0-0007-fix-protoc-cmake.patch @@ -0,0 +1,33 @@ +MIT License + +Copyright (c) 2019 Conan.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- cpp/cmake_modules/ThirdpartyToolchain.cmake ++++ cpp/cmake_modules/ThirdpartyToolchain.cmake +@@ -1452,7 +1452,7 @@ if(ARROW_WITH_PROTOBUF) + message(STATUS "Found protoc: ${PROTOBUF_PROTOC_EXECUTABLE}") + # Protobuf_PROTOC_LIBRARY is set by all versions of FindProtobuf.cmake + message(STATUS "Found libprotoc: ${Protobuf_PROTOC_LIBRARY}") +- get_target_property(PROTOBUF_LIBRARY ${ARROW_PROTOBUF_LIBPROTOBUF} IMPORTED_LOCATION) ++ # get_target_property(PROTOBUF_LIBRARY ${ARROW_PROTOBUF_LIBPROTOBUF} IMPORTED_LOCATION) + message(STATUS "Found libprotobuf: ${PROTOBUF_LIBRARY}") + message(STATUS "Found protobuf headers: ${PROTOBUF_INCLUDE_DIR}") + endif() diff --git a/ci/conan/all/patches/7.0.0-0001-cmake.patch b/ci/conan/all/patches/7.0.0-0001-cmake.patch new file mode 100644 index 00000000000..0c7638d67ab --- /dev/null +++ b/ci/conan/all/patches/7.0.0-0001-cmake.patch @@ -0,0 +1,35 @@ +MIT License + +Copyright (c) 2019 Conan.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +diff --git a/cpp/cmake_modules/DefineOptions.cmake b/cpp/cmake_modules/DefineOptions.cmake +index 0a43ec1..c468d48 100644 +--- a/cpp/cmake_modules/DefineOptions.cmake ++++ b/cpp/cmake_modules/DefineOptions.cmake +@@ -82,7 +82,7 @@ macro(define_option_string name description default) + endmacro() + + # Top level cmake dir +-if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") ++if(1) + #---------------------------------------------------------------------- + set_option_category("Compile and link") + diff --git a/ci/conan/all/patches/7.0.0-0002-jemalloc.patch b/ci/conan/all/patches/7.0.0-0002-jemalloc.patch new file mode 100644 index 00000000000..0deaba80a87 --- /dev/null +++ b/ci/conan/all/patches/7.0.0-0002-jemalloc.patch @@ -0,0 +1,48 @@ +MIT License + +Copyright (c) 2019 Conan.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt +index b984bc1..84975e2 100644 +--- a/cpp/src/arrow/CMakeLists.txt ++++ b/cpp/src/arrow/CMakeLists.txt +@@ -323,7 +323,7 @@ set(ARROW_TESTING_SRCS + + set(_allocator_dependencies "") # Empty list + if(ARROW_JEMALLOC) +- list(APPEND _allocator_dependencies jemalloc_ep) ++ list(APPEND _allocator_dependencies jemalloc::jemalloc) + endif() + if(ARROW_MIMALLOC) + list(APPEND _allocator_dependencies mimalloc_ep) +diff --git a/cpp/src/arrow/memory_pool.cc b/cpp/src/arrow/memory_pool.cc +index cf8bf64..cf8966b 100644 +--- a/cpp/src/arrow/memory_pool.cc ++++ b/cpp/src/arrow/memory_pool.cc +@@ -48,7 +48,7 @@ + // Needed to support jemalloc 3 and 4 + #define JEMALLOC_MANGLE + // Explicitly link to our version of jemalloc +-#include "jemalloc_ep/dist/include/jemalloc/jemalloc.h" ++#include "jemalloc/jemalloc.h" + #endif + + #ifdef ARROW_MIMALLOC diff --git a/ci/conan/all/patches/7.0.0-0003-mallctl-takes-size_t.patch b/ci/conan/all/patches/7.0.0-0003-mallctl-takes-size_t.patch new file mode 100644 index 00000000000..1e233589c4e --- /dev/null +++ b/ci/conan/all/patches/7.0.0-0003-mallctl-takes-size_t.patch @@ -0,0 +1,35 @@ +MIT License + +Copyright (c) 2019 Conan.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +diff --git a/cpp/src/arrow/memory_pool.cc b/cpp/src/arrow/memory_pool.cc +index cf8bf64..2dcfb01 100644 +--- a/cpp/src/arrow/memory_pool.cc ++++ b/cpp/src/arrow/memory_pool.cc +@@ -563,7 +563,7 @@ MemoryPool* default_memory_pool() { + + Status jemalloc_set_decay_ms(int ms) { + #ifdef ARROW_JEMALLOC +- ssize_t decay_time_ms = static_cast(ms); ++ size_t decay_time_ms = static_cast(ms); + + int err = mallctl("arenas.dirty_decay_ms", nullptr, nullptr, &decay_time_ms, + sizeof(decay_time_ms)); diff --git a/ci/conan/all/patches/7.0.0-0004-remove-find-modules.patch b/ci/conan/all/patches/7.0.0-0004-remove-find-modules.patch new file mode 100644 index 00000000000..029c620d030 --- /dev/null +++ b/ci/conan/all/patches/7.0.0-0004-remove-find-modules.patch @@ -0,0 +1,511 @@ +MIT License + +Copyright (c) 2019 Conan.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +diff --git a/cpp/cmake_modules/FindBrotli.cmake a/cpp/cmake_modules/FindBrotli.cmake +deleted file mode 100644 +index e2670b5..0000000 +--- a/cpp/cmake_modules/FindBrotli.cmake ++++ /dev/null +@@ -1,130 +0,0 @@ +-# +-# Licensed under the Apache License, Version 2.0 (the "License"); +-# you may not use this file except in compliance with the License. +-# You may obtain a copy of the License at +-# +-# http://www.apache.org/licenses/LICENSE-2.0 +-# +-# Unless required by applicable law or agreed to in writing, software +-# distributed under the License is distributed on an "AS IS" BASIS, +-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-# See the License for the specific language governing permissions and +-# limitations under the License. +-# +-# Tries to find Brotli headers and libraries. +-# +-# Usage of this module as follows: +-# +-# find_package(Brotli) +- +-if(ARROW_BROTLI_USE_SHARED) +- set(BROTLI_COMMON_LIB_NAMES +- brotlicommon +- ${CMAKE_SHARED_LIBRARY_PREFIX}brotlicommon${CMAKE_SHARED_LIBRARY_SUFFIX}) +- +- set(BROTLI_ENC_LIB_NAMES +- brotlienc ${CMAKE_SHARED_LIBRARY_PREFIX}brotlienc${CMAKE_SHARED_LIBRARY_SUFFIX}) +- +- set(BROTLI_DEC_LIB_NAMES +- brotlidec ${CMAKE_SHARED_LIBRARY_PREFIX}brotlidec${CMAKE_SHARED_LIBRARY_SUFFIX}) +-else() +- set(BROTLI_COMMON_LIB_NAMES +- brotlicommon-static +- ${CMAKE_STATIC_LIBRARY_PREFIX}brotlicommon-static${CMAKE_STATIC_LIBRARY_SUFFIX} +- ${CMAKE_STATIC_LIBRARY_PREFIX}brotlicommon_static${CMAKE_STATIC_LIBRARY_SUFFIX} +- ${CMAKE_STATIC_LIBRARY_PREFIX}brotlicommon${CMAKE_STATIC_LIBRARY_SUFFIX}) +- +- set(BROTLI_ENC_LIB_NAMES +- brotlienc-static +- ${CMAKE_STATIC_LIBRARY_PREFIX}brotlienc-static${CMAKE_STATIC_LIBRARY_SUFFIX} +- ${CMAKE_STATIC_LIBRARY_PREFIX}brotlienc_static${CMAKE_STATIC_LIBRARY_SUFFIX} +- ${CMAKE_STATIC_LIBRARY_PREFIX}brotlienc${CMAKE_STATIC_LIBRARY_SUFFIX}) +- +- set(BROTLI_DEC_LIB_NAMES +- brotlidec-static +- ${CMAKE_STATIC_LIBRARY_PREFIX}brotlidec-static${CMAKE_STATIC_LIBRARY_SUFFIX} +- ${CMAKE_STATIC_LIBRARY_PREFIX}brotlidec_static${CMAKE_STATIC_LIBRARY_SUFFIX} +- ${CMAKE_STATIC_LIBRARY_PREFIX}brotlidec${CMAKE_STATIC_LIBRARY_SUFFIX}) +-endif() +- +-if(BROTLI_ROOT) +- find_library(BROTLI_COMMON_LIBRARY +- NAMES ${BROTLI_COMMON_LIB_NAMES} +- PATHS ${BROTLI_ROOT} +- PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES} +- NO_DEFAULT_PATH) +- find_library(BROTLI_ENC_LIBRARY +- NAMES ${BROTLI_ENC_LIB_NAMES} +- PATHS ${BROTLI_ROOT} +- PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES} +- NO_DEFAULT_PATH) +- find_library(BROTLI_DEC_LIBRARY +- NAMES ${BROTLI_DEC_LIB_NAMES} +- PATHS ${BROTLI_ROOT} +- PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES} +- NO_DEFAULT_PATH) +- find_path(BROTLI_INCLUDE_DIR +- NAMES brotli/decode.h +- PATHS ${BROTLI_ROOT} +- PATH_SUFFIXES ${ARROW_INCLUDE_PATH_SUFFIXES} +- NO_DEFAULT_PATH) +-else() +- find_package(PkgConfig QUIET) +- pkg_check_modules(BROTLI_PC libbrotlicommon libbrotlienc libbrotlidec) +- if(BROTLI_PC_FOUND) +- set(BROTLI_INCLUDE_DIR "${BROTLI_PC_libbrotlicommon_INCLUDEDIR}") +- +- # Some systems (e.g. Fedora) don't fill Brotli_LIBRARY_DIRS, so add the other dirs here. +- list(APPEND BROTLI_PC_LIBRARY_DIRS "${BROTLI_PC_libbrotlicommon_LIBDIR}") +- list(APPEND BROTLI_PC_LIBRARY_DIRS "${BROTLI_PC_libbrotlienc_LIBDIR}") +- list(APPEND BROTLI_PC_LIBRARY_DIRS "${BROTLI_PC_libbrotlidec_LIBDIR}") +- +- find_library(BROTLI_COMMON_LIBRARY +- NAMES ${BROTLI_COMMON_LIB_NAMES} +- PATHS ${BROTLI_PC_LIBRARY_DIRS} +- PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES} +- NO_DEFAULT_PATH) +- find_library(BROTLI_ENC_LIBRARY +- NAMES ${BROTLI_ENC_LIB_NAMES} +- PATHS ${BROTLI_PC_LIBRARY_DIRS} +- PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES} +- NO_DEFAULT_PATH) +- find_library(BROTLI_DEC_LIBRARY +- NAMES ${BROTLI_DEC_LIB_NAMES} +- PATHS ${BROTLI_PC_LIBRARY_DIRS} +- PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES} +- NO_DEFAULT_PATH) +- else() +- find_library(BROTLI_COMMON_LIBRARY +- NAMES ${BROTLI_COMMON_LIB_NAMES} +- PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES}) +- find_library(BROTLI_ENC_LIBRARY +- NAMES ${BROTLI_ENC_LIB_NAMES} +- PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES}) +- find_library(BROTLI_DEC_LIBRARY +- NAMES ${BROTLI_DEC_LIB_NAMES} +- PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES}) +- find_path(BROTLI_INCLUDE_DIR +- NAMES brotli/decode.h +- PATH_SUFFIXES ${ARROW_INCLUDE_PATH_SUFFIXES}) +- endif() +-endif() +- +-find_package_handle_standard_args( +- Brotli REQUIRED_VARS BROTLI_COMMON_LIBRARY BROTLI_ENC_LIBRARY BROTLI_DEC_LIBRARY +- BROTLI_INCLUDE_DIR) +-if(Brotli_FOUND OR BROTLI_FOUND) +- set(Brotli_FOUND TRUE) +- add_library(Brotli::brotlicommon UNKNOWN IMPORTED) +- set_target_properties(Brotli::brotlicommon +- PROPERTIES IMPORTED_LOCATION "${BROTLI_COMMON_LIBRARY}" +- INTERFACE_INCLUDE_DIRECTORIES "${BROTLI_INCLUDE_DIR}") +- add_library(Brotli::brotlienc UNKNOWN IMPORTED) +- set_target_properties(Brotli::brotlienc +- PROPERTIES IMPORTED_LOCATION "${BROTLI_ENC_LIBRARY}" +- INTERFACE_INCLUDE_DIRECTORIES "${BROTLI_INCLUDE_DIR}") +- add_library(Brotli::brotlidec UNKNOWN IMPORTED) +- set_target_properties(Brotli::brotlidec +- PROPERTIES IMPORTED_LOCATION "${BROTLI_DEC_LIBRARY}" +- INTERFACE_INCLUDE_DIRECTORIES "${BROTLI_INCLUDE_DIR}") +-endif() +diff --git a/cpp/cmake_modules/FindLz4.cmake a/cpp/cmake_modules/FindLz4.cmake +deleted file mode 100644 +index bc8051f..0000000 +--- a/cpp/cmake_modules/FindLz4.cmake ++++ /dev/null +@@ -1,84 +0,0 @@ +-# Licensed to the Apache Software Foundation (ASF) under one +-# or more contributor license agreements. See the NOTICE file +-# distributed with this work for additional information +-# regarding copyright ownership. The ASF licenses this file +-# to you under the Apache License, Version 2.0 (the +-# "License"); you may not use this file except in compliance +-# with the License. You may obtain a copy of the License at +-# +-# http://www.apache.org/licenses/LICENSE-2.0 +-# +-# Unless required by applicable law or agreed to in writing, +-# software distributed under the License is distributed on an +-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-# KIND, either express or implied. See the License for the +-# specific language governing permissions and limitations +-# under the License. +- +-if(MSVC_TOOLCHAIN AND NOT DEFINED LZ4_MSVC_LIB_PREFIX) +- set(LZ4_MSVC_LIB_PREFIX "lib") +-endif() +-set(LZ4_LIB_NAME_BASE "${LZ4_MSVC_LIB_PREFIX}lz4") +- +-if(ARROW_LZ4_USE_SHARED) +- set(LZ4_LIB_NAMES) +- if(CMAKE_IMPORT_LIBRARY_SUFFIX) +- list(APPEND +- LZ4_LIB_NAMES +- "${CMAKE_IMPORT_LIBRARY_PREFIX}${LZ4_LIB_NAME_BASE}${CMAKE_IMPORT_LIBRARY_SUFFIX}" +- ) +- endif() +- list(APPEND LZ4_LIB_NAMES +- "${CMAKE_SHARED_LIBRARY_PREFIX}${LZ4_LIB_NAME_BASE}${CMAKE_SHARED_LIBRARY_SUFFIX}") +-else() +- if(MSVC AND NOT DEFINED LZ4_MSVC_STATIC_LIB_SUFFIX) +- set(LZ4_MSVC_STATIC_LIB_SUFFIX "_static") +- endif() +- set(LZ4_STATIC_LIB_SUFFIX "${LZ4_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") +- set(LZ4_LIB_NAMES +- "${CMAKE_STATIC_LIBRARY_PREFIX}${LZ4_LIB_NAME_BASE}${LZ4_STATIC_LIB_SUFFIX}") +-endif() +- +-if(LZ4_ROOT) +- find_library(LZ4_LIB +- NAMES ${LZ4_LIB_NAMES} +- PATHS ${LZ4_ROOT} +- PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES} +- NO_DEFAULT_PATH) +- find_path(LZ4_INCLUDE_DIR +- NAMES lz4.h +- PATHS ${LZ4_ROOT} +- NO_DEFAULT_PATH +- PATH_SUFFIXES ${ARROW_INCLUDE_PATH_SUFFIXES}) +- +-else() +- find_package(PkgConfig QUIET) +- pkg_check_modules(LZ4_PC liblz4) +- if(LZ4_PC_FOUND) +- set(LZ4_INCLUDE_DIR "${LZ4_PC_INCLUDEDIR}") +- +- list(APPEND LZ4_PC_LIBRARY_DIRS "${LZ4_PC_LIBDIR}") +- find_library(LZ4_LIB +- NAMES ${LZ4_LIB_NAMES} +- PATHS ${LZ4_PC_LIBRARY_DIRS} +- NO_DEFAULT_PATH +- PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES}) +- else() +- find_library(LZ4_LIB +- NAMES ${LZ4_LIB_NAMES} +- PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES}) +- find_path(LZ4_INCLUDE_DIR +- NAMES lz4.h +- PATH_SUFFIXES ${ARROW_INCLUDE_PATH_SUFFIXES}) +- endif() +-endif() +- +-find_package_handle_standard_args(Lz4 REQUIRED_VARS LZ4_LIB LZ4_INCLUDE_DIR) +- +-if(Lz4_FOUND) +- set(Lz4_FOUND TRUE) +- add_library(LZ4::lz4 UNKNOWN IMPORTED) +- set_target_properties(LZ4::lz4 +- PROPERTIES IMPORTED_LOCATION "${LZ4_LIB}" +- INTERFACE_INCLUDE_DIRECTORIES "${LZ4_INCLUDE_DIR}") +-endif() +diff --git a/cpp/cmake_modules/FindSnappy.cmake a/cpp/cmake_modules/FindSnappy.cmake +deleted file mode 100644 +index 747df31..0000000 +--- a/cpp/cmake_modules/FindSnappy.cmake ++++ /dev/null +@@ -1,62 +0,0 @@ +-# Licensed to the Apache Software Foundation (ASF) under one +-# or more contributor license agreements. See the NOTICE file +-# distributed with this work for additional information +-# regarding copyright ownership. The ASF licenses this file +-# to you under the Apache License, Version 2.0 (the +-# "License"); you may not use this file except in compliance +-# with the License. You may obtain a copy of the License at +-# +-# http://www.apache.org/licenses/LICENSE-2.0 +-# +-# Unless required by applicable law or agreed to in writing, +-# software distributed under the License is distributed on an +-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-# KIND, either express or implied. See the License for the +-# specific language governing permissions and limitations +-# under the License. +- +-if(ARROW_SNAPPY_USE_SHARED) +- set(SNAPPY_LIB_NAMES) +- if(CMAKE_IMPORT_LIBRARY_SUFFIX) +- list(APPEND SNAPPY_LIB_NAMES +- "${CMAKE_IMPORT_LIBRARY_PREFIX}snappy${CMAKE_IMPORT_LIBRARY_SUFFIX}") +- endif() +- list(APPEND SNAPPY_LIB_NAMES +- "${CMAKE_SHARED_LIBRARY_PREFIX}snappy${CMAKE_SHARED_LIBRARY_SUFFIX}") +-else() +- set(SNAPPY_STATIC_LIB_NAME_BASE "snappy") +- if(MSVC) +- set(SNAPPY_STATIC_LIB_NAME_BASE +- "${SNAPPY_STATIC_LIB_NAME_BASE}${SNAPPY_MSVC_STATIC_LIB_SUFFIX}") +- endif() +- set(SNAPPY_LIB_NAMES +- "${CMAKE_STATIC_LIBRARY_PREFIX}${SNAPPY_STATIC_LIB_NAME_BASE}${CMAKE_STATIC_LIBRARY_SUFFIX}" +- ) +-endif() +- +-if(Snappy_ROOT) +- find_library(Snappy_LIB +- NAMES ${SNAPPY_LIB_NAMES} +- PATHS ${Snappy_ROOT} +- PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES} +- NO_DEFAULT_PATH) +- find_path(Snappy_INCLUDE_DIR +- NAMES snappy.h +- PATHS ${Snappy_ROOT} +- NO_DEFAULT_PATH +- PATH_SUFFIXES ${ARROW_INCLUDE_PATH_SUFFIXES}) +-else() +- find_library(Snappy_LIB NAMES ${SNAPPY_LIB_NAMES}) +- find_path(Snappy_INCLUDE_DIR +- NAMES snappy.h +- PATH_SUFFIXES ${ARROW_INCLUDE_PATH_SUFFIXES}) +-endif() +- +-find_package_handle_standard_args(Snappy REQUIRED_VARS Snappy_LIB Snappy_INCLUDE_DIR) +- +-if(Snappy_FOUND) +- add_library(Snappy::snappy UNKNOWN IMPORTED) +- set_target_properties(Snappy::snappy +- PROPERTIES IMPORTED_LOCATION "${Snappy_LIB}" +- INTERFACE_INCLUDE_DIRECTORIES "${Snappy_INCLUDE_DIR}") +-endif() +diff --git a/cpp/cmake_modules/Findjemalloc.cmake a/cpp/cmake_modules/Findjemalloc.cmake +deleted file mode 100644 +index 84bb81f..0000000 +--- a/cpp/cmake_modules/Findjemalloc.cmake ++++ /dev/null +@@ -1,94 +0,0 @@ +-# +-# Licensed under the Apache License, Version 2.0 (the "License"); +-# you may not use this file except in compliance with the License. +-# You may obtain a copy of the License at +-# +-# http://www.apache.org/licenses/LICENSE-2.0 +-# +-# Unless required by applicable law or agreed to in writing, software +-# distributed under the License is distributed on an "AS IS" BASIS, +-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-# See the License for the specific language governing permissions and +-# limitations under the License. +-# +-# Tries to find jemalloc headers and libraries. +-# +-# Usage of this module as follows: +-# +-# find_package(jemalloc) +-# +-# Variables used by this module, they can change the default behaviour and need +-# to be set before calling find_package: +-# +-# JEMALLOC_HOME - +-# When set, this path is inspected instead of standard library locations as +-# the root of the jemalloc installation. The environment variable +-# JEMALLOC_HOME overrides this veriable. +-# +-# This module defines +-# JEMALLOC_INCLUDE_DIR, directory containing headers +-# JEMALLOC_SHARED_LIB, path to libjemalloc.so/dylib +-# JEMALLOC_FOUND, whether flatbuffers has been found +- +-if(NOT "${JEMALLOC_HOME}" STREQUAL "") +- file(TO_CMAKE_PATH "${JEMALLOC_HOME}" _native_path) +- list(APPEND _jemalloc_roots ${_native_path}) +-elseif(JEMALLOC_HOME) +- list(APPEND _jemalloc_roots ${JEMALLOC_HOME}) +-endif() +- +-set(LIBJEMALLOC_NAMES jemalloc libjemalloc.so.1 libjemalloc.so.2 libjemalloc.dylib) +- +-# Try the parameterized roots, if they exist +-if(_jemalloc_roots) +- find_path(JEMALLOC_INCLUDE_DIR +- NAMES jemalloc/jemalloc.h +- PATHS ${_jemalloc_roots} +- NO_DEFAULT_PATH +- PATH_SUFFIXES "include") +- find_library(JEMALLOC_SHARED_LIB +- NAMES ${LIBJEMALLOC_NAMES} +- PATHS ${_jemalloc_roots} +- NO_DEFAULT_PATH +- PATH_SUFFIXES "lib") +- find_library(JEMALLOC_STATIC_LIB +- NAMES jemalloc_pic +- PATHS ${_jemalloc_roots} +- NO_DEFAULT_PATH +- PATH_SUFFIXES "lib") +-else() +- find_path(JEMALLOC_INCLUDE_DIR NAMES jemalloc/jemalloc.h) +- message(STATUS ${JEMALLOC_INCLUDE_DIR}) +- find_library(JEMALLOC_SHARED_LIB NAMES ${LIBJEMALLOC_NAMES}) +- message(STATUS ${JEMALLOC_SHARED_LIB}) +- find_library(JEMALLOC_STATIC_LIB NAMES jemalloc_pic) +- message(STATUS ${JEMALLOC_STATIC_LIB}) +-endif() +- +-if(JEMALLOC_INCLUDE_DIR AND JEMALLOC_SHARED_LIB) +- set(JEMALLOC_FOUND TRUE) +-else() +- set(JEMALLOC_FOUND FALSE) +-endif() +- +-if(JEMALLOC_FOUND) +- if(NOT jemalloc_FIND_QUIETLY) +- message(STATUS "Found the jemalloc library: ${JEMALLOC_LIBRARIES}") +- endif() +-else() +- if(NOT jemalloc_FIND_QUIETLY) +- set(JEMALLOC_ERR_MSG "Could not find the jemalloc library. Looked in ") +- if(_flatbuffers_roots) +- set(JEMALLOC_ERR_MSG "${JEMALLOC_ERR_MSG} in ${_jemalloc_roots}.") +- else() +- set(JEMALLOC_ERR_MSG "${JEMALLOC_ERR_MSG} system search paths.") +- endif() +- if(jemalloc_FIND_REQUIRED) +- message(FATAL_ERROR "${JEMALLOC_ERR_MSG}") +- else(jemalloc_FIND_REQUIRED) +- message(STATUS "${JEMALLOC_ERR_MSG}") +- endif(jemalloc_FIND_REQUIRED) +- endif() +-endif() +- +-mark_as_advanced(JEMALLOC_INCLUDE_DIR JEMALLOC_SHARED_LIB) +diff --git a/cpp/cmake_modules/Findzstd.cmake a/cpp/cmake_modules/Findzstd.cmake +deleted file mode 100644 +index 3fc14ec..0000000 +--- a/cpp/cmake_modules/Findzstd.cmake ++++ /dev/null +@@ -1,89 +0,0 @@ +-# Licensed to the Apache Software Foundation (ASF) under one +-# or more contributor license agreements. See the NOTICE file +-# distributed with this work for additional information +-# regarding copyright ownership. The ASF licenses this file +-# to you under the Apache License, Version 2.0 (the +-# "License"); you may not use this file except in compliance +-# with the License. You may obtain a copy of the License at +-# +-# http://www.apache.org/licenses/LICENSE-2.0 +-# +-# Unless required by applicable law or agreed to in writing, +-# software distributed under the License is distributed on an +-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-# KIND, either express or implied. See the License for the +-# specific language governing permissions and limitations +-# under the License. +- +-if(MSVC AND NOT DEFINED ZSTD_MSVC_LIB_PREFIX) +- set(ZSTD_MSVC_LIB_PREFIX "lib") +-endif() +-set(ZSTD_LIB_NAME_BASE "${ZSTD_MSVC_LIB_PREFIX}zstd") +- +-if(ARROW_ZSTD_USE_SHARED) +- set(ZSTD_LIB_NAMES) +- if(CMAKE_IMPORT_LIBRARY_SUFFIX) +- list(APPEND +- ZSTD_LIB_NAMES +- "${CMAKE_IMPORT_LIBRARY_PREFIX}${ZSTD_LIB_NAME_BASE}${CMAKE_IMPORT_LIBRARY_SUFFIX}" +- ) +- endif() +- list(APPEND ZSTD_LIB_NAMES +- "${CMAKE_SHARED_LIBRARY_PREFIX}${ZSTD_LIB_NAME_BASE}${CMAKE_SHARED_LIBRARY_SUFFIX}" +- ) +-else() +- if(MSVC AND NOT DEFINED ZSTD_MSVC_STATIC_LIB_SUFFIX) +- set(ZSTD_MSVC_STATIC_LIB_SUFFIX "_static") +- endif() +- set(ZSTD_STATIC_LIB_SUFFIX +- "${ZSTD_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") +- set(ZSTD_LIB_NAMES +- "${CMAKE_STATIC_LIBRARY_PREFIX}${ZSTD_LIB_NAME_BASE}${ZSTD_STATIC_LIB_SUFFIX}") +-endif() +- +-# First, find via if specified ZSTD_ROOT +-if(ZSTD_ROOT) +- message(STATUS "Using ZSTD_ROOT: ${ZSTD_ROOT}") +- find_library(ZSTD_LIB +- NAMES ${ZSTD_LIB_NAMES} +- PATHS ${ZSTD_ROOT} +- PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES} +- NO_DEFAULT_PATH) +- find_path(ZSTD_INCLUDE_DIR +- NAMES zstd.h +- PATHS ${ZSTD_ROOT} +- NO_DEFAULT_PATH +- PATH_SUFFIXES ${ARROW_INCLUDE_PATH_SUFFIXES}) +- +-else() +- # Second, find via pkg_check_modules +- find_package(PkgConfig QUIET) +- pkg_check_modules(ZSTD_PC libzstd) +- if(ZSTD_PC_FOUND) +- set(ZSTD_INCLUDE_DIR "${ZSTD_PC_INCLUDEDIR}") +- +- list(APPEND ZSTD_PC_LIBRARY_DIRS "${ZSTD_PC_LIBDIR}") +- find_library(ZSTD_LIB +- NAMES ${ZSTD_LIB_NAMES} +- PATHS ${ZSTD_PC_LIBRARY_DIRS} +- NO_DEFAULT_PATH +- PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES}) +- else() +- # Third, check all other CMake paths +- find_library(ZSTD_LIB +- NAMES ${ZSTD_LIB_NAMES} +- PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES}) +- find_path(ZSTD_INCLUDE_DIR +- NAMES zstd.h +- PATH_SUFFIXES ${ARROW_INCLUDE_PATH_SUFFIXES}) +- endif() +-endif() +- +-find_package_handle_standard_args(zstd REQUIRED_VARS ZSTD_LIB ZSTD_INCLUDE_DIR) +- +-if(zstd_FOUND) +- add_library(zstd::libzstd UNKNOWN IMPORTED) +- set_target_properties(zstd::libzstd +- PROPERTIES IMPORTED_LOCATION "${ZSTD_LIB}" +- INTERFACE_INCLUDE_DIRECTORIES "${ZSTD_INCLUDE_DIR}") +-endif() diff --git a/ci/conan/all/patches/7.0.0-0005-use-find-package.patch b/ci/conan/all/patches/7.0.0-0005-use-find-package.patch new file mode 100644 index 00000000000..dcb8cae3c48 --- /dev/null +++ b/ci/conan/all/patches/7.0.0-0005-use-find-package.patch @@ -0,0 +1,343 @@ +MIT License + +Copyright (c) 2019 Conan.io + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt +index 2d7baf1..c2e86e0 100644 +--- a/cpp/CMakeLists.txt ++++ b/cpp/CMakeLists.txt +@@ -715,7 +715,7 @@ if(ARROW_WITH_BZ2) + endif() + + if(ARROW_WITH_LZ4) +- list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4) ++ list(APPEND ARROW_STATIC_LINK_LIBS lz4::lz4) + if(Lz4_SOURCE STREQUAL "SYSTEM") + list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4) + endif() +@@ -901,8 +901,8 @@ endif() + if(ARROW_JEMALLOC) + add_definitions(-DARROW_JEMALLOC) + add_definitions(-DARROW_JEMALLOC_INCLUDE_DIR=${JEMALLOC_INCLUDE_DIR}) +- list(APPEND ARROW_LINK_LIBS jemalloc::jemalloc) +- list(APPEND ARROW_STATIC_LINK_LIBS jemalloc::jemalloc) ++ list(APPEND ARROW_LINK_LIBS jemalloc) ++ list(APPEND ARROW_STATIC_LINK_LIBS jemalloc) + endif() + + if(ARROW_MIMALLOC) +diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake +index bc38952..8196e09 100644 +--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake ++++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake +@@ -953,14 +953,7 @@ else() + endif() + + if(ARROW_BOOST_REQUIRED) +- resolve_dependency(Boost +- HAVE_ALT +- TRUE +- REQUIRED_VERSION +- ${ARROW_BOOST_REQUIRED_VERSION} +- IS_RUNTIME_DEPENDENCY +- # libarrow.so doesn't depend on libboost*. +- FALSE) ++ find_package(Boost CONFIG REQUIRED) + + if(TARGET Boost::system) + set(BOOST_SYSTEM_LIBRARY Boost::system) +@@ -1038,6 +1031,7 @@ macro(build_snappy) + endmacro() + + if(ARROW_WITH_SNAPPY) ++ if(0) + resolve_dependency(Snappy PC_PACKAGE_NAMES snappy) + if(${Snappy_SOURCE} STREQUAL "SYSTEM" AND NOT snappy_PC_FOUND) + get_target_property(SNAPPY_LIB Snappy::snappy IMPORTED_LOCATION) +@@ -1046,6 +1040,8 @@ if(ARROW_WITH_SNAPPY) + # TODO: Don't use global includes but rather target_include_directories + get_target_property(SNAPPY_INCLUDE_DIRS Snappy::snappy INTERFACE_INCLUDE_DIRECTORIES) + include_directories(SYSTEM ${SNAPPY_INCLUDE_DIRS}) ++ endif() ++ find_package(Snappy REQUIRED) + endif() + + # ---------------------------------------------------------------------- +@@ -1108,7 +1104,7 @@ macro(build_brotli) + endmacro() + + if(ARROW_WITH_BROTLI) +- resolve_dependency(Brotli PC_PACKAGE_NAMES libbrotlidec libbrotlienc) ++ find_package(Brotli REQUIRED) + # TODO: Don't use global includes but rather target_include_directories + get_target_property(BROTLI_INCLUDE_DIR Brotli::brotlicommon + INTERFACE_INCLUDE_DIRECTORIES) +@@ -1228,10 +1224,13 @@ macro(build_glog) + endmacro() + + if(ARROW_USE_GLOG) ++ if(0) + resolve_dependency(GLOG PC_PACKAGE_NAMES libglog) + # TODO: Don't use global includes but rather target_include_directories + get_target_property(GLOG_INCLUDE_DIR glog::glog INTERFACE_INCLUDE_DIRECTORIES) + include_directories(SYSTEM ${GLOG_INCLUDE_DIR}) ++ endif() ++ find_package(glog REQUIRED) + endif() + + # ---------------------------------------------------------------------- +@@ -1300,14 +1299,7 @@ macro(build_gflags) + endmacro() + + if(ARROW_NEED_GFLAGS) +- set(ARROW_GFLAGS_REQUIRED_VERSION "2.1.0") +- resolve_dependency(gflags +- HAVE_ALT +- TRUE +- REQUIRED_VERSION +- ${ARROW_GFLAGS_REQUIRED_VERSION} +- IS_RUNTIME_DEPENDENCY +- FALSE) ++ find_package(gflags REQUIRED) + # TODO: Don't use global includes but rather target_include_directories + include_directories(SYSTEM ${GFLAGS_INCLUDE_DIR}) + +@@ -1606,7 +1598,7 @@ if(ARROW_JEMALLOC) + # conflict with the default allocator as well as other jemalloc + # installations. + # find_package(jemalloc) +- ++ if (0) + set(ARROW_JEMALLOC_USE_SHARED OFF) + set(JEMALLOC_PREFIX + "${CMAKE_CURRENT_BINARY_DIR}/jemalloc_ep-prefix/src/jemalloc_ep/dist/") +@@ -1664,6 +1656,9 @@ if(ARROW_JEMALLOC) + "${CMAKE_CURRENT_BINARY_DIR}/jemalloc_ep-prefix/src") + add_dependencies(jemalloc::jemalloc jemalloc_ep) + ++ endif() ++ find_package(jemalloc REQUIRED) ++ + list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc::jemalloc) + endif() + +@@ -1671,6 +1666,8 @@ endif() + # mimalloc - Cross-platform high-performance allocator, from Microsoft + + if(ARROW_MIMALLOC) ++ if (0) ++ + message(STATUS "Building (vendored) mimalloc from source") + # We only use a vendored mimalloc as we want to control its build options. + +@@ -1715,6 +1712,13 @@ if(ARROW_MIMALLOC) + add_dependencies(mimalloc::mimalloc mimalloc_ep) + add_dependencies(toolchain mimalloc_ep) + ++ else() ++ ++ find_package(mimalloc CONFIG REQUIRED) ++ add_dependencies(toolchain mimalloc::mimalloc) ++ ++ endif() ++ + list(APPEND ARROW_BUNDLED_STATIC_LIBS mimalloc::mimalloc) + endif() + +@@ -2036,10 +2040,21 @@ macro(build_xsimd) + set(XSIMD_VENDORED TRUE) + endmacro() + +-if((NOT ARROW_SIMD_LEVEL STREQUAL "NONE") OR (NOT ARROW_RUNTIME_SIMD_LEVEL STREQUAL "NONE" +- )) ++if((NOT ARROW_SIMD_LEVEL STREQUAL "NONE") OR (NOT ARROW_RUNTIME_SIMD_LEVEL STREQUAL "NONE")) ++ ++ if (0) ++ + set(xsimd_SOURCE "BUNDLED") + resolve_dependency(xsimd) ++ ++ else() ++ ++ find_package(xsimd) ++ set(XSIMD_INCLUDE_DIR "${xsimd_INCLUDE_DIR}") ++ add_dependencies(toolchain xsimd) ++ ++ endif() ++ + # TODO: Don't use global includes but rather target_include_directories + include_directories(SYSTEM ${XSIMD_INCLUDE_DIR}) + endif() +@@ -2082,11 +2097,14 @@ macro(build_zlib) + endmacro() + + if(ARROW_WITH_ZLIB) ++ if(0) + resolve_dependency(ZLIB PC_PACKAGE_NAMES zlib) + + # TODO: Don't use global includes but rather target_include_directories + get_target_property(ZLIB_INCLUDE_DIR ZLIB::ZLIB INTERFACE_INCLUDE_DIRECTORIES) + include_directories(SYSTEM ${ZLIB_INCLUDE_DIR}) ++ endif() ++ find_package(ZLIB REQUIRED) + endif() + + macro(build_lz4) +@@ -2140,11 +2158,14 @@ macro(build_lz4) + endmacro() + + if(ARROW_WITH_LZ4) ++ if(0) + resolve_dependency(Lz4 PC_PACKAGE_NAMES liblz4) + + # TODO: Don't use global includes but rather target_include_directories + get_target_property(LZ4_INCLUDE_DIR LZ4::lz4 INTERFACE_INCLUDE_DIRECTORIES) + include_directories(SYSTEM ${LZ4_INCLUDE_DIR}) ++ endif() ++ find_package(lz4 REQUIRED) + endif() + + macro(build_zstd) +@@ -2205,6 +2226,7 @@ macro(build_zstd) + endmacro() + + if(ARROW_WITH_ZSTD) ++ if(0) + # ARROW-13384: ZSTD_minCLevel was added in v1.4.0, required by ARROW-13091 + resolve_dependency(zstd + PC_PACKAGE_NAMES +@@ -2232,6 +2254,8 @@ if(ARROW_WITH_ZSTD) + get_target_property(ZSTD_INCLUDE_DIR ${ARROW_ZSTD_LIBZSTD} + INTERFACE_INCLUDE_DIRECTORIES) + include_directories(SYSTEM ${ZSTD_INCLUDE_DIR}) ++ endif() ++ find_package(zstd REQUIRED) + endif() + + # ---------------------------------------------------------------------- +@@ -2271,6 +2295,7 @@ macro(build_re2) + endmacro() + + if(ARROW_WITH_RE2) ++ if(0) + # Don't specify "PC_PACKAGE_NAMES re2" here because re2.pc may + # include -std=c++11. It's not compatible with C source and C++ + # source not uses C++ 11. +@@ -2284,6 +2309,8 @@ if(ARROW_WITH_RE2) + # TODO: Don't use global includes but rather target_include_directories + get_target_property(RE2_INCLUDE_DIR re2::re2 INTERFACE_INCLUDE_DIRECTORIES) + include_directories(SYSTEM ${RE2_INCLUDE_DIR}) ++ endif() ++ find_package(re2 REQUIRED) + endif() + + macro(build_bzip2) +@@ -2335,10 +2362,7 @@ macro(build_bzip2) + endmacro() + + if(ARROW_WITH_BZ2) +- resolve_dependency(BZip2) +- if(${BZip2_SOURCE} STREQUAL "SYSTEM") +- string(APPEND ARROW_PC_LIBS_PRIVATE " ${BZIP2_LIBRARIES}") +- endif() ++ find_package(BZip2 REQUIRED) + + if(NOT TARGET BZip2::BZip2) + add_library(BZip2::BZip2 UNKNOWN IMPORTED) +@@ -2390,11 +2414,7 @@ macro(build_utf8proc) + endmacro() + + if(ARROW_WITH_UTF8PROC) +- resolve_dependency(utf8proc +- REQUIRED_VERSION +- "2.2.0" +- PC_PACKAGE_NAMES +- libutf8proc) ++ find_package(BZip2 REQUIRED CONFIG) + + add_definitions(-DARROW_WITH_UTF8PROC) + +@@ -3554,33 +3574,12 @@ if(ARROW_WITH_GRPC) + message(STATUS "Forcing gRPC_SOURCE to Protobuf_SOURCE (${Protobuf_SOURCE})") + set(gRPC_SOURCE "${Protobuf_SOURCE}") + endif() +- resolve_dependency(gRPC +- HAVE_ALT +- TRUE +- REQUIRED_VERSION +- ${ARROW_GRPC_REQUIRED_VERSION} +- PC_PACKAGE_NAMES +- grpc++) ++ find_package(gRPC CONFIG REQUIRED) + + # TODO: Don't use global includes but rather target_include_directories + get_target_property(GRPC_INCLUDE_DIR gRPC::grpc++ INTERFACE_INCLUDE_DIRECTORIES) + include_directories(SYSTEM ${GRPC_INCLUDE_DIR}) + +- if(GRPC_VENDORED) +- set(GRPCPP_PP_INCLUDE TRUE) +- # Examples need to link to static Arrow if we're using static gRPC +- set(ARROW_GRPC_USE_SHARED OFF) +- else() +- # grpc++ headers may reside in ${GRPC_INCLUDE_DIR}/grpc++ or ${GRPC_INCLUDE_DIR}/grpcpp +- # depending on the gRPC version. +- if(EXISTS "${GRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h") +- set(GRPCPP_PP_INCLUDE TRUE) +- elseif(EXISTS "${GRPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h") +- set(GRPCPP_PP_INCLUDE FALSE) +- else() +- message(FATAL_ERROR "Cannot find grpc++ headers in ${GRPC_INCLUDE_DIR}") +- endif() +- endif() + endif() + + # ---------------------------------------------------------------------- +diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt +index 84975e2..7779c08 100644 +--- a/cpp/src/arrow/CMakeLists.txt ++++ b/cpp/src/arrow/CMakeLists.txt +@@ -575,6 +575,10 @@ foreach(LIB_TARGET ${ARROW_LIBRARIES}) + target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_EXPORTING) + endforeach() + ++if(ARROW_BUILD_SHARED AND WIN32) ++ target_compile_definitions(arrow_shared PRIVATE ARROW_EXPORTING) ++endif() ++ + if(ARROW_WITH_BACKTRACE) + find_package(Backtrace) + +@@ -585,6 +589,7 @@ if(ARROW_WITH_BACKTRACE) + endforeach() + endif() + ++if(0) + if(ARROW_BUILD_BUNDLED_DEPENDENCIES) + arrow_car(_FIRST_LIB ${ARROW_BUNDLED_STATIC_LIBS}) + arrow_cdr(_OTHER_LIBS ${ARROW_BUNDLED_STATIC_LIBS}) +@@ -596,6 +601,7 @@ if(ARROW_BUILD_BUNDLED_DEPENDENCIES) + TO_MERGE + ${_OTHER_LIBS}) + endif() ++endif() + + if(ARROW_TESTING) + # that depend on gtest diff --git a/ci/conan/all/test_package/CMakeLists.txt b/ci/conan/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000..508cb448904 --- /dev/null +++ b/ci/conan/all/test_package/CMakeLists.txt @@ -0,0 +1,34 @@ +# MIT License +# +# Copyright (c) 2019 Conan.io +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_package(Arrow) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} arrow::arrow) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) +target_compile_definitions(${PROJECT_NAME} PRIVATE WITH_JEMALLOC) diff --git a/ci/conan/all/test_package/conanfile.py b/ci/conan/all/test_package/conanfile.py new file mode 100644 index 00000000000..8bfa021563a --- /dev/null +++ b/ci/conan/all/test_package/conanfile.py @@ -0,0 +1,39 @@ +# MIT License +# +# Copyright (c) 2019 Conan.io +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/ci/conan/all/test_package/test_package.cpp b/ci/conan/all/test_package/test_package.cpp new file mode 100644 index 00000000000..42cab6cc76e --- /dev/null +++ b/ci/conan/all/test_package/test_package.cpp @@ -0,0 +1,190 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include +#include +#include + +#include + +using arrow::DoubleBuilder; +using arrow::Int64Builder; +using arrow::ListBuilder; + +// While we want to use columnar data structures to build efficient operations, we +// often receive data in a row-wise fashion from other systems. In the following, +// we want give a brief introduction into the classes provided by Apache Arrow by +// showing how to transform row-wise data into a columnar table. +// +// The data in this example is stored in the following struct: +struct data_row { + int64_t id; + double cost; + std::vector cost_components; +}; + +// Transforming a vector of structs into a columnar Table. +// +// The final representation should be an `arrow::Table` which in turn +// is made up of an `arrow::Schema` and a list of +// `arrow::ChunkedArray` instances. As the first step, we will iterate +// over the data and build up the arrays incrementally. For this +// task, we provide `arrow::ArrayBuilder` classes that help in the +// construction of the final `arrow::Array` instances. +// +// For each type, Arrow has a specially typed builder class. For the primitive +// values `id` and `cost` we can use the respective `arrow::Int64Builder` and +// `arrow::DoubleBuilder`. For the `cost_components` vector, we need to have two +// builders, a top-level `arrow::ListBuilder` that builds the array of offsets and +// a nested `arrow::DoubleBuilder` that constructs the underlying values array that +// is referenced by the offsets in the former array. +arrow::Status VectorToColumnarTable(const std::vector& rows, + std::shared_ptr* table) { + // The builders are more efficient using + // arrow::jemalloc::MemoryPool::default_pool() as this can increase the size of + // the underlying memory regions in-place. At the moment, arrow::jemalloc is only + // supported on Unix systems, not Windows. + arrow::MemoryPool* pool = arrow::default_memory_pool(); + + Int64Builder id_builder(pool); + DoubleBuilder cost_builder(pool); + ListBuilder components_builder(pool, std::make_shared(pool)); + // The following builder is owned by components_builder. + DoubleBuilder& cost_components_builder = + *(static_cast(components_builder.value_builder())); + + // Now we can loop over our existing data and insert it into the builders. The + // `Append` calls here may fail (e.g. we cannot allocate enough additional memory). + // Thus we need to check their return values. For more information on these values, + // check the documentation about `arrow::Status`. + for (const data_row& row : rows) { + ARROW_RETURN_NOT_OK(id_builder.Append(row.id)); + ARROW_RETURN_NOT_OK(cost_builder.Append(row.cost)); + + // Indicate the start of a new list row. This will memorise the current + // offset in the values builder. + ARROW_RETURN_NOT_OK(components_builder.Append()); + // Store the actual values. The final nullptr argument tells the underyling + // builder that all added values are valid, i.e. non-null. + ARROW_RETURN_NOT_OK(cost_components_builder.AppendValues(row.cost_components.data(), + row.cost_components.size())); + } + + // At the end, we finalise the arrays, declare the (type) schema and combine them + // into a single `arrow::Table`: + std::shared_ptr id_array; + ARROW_RETURN_NOT_OK(id_builder.Finish(&id_array)); + std::shared_ptr cost_array; + ARROW_RETURN_NOT_OK(cost_builder.Finish(&cost_array)); + // No need to invoke cost_components_builder.Finish because it is implied by + // the parent builder's Finish invocation. + std::shared_ptr cost_components_array; + ARROW_RETURN_NOT_OK(components_builder.Finish(&cost_components_array)); + + std::vector> schema_vector = { + arrow::field("id", arrow::int64()), arrow::field("cost", arrow::float64()), + arrow::field("cost_components", arrow::list(arrow::float64()))}; + + auto schema = std::make_shared(schema_vector); + + // The final `table` variable is the one we then can pass on to other functions + // that can consume Apache Arrow memory structures. This object has ownership of + // all referenced data, thus we don't have to care about undefined references once + // we leave the scope of the function building the table and its underlying arrays. + *table = arrow::Table::Make(schema, {id_array, cost_array, cost_components_array}); + + return arrow::Status::OK(); +} + +arrow::Status ColumnarTableToVector(const std::shared_ptr& table, + std::vector* rows) { + // To convert an Arrow table back into the same row-wise representation as in the + // above section, we first will check that the table conforms to our expected + // schema and then will build up the vector of rows incrementally. + // + // For the check if the table is as expected, we can utilise solely its schema. + std::vector> schema_vector = { + arrow::field("id", arrow::int64()), arrow::field("cost", arrow::float64()), + arrow::field("cost_components", arrow::list(arrow::float64()))}; + auto expected_schema = std::make_shared(schema_vector); + + if (!expected_schema->Equals(*table->schema())) { + // The table doesn't have the expected schema thus we cannot directly + // convert it to our target representation. + return arrow::Status::Invalid("Schemas are not matching!"); + } + + // As we have ensured that the table has the expected structure, we can unpack the + // underlying arrays. For the primitive columns `id` and `cost` we can use the high + // level functions to get the values whereas for the nested column + // `cost_components` we need to access the C-pointer to the data to copy its + // contents into the resulting `std::vector`. Here we need to be care to + // also add the offset to the pointer. This offset is needed to enable zero-copy + // slicing operations. While this could be adjusted automatically for double + // arrays, this cannot be done for the accompanying bitmap as often the slicing + // border would be inside a byte. + + auto ids = + std::static_pointer_cast(table->column(0)->chunk(0)); + auto costs = + std::static_pointer_cast(table->column(1)->chunk(0)); + auto cost_components = + std::static_pointer_cast(table->column(2)->chunk(0)); + auto cost_components_values = + std::static_pointer_cast(cost_components->values()); + // To enable zero-copy slices, the native values pointer might need to account + // for this slicing offset. This is not needed for the higher level functions + // like Value(…) that already account for this offset internally. + const double* ccv_ptr = cost_components_values->data()->GetValues(1); + + for (int64_t i = 0; i < table->num_rows(); i++) { + // Another simplification in this example is that we assume that there are + // no null entries, e.g. each row is fill with valid values. + int64_t id = ids->Value(i); + double cost = costs->Value(i); + const double* first = ccv_ptr + cost_components->value_offset(i); + const double* last = ccv_ptr + cost_components->value_offset(i + 1); + std::vector components_vec(first, last); + rows->push_back({id, cost, components_vec}); + } + + return arrow::Status::OK(); +} + +#define EXIT_ON_FAILURE(expr) \ + do { \ + arrow::Status status_ = (expr); \ + if (!status_.ok()) { \ + std::cerr << status_.message() << std::endl; \ + return EXIT_FAILURE; \ + } \ + } while (0); + +int main(int argc, char** argv) { + std::vector rows = { + {1, 1.0, {1.0}}, {2, 2.0, {1.0, 2.0}}, {3, 3.0, {1.0, 2.0, 3.0}}}; + + std::shared_ptr table; + EXIT_ON_FAILURE(VectorToColumnarTable(rows, &table)); + + std::vector expected_rows; + EXIT_ON_FAILURE(ColumnarTableToVector(table, &expected_rows)); + + assert(rows.size() == expected_rows.size()); + + return EXIT_SUCCESS; +} diff --git a/ci/conan/config.yml b/ci/conan/config.yml new file mode 100644 index 00000000000..75c894c63f6 --- /dev/null +++ b/ci/conan/config.yml @@ -0,0 +1,29 @@ +# MIT License +# +# Copyright (c) 2019 Conan.io +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +versions: + "7.0.0": + folder: all + "2.0.0": + folder: all + "1.0.0": + folder: all diff --git a/ci/scripts/conan_build.sh b/ci/scripts/conan_build.sh new file mode 100755 index 00000000000..2f38b0ded56 --- /dev/null +++ b/ci/scripts/conan_build.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +set -eux + +source_dir=${1} +shift +build_dir=${1} +shift + +export ARROW_HOME=${source_dir} +export CONAN_HOOK_ERROR_LEVEL=40 + +version=$(grep '^set(ARROW_VERSION ' ${ARROW_HOME}/cpp/CMakeLists.txt | \ + grep -E -o '([0-9.]*)') + +rm -rf ${build_dir}/conan || sudo rm -rf ${build_dir}/conan +mkdir -p ${build_dir}/conan || sudo mkdir -p ${build_dir}/conan +if [ -w ${build_dir} ]; then + cp -a ${source_dir}/ci/conan/* ${build_dir}/conan/ +else + sudo cp -a ${source_dir}/ci/conan/* ${build_dir}/conan/ + sudo chown -R $(id -u):$(id -g) ${build_dir}/conan/ +fi +cd ${build_dir}/conan/all +conan create . arrow/${version}@ "$@" diff --git a/ci/scripts/conan_setup.sh b/ci/scripts/conan_setup.sh new file mode 100755 index 00000000000..bc56ee296a2 --- /dev/null +++ b/ci/scripts/conan_setup.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +set -eux + +conan config install https://github.com/conan-io/hooks.git -sf hooks -tf hooks +conan config set hooks.conan-center diff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.yml index 99b9716f8d2..e687e2fddd2 100644 --- a/dev/tasks/tasks.yml +++ b/dev/tasks/tasks.yml @@ -21,6 +21,9 @@ groups: {############################# Packaging tasks ###############################} + conan: + - conan-* + conda: - conda-* @@ -53,6 +56,7 @@ groups: - almalinux-* - amazon-linux-* - centos-* + - conan-* - debian-* - java-jars - nuget @@ -137,6 +141,7 @@ groups: - debian-* - ubuntu-* - centos-* + - conan-* - conda-* - java-jars # List the homebrews explicitly because we don't care about running homebrew-cpp-autobrew @@ -160,6 +165,7 @@ groups: - ubuntu-* - centos-* - conda-* + - conan-* - java-jars # List the homebrews explicitly because we don't care about running homebrew-cpp-autobrew - homebrew-cpp @@ -181,7 +187,15 @@ tasks: # e.g.: # - pyarrow-{no_rc_version}-py38(h[a-z0-9]+)_0-linux-64.tar.bz2 -{############################## Conda Linux ##################################} + ############################## Conan ################################## + + conan-minimum: + ci: github + template: docker-tests/github.linux.yml + params: + image: conan + + ############################## Conda Linux ############################ conda-clean: ci: azure diff --git a/docker-compose.yml b/docker-compose.yml index d7d5f6e3cfe..f8b9dacfa2f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -112,6 +112,7 @@ x-hierarchy: - conda-python-spark - conda-python-turbodbc - conda-verify-rc + - conan - debian-cpp: - debian-c-glib: - debian-ruby @@ -197,7 +198,7 @@ services: # Base image for conda builds. # # Usage: - # docker-compose build con + # docker-compose build conda # docker-compose run --rm conda # Parameters: # ARCH: amd64, arm32v7 @@ -500,6 +501,25 @@ services: - ${DOCKER_VOLUME_PREFIX}fedora-ccache:/ccache:delegated command: *cpp-command + conan: + # Base service for Conan. + # + # Usage: + # docker-compose run --rm conan + # Parameters: + # CONAN: gcc11, gcc11-armv7, ... + # See https://github.com/conan-io/conan-docker-tools#readme for + # available images. + image: conanio/${CONAN} + shm_size: *shm-size + ulimits: *ulimits + volumes: + - .:/arrow:delegated + command: >- + /bin/bash -c " + /arrow/ci/scripts/conan_setup.sh && + /arrow/ci/scripts/conan_build.sh /arrow /build" + ############################### C GLib ###################################### debian-c-glib: