From c0b311ee83c6ef8d9cf43d9e67af1f5d61dbfdd5 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Sat, 26 Nov 2022 05:30:21 +0900 Subject: [PATCH] ARROW-18361: [CI][Conan] Merge upstream changes (#14671) Updated: https://github.com/conan-io/conan-center-index/pull/14111 Authored-by: Sutou Kouhei Signed-off-by: Sutou Kouhei --- ci/conan/all/conandata.yml | 113 +++-- ci/conan/all/conanfile.py | 406 +++++++++------- ci/conan/all/patches/1.0.0-0001-cmake.patch | 114 ----- .../all/patches/1.0.0-0002-jemalloc.patch | 65 --- .../1.0.0-0005-fix-make12-namespace.patch | 44 ++ .../all/patches/1.0.0-0006-fix-cmake.patch | 355 ++++++++++++++ ...=> 10.0.0-0001-mallctl-takes-size_t.patch} | 22 +- .../all/patches/10.0.0-0002-fix-cmake.patch | 333 +++++++++++++ ci/conan/all/patches/2.0.0-0001-cmake.patch | 41 -- .../all/patches/2.0.0-0002-jemalloc.patch | 65 --- .../patches/2.0.0-0006-gandiva-llvm-re2.patch | 100 ---- .../patches/2.0.0-0007-fix-protoc-cmake.patch | 33 -- .../all/patches/2.0.0-0008-fix-cmake.patch | 295 ++++++++++++ ci/conan/all/patches/7.0.0-0001-cmake.patch | 35 -- .../all/patches/7.0.0-0002-jemalloc.patch | 48 -- .../7.0.0-0004-remove-find-modules.patch | 22 - .../patches/7.0.0-0005-use-find-package.patch | 440 ----------------- .../all/patches/7.0.0-0007-fix-cmake.patch | 369 +++++++++++++++ .../all/patches/8.0.0-0002-jemalloc.patch | 48 -- .../patches/8.0.0-0004-use-find-package.patch | 401 ---------------- .../all/patches/8.0.0-0006-fix-cmake.patch | 447 ++++++++++++++++++ ci/conan/all/test_package/CMakeLists.txt | 16 +- ci/conan/all/test_package/conanfile.py | 22 +- .../all/{ => test_v1_package}/CMakeLists.txt | 10 +- ci/conan/all/test_v1_package/conanfile.py | 40 ++ ci/conan/config.yml | 2 + ci/conan/merge_status.sh | 2 +- cpp/CMakeLists.txt | 4 +- .../{FindBrotli.cmake => FindBrotliAlt.cmake} | 43 +- ...ndjemalloc.cmake => FindjemallocAlt.cmake} | 70 ++- cpp/cmake_modules/Findutf8proc.cmake | 2 +- cpp/cmake_modules/ThirdpartyToolchain.cmake | 17 +- 32 files changed, 2301 insertions(+), 1723 deletions(-) delete mode 100644 ci/conan/all/patches/1.0.0-0001-cmake.patch delete mode 100644 ci/conan/all/patches/1.0.0-0002-jemalloc.patch create mode 100644 ci/conan/all/patches/1.0.0-0005-fix-make12-namespace.patch create mode 100644 ci/conan/all/patches/1.0.0-0006-fix-cmake.patch rename ci/conan/all/patches/{8.0.0-0001-cmake.patch => 10.0.0-0001-mallctl-takes-size_t.patch} (65%) create mode 100644 ci/conan/all/patches/10.0.0-0002-fix-cmake.patch delete mode 100644 ci/conan/all/patches/2.0.0-0001-cmake.patch delete mode 100644 ci/conan/all/patches/2.0.0-0002-jemalloc.patch delete mode 100644 ci/conan/all/patches/2.0.0-0006-gandiva-llvm-re2.patch delete mode 100644 ci/conan/all/patches/2.0.0-0007-fix-protoc-cmake.patch create mode 100644 ci/conan/all/patches/2.0.0-0008-fix-cmake.patch delete mode 100644 ci/conan/all/patches/7.0.0-0001-cmake.patch delete mode 100644 ci/conan/all/patches/7.0.0-0002-jemalloc.patch delete mode 100644 ci/conan/all/patches/7.0.0-0004-remove-find-modules.patch delete mode 100644 ci/conan/all/patches/7.0.0-0005-use-find-package.patch create mode 100644 ci/conan/all/patches/7.0.0-0007-fix-cmake.patch delete mode 100644 ci/conan/all/patches/8.0.0-0002-jemalloc.patch delete mode 100644 ci/conan/all/patches/8.0.0-0004-use-find-package.patch create mode 100644 ci/conan/all/patches/8.0.0-0006-fix-cmake.patch rename ci/conan/all/{ => test_v1_package}/CMakeLists.txt (83%) create mode 100644 ci/conan/all/test_v1_package/conanfile.py rename cpp/cmake_modules/{FindBrotli.cmake => FindBrotliAlt.cmake} (82%) rename cpp/cmake_modules/{Findjemalloc.cmake => FindjemallocAlt.cmake} (56%) diff --git a/ci/conan/all/conandata.yml b/ci/conan/all/conandata.yml index 942a3eba7a6c6..a446cf7e3b974 100644 --- a/ci/conan/all/conandata.yml +++ b/ci/conan/all/conandata.yml @@ -21,6 +21,9 @@ # SOFTWARE. sources: + "10.0.0": + url: "https://github.com/apache/arrow/archive/apache-arrow-10.0.0.tar.gz" + sha256: "2852b21f93ee84185a9d838809c9a9c41bf6deca741bed1744e0fdba6cc19e3f" "8.0.1": url: "https://github.com/apache/arrow/archive/apache-arrow-8.0.1.tar.gz" sha256: "e4c86329be769f2c8778aacc8d6220a9a13c90d59d4988f9349d51299dacbd11" @@ -37,60 +40,66 @@ sources: url: "https://github.com/apache/arrow/archive/apache-arrow-1.0.0.tar.gz" sha256: "08fbd4c633c08939850d619ca0224c75d7a0526467c721c0838b8aa7efccb270" patches: + "10.0.0": + - patch_file: "patches/10.0.0-0001-mallctl-takes-size_t.patch" + patch_description: "use size_t instead of ssize_t" + patch_type: "backport" + - patch_file: "patches/10.0.0-0002-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" "8.0.1": - - base_path: "source_subfolder" - patch_file: "patches/8.0.0-0001-cmake.patch" - - base_path: "source_subfolder" - patch_file: "patches/8.0.0-0002-jemalloc.patch" - - base_path: "source_subfolder" - patch_file: "patches/8.0.0-0003-mallctl-takes-size_t.patch" - - base_path: "source_subfolder" - patch_file: "patches/8.0.0-0004-use-find-package.patch" - - base_path: "source_subfolder" - patch_file: "patches/8.0.0-0005-install-utils.patch" + - patch_file: "patches/8.0.0-0003-mallctl-takes-size_t.patch" + patch_description: "use size_t instead of ssize_t" + patch_type: "backport" + - patch_file: "patches/8.0.0-0005-install-utils.patch" + patch_description: "enable utilis installation" + patch_type: "conan" + - patch_file: "patches/8.0.0-0006-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" "8.0.0": - - base_path: "source_subfolder" - patch_file: "patches/8.0.0-0001-cmake.patch" - - base_path: "source_subfolder" - patch_file: "patches/8.0.0-0002-jemalloc.patch" - - base_path: "source_subfolder" - patch_file: "patches/8.0.0-0003-mallctl-takes-size_t.patch" - - base_path: "source_subfolder" - patch_file: "patches/8.0.0-0004-use-find-package.patch" - - base_path: "source_subfolder" - patch_file: "patches/8.0.0-0005-install-utils.patch" + - patch_file: "patches/8.0.0-0003-mallctl-takes-size_t.patch" + patch_description: "use size_t instead of ssize_t" + patch_type: "backport" + - patch_file: "patches/8.0.0-0005-install-utils.patch" + patch_description: "enable utilis installation" + patch_type: "conan" + - patch_file: "patches/8.0.0-0006-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" "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-0005-use-find-package.patch" - - base_path: "source_subfolder" - patch_file: "patches/7.0.0-0006-install-utils.patch" + - patch_file: "patches/7.0.0-0003-mallctl-takes-size_t.patch" + patch_description: "use size_t instead of ssize_t" + patch_type: "backport" + - patch_file: "patches/7.0.0-0006-install-utils.patch" + patch_description: "enable utilis installation" + patch_type: "conan" + - patch_file: "patches/7.0.0-0007-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" "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" + - patch_file: "patches/2.0.0-0003-fix-shared-msvc.patch" + patch_description: "make shared enabled in msvc" + patch_type: "backport" + - patch_file: "patches/1.0.0-0004-mallctl-takes-size_t.patch" + patch_description: "use size_t instead of ssize_t" + patch_type: "backport" + - patch_file: "patches/2.0.0-0005-gandiva-engine.patch" + patch_description: "fix grandiva compilation error" + patch_type: "backport" + - patch_file: "patches/2.0.0-0008-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" "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" + - patch_file: "patches/1.0.0-0003-fix-shared-msvc.patch" + patch_description: "make shared enabled in msvc" + patch_type: "backport" + - patch_file: "patches/1.0.0-0004-mallctl-takes-size_t.patch" + patch_description: "use size_t instead of ssize_t" + patch_type: "backport" + - patch_file: "patches/1.0.0-0005-fix-make12-namespace.patch" + patch_description: "fix ambiguous `make12` function between std and date" + patch_type: "backport" + - patch_file: "patches/1.0.0-0006-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" diff --git a/ci/conan/all/conanfile.py b/ci/conan/all/conanfile.py index 726f83239b5e8..1489040ff7600 100644 --- a/ci/conan/all/conanfile.py +++ b/ci/conan/all/conanfile.py @@ -20,13 +20,18 @@ # 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 +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import is_msvc_static_runtime, is_msvc, check_min_vs +from conan.tools.files import export_conandata_patches, apply_conandata_patches, get, copy, rmdir +from conan.tools.build import check_min_cppstd, cross_building +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout + import os import glob -required_conan_version = ">=1.33.0" - +required_conan_version = ">=1.53.0" class ArrowConan(ConanFile): name = "arrow" @@ -64,6 +69,7 @@ class ArrowConan(ConanFile): "with_glog": ["auto", True, False], "with_grpc": ["auto", True, False], "with_jemalloc": ["auto", True, False], + "with_mimalloc": ["auto", True, False], "with_json": [True, False], "with_llvm": ["auto", True, False], "with_openssl": ["auto", True, False], @@ -108,6 +114,7 @@ class ArrowConan(ConanFile): "with_gcs": False, "with_gflags": "auto", "with_jemalloc": "auto", + "with_mimalloc": False, "with_glog": "auto", "with_grpc": "auto", "with_json": False, @@ -124,40 +131,61 @@ class ArrowConan(ConanFile): "with_zlib": False, "with_zstd": False, } - generators = "cmake", "cmake_find_package_multi" short_paths = True - _cmake = None + @property + def _minimum_cpp_standard(self): + # arrow >= 10.0.0 requires C++17. + # https://github.com/apache/arrow/pull/13991 + return 11 if Version(self.version) < "10.0.0" else 17 @property - def _source_subfolder(self): - return "source_subfolder" + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "7", + "apple-clang": "10", + } def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if tools.Version(self.version) < "2.0.0": + if 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": + elif Version(self.version) < "6.0.0": self.options.simd_level = "sse4_2" - if tools.Version(self.version) < "6.0.0": + if Version(self.version) < "6.0.0": del self.options.with_gcs - if tools.Version(self.version) < "7.0.0": + if Version(self.version) < "7.0.0": del self.options.skyhook del self.options.with_flight_sql del self.options.with_opentelemetry - if tools.Version(self.version) < "8.0.0": + if Version(self.version) < "8.0.0": del self.options.substrait + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + 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.info.settings.compiler.cppstd: + check_min_cppstd(self, self._minimum_cpp_standard) + + if self._minimum_cpp_standard == 11: + if self.info.settings.compiler == "clang" and self.info.settings.compiler.version <= Version("3.9"): + raise ConanInvalidConfiguration("This recipe does not support this compiler version") + else: + check_min_vs(self, 191) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False) + if minimum_version and Version(self.info.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support." + ) if self.options.shared: del self.options.fPIC @@ -198,8 +226,11 @@ def validate(self): 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)) + if Version(self.version) < "6.0.0" and self.options.get_safe("simd_level") == "default": + raise ConanInvalidConfiguration(f"In {self.ref}, simd_level options is not supported `default` value.") + + def layout(self): + cmake_layout(self, src_folder="src") def _compute(self, required=False): if required or self.options.compute == "auto": @@ -227,7 +258,11 @@ def _with_jemalloc(self, required=False): def _with_re2(self, required=False): if required or self.options.with_re2 == "auto": - return bool(self.options.gandiva) or bool(self._compute()) + if self.options.gandiva or self.options.parquet: + return True + if Version(self) >= "7.0.0" and (self._compute() or self._dataset_modules()): + return True + return False else: return bool(self.options.with_re2) @@ -265,12 +300,12 @@ 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) + version = Version(self.version) if version.major == "1": - if self._parquet() and self.settings.compiler == "gcc" and self.settings.compiler.version < tools.Version("4.9"): + if self._parquet() and self.settings.compiler == "gcc" and self.settings.compiler.version < Version("4.9"): return True elif version.major >= "2": - if self.settings.compiler == "Visual Studio": + if is_msvc(self): return True return False else: @@ -298,15 +333,24 @@ def _with_openssl(self, required=False): else: return bool(self.options.with_openssl) + def _with_rapidjson(self): + if self.options.with_json: + return True + if Version(self.version) >= "7.0.0" and self.options.encryption: + return True + return False + def requirements(self): if self._with_thrift(): - self.requires("thrift/0.16.0") + self.requires("thrift/0.17.0") if self._with_protobuf(): self.requires("protobuf/3.21.4") if self._with_jemalloc(): - self.requires("jemalloc/5.2.1") + self.requires("jemalloc/5.3.0") + if self.options.with_mimalloc: + self.requires("mimalloc/1.7.6") if self._with_boost(): - self.requires("boost/1.79.0") + self.requires("boost/1.80.0") if self._with_gflags(): self.requires("gflags/2.2.2") if self._with_glog(): @@ -314,19 +358,19 @@ def requirements(self): if self.options.get_safe("with_gcs"): self.requires("google-cloud-cpp/1.40.1") if self._with_grpc(): - self.requires("grpc/1.48.0") - if self.options.with_json: + self.requires("grpc/1.50.0") + if self._with_rapidjson(): self.requires("rapidjson/1.1.0") if self._with_llvm(): self.requires("llvm-core/13.0.0") if self._with_openssl(): - # aws-sdk-cpp/grpc requires openssl/1.1.1. it uses deprecated functions in openssl/3.0.0 - if self.options.with_s3 or self._with_flight_rpc(): - self.requires("openssl/1.1.1q") + # aws-sdk-cpp requires openssl/1.1.1. it uses deprecated functions in openssl/3.0.0 + if self.options.with_s3: + self.requires("openssl/1.1.1s") else: - self.requires("openssl/3.0.5") + self.requires("openssl/1.1.1s") if self.options.get_safe("with_opentelemetry"): - self.requires("opentelemetry-cpp/1.4.1") + self.requires("opentelemetry-cpp/1.7.0") if self.options.with_s3: self.requires("aws-sdk-cpp/1.9.234") if self.options.with_brotli: @@ -334,21 +378,21 @@ def requirements(self): if self.options.with_bz2: self.requires("bzip2/1.0.8") if self.options.with_lz4: - self.requires("lz4/1.9.3") + self.requires("lz4/1.9.4") if self.options.with_snappy: self.requires("snappy/1.1.9") - if tools.Version(self.version) >= "6.0.0" and \ + if Version(self.version) >= "6.0.0" and \ self.options.get_safe("simd_level") != None or \ self.options.get_safe("runtime_simd_level") != None: - self.requires("xsimd/8.1.0") + self.requires("xsimd/9.0.1") if self.options.with_zlib: - self.requires("zlib/1.2.12") + self.requires("zlib/1.2.13") if self.options.with_zstd: self.requires("zstd/1.5.2") if self._with_re2(): self.requires("re2/20220601") if self._with_utf8proc(): - self.requires("utf8proc/2.7.0") + self.requires("utf8proc/2.8.0") if self.options.with_backtrace: self.requires("libbacktrace/cci.20210118") @@ -360,9 +404,9 @@ def source(self): import shutil top_level = os.environ.get("ARROW_HOME") shutil.copytree(os.path.join(top_level, "cpp"), - os.path.join(self._source_subfolder, "cpp")) + os.path.join(self.source_folder, "cpp")) shutil.copytree(os.path.join(top_level, "format"), - os.path.join(self._source_subfolder, "format")) + os.path.join(self.source_folder, "format")) top_level_files = [ ".env", "LICENSE.txt", @@ -370,175 +414,176 @@ def source(self): ] for top_level_file in top_level_files: shutil.copy(os.path.join(top_level, top_level_file), - self._source_subfolder) + self.source_folder) 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) - self._cmake.definitions["CMAKE_FIND_PACKAGE_PREFER_CONFIG"] = True - if tools.cross_building(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + # BUILD_SHARED_LIBS and POSITION_INDEPENDENT_CODE are automatically parsed when self.options.shared or self.options.fPIC exist + tc = CMakeToolchain(self) + if 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_DEFINE_OPTIONS"] = True - self._cmake.definitions["ARROW_DEPENDENCY_SOURCE"] = "SYSTEM" - self._cmake.definitions["ARROW_GANDIVA"] = self.options.gandiva - self._cmake.definitions["ARROW_PARQUET"] = self._parquet() - self._cmake.definitions["ARROW_SUBSTRAIT"] = self.options.get_safe("substrait", False) - self._cmake.definitions["ARROW_PLASMA"] = self.options.plasma - self._cmake.definitions["ARROW_DATASET"] = self._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._with_flight_rpc() - self._cmake.definitions["ARROW_FLIGHT_SQL"] = self.options.get_safe("with_flight_sql", False) - 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["jemalloc_SOURCE"] = "SYSTEM" - self._cmake.definitions["ARROW_JSON"] = self.options.with_json - - self._cmake.definitions["BOOST_SOURCE"] = "SYSTEM" - self._cmake.definitions["Protobuf_SOURCE"] = "SYSTEM" + tc.variables["CMAKE_SYSTEM_PROCESSOR"] = cmake_system_processor + if cmake_system_processor == "aarch64": + tc.variables["ARROW_CPU_FLAG"] = "armv8" + if is_msvc(self): + tc.variables["ARROW_USE_STATIC_CRT"] = is_msvc_static_runtime(self) + tc.variables["ARROW_DEPENDENCY_SOURCE"] = "SYSTEM" + tc.variables["ARROW_PACKAGE_KIND"] = "conan" + tc.variables["ARROW_GANDIVA"] = bool(self.options.gandiva) + tc.variables["ARROW_PARQUET"] = self._parquet() + tc.variables["ARROW_SUBSTRAIT"] = bool(self.options.get_safe("substrait", False)) + tc.variables["ARROW_PLASMA"] = bool(self.options.plasma) + tc.variables["ARROW_DATASET"] = self._dataset_modules() + tc.variables["ARROW_FILESYSTEM"] = bool(self.options.filesystem_layer) + tc.variables["PARQUET_REQUIRE_ENCRYPTION"] = bool(self.options.encryption) + tc.variables["ARROW_HDFS"] = bool(self.options.hdfs_bridgs) + tc.variables["ARROW_VERBOSE_THIRDPARTY_BUILD"] = True + tc.variables["ARROW_BUILD_SHARED"] = bool(self.options.shared) + tc.variables["ARROW_BUILD_STATIC"] = not bool(self.options.shared) + tc.variables["ARROW_NO_DEPRECATED_API"] = not bool(self.options.deprecated) + tc.variables["ARROW_FLIGHT"] = self._with_flight_rpc() + tc.variables["ARROW_FLIGHT_SQL"] = bool(self.options.get_safe("with_flight_sql", False)) + tc.variables["ARROW_COMPUTE"] = self._compute() + tc.variables["ARROW_CSV"] = bool(self.options.with_csv) + tc.variables["ARROW_CUDA"] = bool(self.options.with_cuda) + tc.variables["ARROW_JEMALLOC"] = self._with_jemalloc() + tc.variables["ARROW_MIMALLOC"] = bool(self.options.with_mimalloc) + tc.variables["jemalloc_SOURCE"] = "SYSTEM" + tc.variables["ARROW_JSON"] = bool(self.options.with_json) + tc.variables["google_cloud_cpp_SOURCE"] = "SYSTEM" + tc.variables["ARROW_GCS"] = bool(self.options.get_safe("with_gcs", False)) + tc.variables["BOOST_SOURCE"] = "SYSTEM" + tc.variables["Protobuf_SOURCE"] = "SYSTEM" if self._with_protobuf(): - self._cmake.definitions["ARROW_PROTOBUF_USE_SHARED"] = self.options["protobuf"].shared - self._cmake.definitions["gRPC_SOURCE"] = "SYSTEM" + tc.variables["ARROW_PROTOBUF_USE_SHARED"] = bool(self.options["protobuf"].shared) + tc.variables["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" + tc.variables["ARROW_GRPC_USE_SHARED"] = bool(self.options["grpc"].shared) + + tc.variables["ARROW_USE_GLOG"] = self._with_glog() + tc.variables["GLOG_SOURCE"] = "SYSTEM" + tc.variables["ARROW_WITH_BACKTRACE"] = bool(self.options.with_backtrace) + tc.variables["ARROW_WITH_BROTLI"] = bool(self.options.with_brotli) + tc.variables["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" + tc.variables["ARROW_BROTLI_USE_SHARED"] = bool(self.options["brotli"].shared) + tc.variables["gflags_SOURCE"] = "SYSTEM" if self._with_gflags(): - self._cmake.definitions["ARROW_GFLAGS_USE_SHARED"] = self.options["gflags"].shared - self._cmake.definitions["ARROW_WITH_BZ2"] = self.options.with_bz2 - self._cmake.definitions["BZip2_SOURCE"] = "SYSTEM" + tc.variables["ARROW_GFLAGS_USE_SHARED"] = bool(self.options["gflags"].shared) + tc.variables["ARROW_WITH_BZ2"] = bool(self.options.with_bz2) + tc.variables["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 - if tools.Version(self.version) >= "9.0.0": - self._cmake.definitions["lz4_SOURCE"] = "SYSTEM" - else: - self._cmake.definitions["Lz4_SOURCE"] = "SYSTEM" + tc.variables["ARROW_BZ2_USE_SHARED"] = bool(self.options["bzip2"].shared) + tc.variables["ARROW_WITH_LZ4"] = bool(self.options.with_lz4) + tc.variables["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" + tc.variables["ARROW_LZ4_USE_SHARED"] = bool(self.options["lz4"].shared) + tc.variables["ARROW_WITH_SNAPPY"] = bool(self.options.with_snappy) + tc.variables["RapidJSON_SOURCE"] = "SYSTEM" + tc.variables["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() + tc.variables["ARROW_SNAPPY_USE_SHARED"] = bool(self.options["snappy"].shared) + tc.variables["ARROW_WITH_ZLIB"] = bool(self.options.with_zlib) + tc.variables["re2_SOURCE"] = "SYSTEM" + tc.variables["ZLIB_SOURCE"] = "SYSTEM" + tc.variables["xsimd_SOURCE"] = "SYSTEM" + tc.variables["ARROW_WITH_ZSTD"] = bool(self.options.with_zstd) + if Version(self.version) >= "2.0": + tc.variables["zstd_SOURCE"] = "SYSTEM" + tc.variables["ARROW_SIMD_LEVEL"] = str(self.options.simd_level).upper() + tc.variables["ARROW_RUNTIME_SIMD_LEVEL"] = str(self.options.runtime_simd_level).upper() else: - self._cmake.definitions["ZSTD_SOURCE"] = "SYSTEM" + tc.variables["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" + tc.variables["ARROW_ZSTD_USE_SHARED"] = bool(self.options["zstd"].shared) + tc.variables["ORC_SOURCE"] = "SYSTEM" + tc.variables["ARROW_WITH_THRIFT"] = self._with_thrift() + tc.variables["Thrift_SOURCE"] = "SYSTEM" if self._with_thrift(): - self._cmake.definitions["THRIFT_VERSION"] = self.deps_cpp_info["thrift"].version # a recent thrift does not require boost - self._cmake.definitions["ARROW_THRIFT_USE_SHARED"] = self.options["thrift"].shared - self._cmake.definitions["ARROW_USE_OPENSSL"] = self._with_openssl() + tc.variables["THRIFT_VERSION"] = bool(self.deps_cpp_info["thrift"].version) # a recent thrift does not require boost + tc.variables["ARROW_THRIFT_USE_SHARED"] = bool(self.options["thrift"].shared) + tc.variables["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 + tc.variables["OPENSSL_ROOT_DIR"] = self.deps_cpp_info["openssl"].rootpath.replace("\\", "/") + tc.variables["ARROW_OPENSSL_USE_SHARED"] = bool(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" + tc.variables["ARROW_USE_BOOST"] = True + tc.variables["ARROW_BOOST_USE_SHARED"] = bool(self.options["boost"].shared) + tc.variables["ARROW_S3"] = bool(self.options.with_s3) + tc.variables["AWSSDK_SOURCE"] = "SYSTEM" + tc.variables["ARROW_BUILD_UTILITIES"] = bool(self.options.cli) + tc.variables["ARROW_BUILD_INTEGRATION"] = False + tc.variables["ARROW_INSTALL_NAME_RPATH"] = False + tc.variables["ARROW_BUILD_EXAMPLES"] = False + tc.variables["ARROW_BUILD_TESTS"] = False + tc.variables["ARROW_ENABLE_TIMING_TESTS"] = False + tc.variables["ARROW_BUILD_BENCHMARKS"] = False + tc.variables["LLVM_SOURCE"] = "SYSTEM" + tc.variables["ARROW_WITH_UTF8PROC"] = self._with_utf8proc() + tc.variables["ARROW_BOOST_REQUIRED"] = self._with_boost() + tc.variables["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) - + tc.variables["ARROW_UTF8PROC_USE_SHARED"] = bool(self.options["utf8proc"].shared) + tc.variables["BUILD_WARNING_LEVEL"] = "PRODUCTION" + if is_msvc(self): + tc.variables["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 + tc.variables["LLVM_DIR"] = self.deps_cpp_info["llvm-core"].rootpath.replace("\\", "/") + tc.generate() + + deps = CMakeDeps(self) + deps.generate() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - # if tools.Version(self.version) >= "7.0.0": - # for filename in glob.glob(os.path.join(self._source_subfolder, "cpp", "cmake_modules", "Find*.cmake")): - # if os.path.basename(filename) not in [ - # "FindArrow.cmake", - # "FindArrowCUDA.cmake", - # "FindArrowDataset.cmake", - # "FindArrowFlight.cmake", - # "FindArrowFlightSql.cmake", - # "FindArrowFlightTesting.cmake", - # "FindArrowPython.cmake", - # "FindArrowPythonFlight.cmake", - # "FindArrowSubstrait.cmake", - # "FindArrowTesting.cmake", - # "FindGandiva.cmake", - # "FindParquet.cmake", - # "FindPlasma.cmake", - # ]: - # os.remove(filename) + apply_conandata_patches(self) + if Version(self.version) >= "7.0.0" and Version(self.version) < "11.0.0": + for filename in glob.glob(os.path.join(self.source_folder, "cpp", "cmake_modules", "Find*.cmake")): + if os.path.basename(filename) not in [ + "FindArrow.cmake", + "FindArrowCUDA.cmake", + "FindArrowDataset.cmake", + "FindArrowFlight.cmake", + "FindArrowFlightSql.cmake", + "FindArrowFlightTesting.cmake", + "FindArrowPython.cmake", + "FindArrowPythonFlight.cmake", + "FindArrowSubstrait.cmake", + "FindArrowTesting.cmake", + "FindGandiva.cmake", + "FindParquet.cmake", + "FindPlasma.cmake", + ]: + os.remove(filename) def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake =CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "cpp")) 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() + copy(self, pattern="LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="NOTICE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake =CMake(self) 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")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) def _lib_name(self, name): - if self.settings.compiler == "Visual Studio" and not self.options.shared: + if is_msvc(self) 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() @@ -607,16 +652,16 @@ def package_info(self): if (self.options.cli and (self.options.with_cuda or self._with_flight_rpc() or self._parquet())) or self.options.plasma: binpath = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH env var: {}".format(binpath)) + self.output.info(f"Appending PATH env var: {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._parquet() and self.settings.compiler == "gcc" and self.settings.compiler.version < tools.Version("4.9"): + if self._parquet() and self.settings.compiler == "gcc" and self.settings.compiler.version < Version("4.9"): self.cpp_info.components["libparquet"].requires.append("boost::boost") - if tools.Version(self.version) >= "2.0": + if Version(self.version) >= "2.0": # FIXME: only headers components is used self.cpp_info.components["libarrow"].requires.append("boost::boost") if self._with_openssl(): @@ -627,6 +672,8 @@ def package_info(self): self.cpp_info.components["libarrow"].requires.append("glog::glog") if self._with_jemalloc(): self.cpp_info.components["libarrow"].requires.append("jemalloc::jemalloc") + if self.options.with_mimalloc: + self.cpp_info.components["libarrow"].requires.append("mimalloc::mimalloc") if self._with_re2(): self.cpp_info.components["libgandiva"].requires.append("re2::re2") if self._with_llvm(): @@ -641,7 +688,7 @@ def package_info(self): 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_json: + if self._with_rapidjson(): self.cpp_info.components["libarrow"].requires.append("rapidjson::rapidjson") if self.options.with_s3: self.cpp_info.components["libarrow"].requires.append("aws-sdk-cpp::s3") @@ -665,6 +712,9 @@ def package_info(self): 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._with_boost(): + self.cpp_info.components["libarrow"].requires.append("boost::boost") + if self._with_grpc(): + self.cpp_info.components["libarrow"].requires.append("grpc::grpc") if self._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 deleted file mode 100644 index 9da894a127ba4..0000000000000 --- a/ci/conan/all/patches/1.0.0-0001-cmake.patch +++ /dev/null @@ -1,114 +0,0 @@ -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 deleted file mode 100644 index 30402fd4b0f98..0000000000000 --- a/ci/conan/all/patches/1.0.0-0002-jemalloc.patch +++ /dev/null @@ -1,65 +0,0 @@ -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-0005-fix-make12-namespace.patch b/ci/conan/all/patches/1.0.0-0005-fix-make12-namespace.patch new file mode 100644 index 0000000000000..199804bff00ab --- /dev/null +++ b/ci/conan/all/patches/1.0.0-0005-fix-make12-namespace.patch @@ -0,0 +1,44 @@ +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/vendored/datetime/date.h b/cpp/src/arrow/vendored/datetime/date.h +index 02a4909..2b168d2 100644 +--- a/cpp/src/arrow/vendored/datetime/date.h ++++ b/cpp/src/arrow/vendored/datetime/date.h +@@ -5152,7 +5152,7 @@ to_stream(std::basic_ostream& os, const CharT* fmt, + if (modified == CharT{}) + #endif + { +- auto h = *fmt == CharT{'I'} ? make12(hms.hours()) : hms.hours(); ++ auto h = *fmt == CharT{'I'} ? arrow_vendored::date::make12(hms.hours()) : hms.hours(); + if (h < hours{10}) + os << CharT{'0'}; + os << h.count(); +@@ -5366,7 +5366,7 @@ to_stream(std::basic_ostream& os, const CharT* fmt, + save_ostream _(os); + os.fill('0'); + os.width(2); +- os << make12(tod.hours()).count() << CharT{':'}; ++ os << arrow_vendored::date::make12(tod.hours()).count() << CharT{':'}; + os.width(2); + os << tod.minutes().count() << CharT{':'}; + os.width(2); diff --git a/ci/conan/all/patches/1.0.0-0006-fix-cmake.patch b/ci/conan/all/patches/1.0.0-0006-fix-cmake.patch new file mode 100644 index 0000000000000..3ecd0bf9f3968 --- /dev/null +++ b/ci/conan/all/patches/1.0.0-0006-fix-cmake.patch @@ -0,0 +1,355 @@ +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 300f043..0127a7a 100644 +--- a/cpp/CMakeLists.txt ++++ b/cpp/CMakeLists.txt +@@ -654,7 +654,7 @@ endif() + + if(ARROW_WITH_BROTLI) + # Order is important for static linking +- set(ARROW_BROTLI_LIBS Brotli::brotlienc Brotli::brotlidec Brotli::brotlicommon) ++ set(ARROW_BROTLI_LIBS brotli::brotlienc brotli::brotlidec brotli::brotlicommon) + list(APPEND ARROW_LINK_LIBS ${ARROW_BROTLI_LIBS}) + list(APPEND ARROW_STATIC_LINK_LIBS ${ARROW_BROTLI_LIBS}) + endif() +@@ -664,7 +664,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_static) + endif() + + if(ARROW_WITH_SNAPPY) +@@ -800,8 +800,11 @@ endif() + + if(ARROW_MIMALLOC) + add_definitions(-DARROW_MIMALLOC) +- list(APPEND ARROW_LINK_LIBS mimalloc::mimalloc) +- list(APPEND ARROW_STATIC_LINK_LIBS mimalloc::mimalloc) ++ if (TARGET mimalloc-static) ++ list(APPEND ARROW_LINK_LIBS mimalloc-static) ++ else() ++ list(APPEND ARROW_STATIC_LINK_LIBS mimalloc) ++ endif() + endif() + + # ---------------------------------------------------------------------- +diff --git a/cpp/cmake_modules/BuildUtils.cmake b/cpp/cmake_modules/BuildUtils.cmake +index eb10ebe..9c81017 100644 +--- a/cpp/cmake_modules/BuildUtils.cmake ++++ b/cpp/cmake_modules/BuildUtils.cmake +@@ -165,10 +165,10 @@ function(create_merged_static_lib output_target) + set(ar_script_path ${CMAKE_BINARY_DIR}/${ARG_NAME}.ar) + + file(WRITE ${ar_script_path}.in "CREATE ${output_lib_path}\n") +- file(APPEND ${ar_script_path}.in "ADDLIB $\n") ++ file(APPEND ${ar_script_path}.in "ADDLIB $\n") + + foreach(lib ${ARG_TO_MERGE}) +- file(APPEND ${ar_script_path}.in "ADDLIB $\n") ++ file(APPEND ${ar_script_path}.in "ADDLIB $\n") + endforeach() + + file(APPEND ${ar_script_path}.in "SAVE\nEND\n") +diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake +index 807e2b9..016c8db 100644 +--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake ++++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake +@@ -154,16 +154,7 @@ macro(build_dependency DEPENDENCY_NAME) + endmacro() + + macro(resolve_dependency DEPENDENCY_NAME) +- if(${DEPENDENCY_NAME}_SOURCE STREQUAL "AUTO") +- find_package(${DEPENDENCY_NAME} MODULE) +- if(NOT ${${DEPENDENCY_NAME}_FOUND}) +- build_dependency(${DEPENDENCY_NAME}) +- endif() +- elseif(${DEPENDENCY_NAME}_SOURCE STREQUAL "BUNDLED") +- build_dependency(${DEPENDENCY_NAME}) +- elseif(${DEPENDENCY_NAME}_SOURCE STREQUAL "SYSTEM") +- find_package(${DEPENDENCY_NAME} REQUIRED) +- endif() ++ find_package(${DEPENDENCY_NAME} REQUIRED) + endmacro() + + macro(resolve_dependency_with_version DEPENDENCY_NAME REQUIRED_VERSION) +@@ -765,6 +756,7 @@ endif() + # - Tests need Boost at runtime. + # - S3FS and Flight benchmarks need Boost at runtime. + if(ARROW_BUILD_INTEGRATION ++ OR ARROW_BOOST_REQUIRED + OR ARROW_BUILD_TESTS + OR ARROW_GANDIVA + OR (ARROW_FLIGHT AND ARROW_BUILD_BENCHMARKS) +@@ -785,7 +777,7 @@ if(ARROW_BOOST_REQUIRED) + elseif(BOOST_SOURCE STREQUAL "BUNDLED") + build_boost() + elseif(BOOST_SOURCE STREQUAL "SYSTEM") +- find_package(BoostAlt ${ARROW_BOOST_REQUIRED_VERSION} REQUIRED) ++ find_package(Boost ${ARROW_BOOST_REQUIRED_VERSION} REQUIRED) + endif() + + if(TARGET Boost::system) +@@ -936,11 +928,11 @@ macro(build_brotli) + endmacro() + + if(ARROW_WITH_BROTLI) +- resolve_dependency(Brotli) ++ resolve_dependency(brotli) + # TODO: Don't use global includes but rather target_include_directories +- get_target_property(BROTLI_INCLUDE_DIR Brotli::brotlicommon ++ get_target_property(BROTLI_INCLUDE_DIR brotli::brotlicommon + INTERFACE_INCLUDE_DIRECTORIES) +- include_directories(SYSTEM ${BROTLI_INCLUDE_DIR}) ++ include_directories(SYSTEM ${brotli_INCLUDE_DIR}) + endif() + + if(PARQUET_REQUIRE_ENCRYPTION AND NOT ARROW_PARQUET) +@@ -1146,9 +1138,10 @@ if(ARROW_NEED_GFLAGS) + endif() + endif() + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${GFLAGS_INCLUDE_DIR}) ++ include_directories(SYSTEM ${gflags_INCLUDE_DIR}) ++ set(GFLAGS_LIBRARIES ${gflags_LIBRARIES}) + +- if(NOT TARGET ${GFLAGS_LIBRARIES}) ++ if(0) + if(TARGET gflags-shared) + set(GFLAGS_LIBRARIES gflags-shared) + elseif(TARGET gflags_shared) +@@ -1237,12 +1230,13 @@ endmacro() + if(ARROW_WITH_THRIFT) + # We already may have looked for Thrift earlier, when considering whether + # to build Boost, so don't look again if already found. +- if(NOT Thrift_FOUND AND NOT THRIFT_FOUND) ++ if(0) + # Thrift c++ code generated by 0.13 requires 0.11 or greater + resolve_dependency_with_version(Thrift 0.11.0) + endif() ++ find_package(Thrift CONFIG REQUIRED) + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${THRIFT_INCLUDE_DIR}) ++ include_directories(SYSTEM ${Thrift_INCLUDE_DIR}) + endif() + + # ---------------------------------------------------------------------- +@@ -1407,6 +1401,7 @@ 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,12 +1460,18 @@ if(ARROW_JEMALLOC) + add_dependencies(jemalloc::jemalloc jemalloc_ep) + + list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc::jemalloc) ++else() ++ find_package(jemalloc REQUIRED CONFIG) ++ include_directories(SYSTEM "${jemalloc_INCLUDE_DIR}") ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${jemalloc_LIBRARIES_TARGETS} ) ++endif() + 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. + +@@ -1518,6 +1519,11 @@ if(ARROW_MIMALLOC) + add_dependencies(toolchain mimalloc_ep) + + list(APPEND ARROW_BUNDLED_STATIC_LIBS mimalloc::mimalloc) ++else() ++ find_package(mimalloc REQUIRED CONFIG) ++ include_directories(SYSTEM "${mimalloc_INCLUDE_DIR}") ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${mimalloc_LIBRARIES_TARGETS} ) ++endif() + endif() + + # ---------------------------------------------------------------------- +@@ -1918,11 +1924,16 @@ macro(build_lz4) + endmacro() + + if(ARROW_WITH_LZ4) +- resolve_dependency(Lz4) ++ resolve_dependency(lz4) + + # 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}) ++ if(TARGET LZ4::lz4_static) ++ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_static INTERFACE_INCLUDE_DIRECTORIES) ++ else() ++ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_shared INTERFACE_INCLUDE_DIRECTORIES) ++ endif() ++ include_directories(SYSTEM ${lz4_INCLUDE_DIR}) ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${lz4_LIBRARIES_TARGETS} ) + endif() + + macro(build_zstd) +@@ -2037,10 +2048,10 @@ macro(build_re2) + endmacro() + + if(ARROW_GANDIVA) +- resolve_dependency(RE2) ++ 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() + +@@ -2480,17 +2491,24 @@ if(ARROW_WITH_GRPC) + endif() + + # TODO: Don't use global includes but rather target_include_directories +- get_target_property(GRPC_INCLUDE_DIR gRPC::grpc INTERFACE_INCLUDE_DIRECTORIES) ++ # get_target_property(GRPC_INCLUDE_DIR gRPC::grpc INTERFACE_INCLUDE_DIRECTORIES) ++ if(grpc_INCLUDE_DIRS_RELEASE) ++ set(GRPC_INCLUDE_DIR ${grpc_INCLUDE_DIRS_RELEASE}) ++ elseif(grpc_INCLUDE_DIRS_DEBUG) ++ set(GRPC_INCLUDE_DIR ${grpc_INCLUDE_DIRS_DEBUG}) ++ endif() + include_directories(SYSTEM ${GRPC_INCLUDE_DIR}) ++ include_directories(SYSTEM ${absl_INCLUDE_DIR}) ++ include_directories(SYSTEM ${protobuf_INCLUDE_DIR}) + + if(GRPC_VENDORED) + set(GRPCPP_PP_INCLUDE TRUE) + 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") ++ 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") ++ 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}") +diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt +index 5797a78..da6bd4d 100644 +--- a/cpp/src/arrow/CMakeLists.txt ++++ b/cpp/src/arrow/CMakeLists.txt +@@ -292,10 +292,15 @@ 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) ++ if (TARGET mimalloc-static) ++ list(APPEND _allocator_dependencies mimalloc-static) ++ else() ++ list(APPEND _allocator_dependencies mimalloc) ++ endif() + endif() + + if(_allocator_dependencies) +diff --git a/cpp/src/arrow/memory_pool.cc b/cpp/src/arrow/memory_pool.cc +index 784bf7b..8f005a5 100644 +--- a/cpp/src/arrow/memory_pool.cc ++++ b/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/cpp/src/gandiva/CMakeLists.txt b/cpp/src/gandiva/CMakeLists.txt +index 85e8db6..cd70c63 100644 +--- a/cpp/src/gandiva/CMakeLists.txt ++++ b/cpp/src/gandiva/CMakeLists.txt +@@ -25,7 +25,7 @@ add_custom_target(gandiva-benchmarks) + + add_dependencies(gandiva-all gandiva gandiva-tests gandiva-benchmarks) + +-find_package(LLVMAlt REQUIRED) ++find_package(LLVM REQUIRED) + + if(LLVM_VERSION_MAJOR LESS "10") + set(GANDIVA_CXX_STANDARD ${CMAKE_CXX_STANDARD}) +@@ -88,9 +88,16 @@ 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_STATIC_LINK_LIBS arrow_static LLVM::LLVM_INTERFACE RE2::re2) ++ function(get_all_targets var) ++ set(targets) ++ get_all_targets_recursive(targets ${CMAKE_CURRENT_SOURCE_DIR}) ++ set(${var} ${targets} PARENT_SCOPE) ++endfunction() ++ ++set(GANDIVA_SHARED_PRIVATE_LINK_LIBS arrow_shared llvm-core::llvm-core 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 +138,7 @@ add_arrow_lib(gandiva + arrow_dependencies + precompiled + EXTRA_INCLUDES +- $ ++ $ + SHARED_LINK_FLAGS + ${GANDIVA_SHARED_LINK_FLAGS} + SHARED_LINK_LIBS +@@ -203,7 +210,7 @@ endfunction() + + set(GANDIVA_INTERNALS_TEST_ARGUMENTS) + if(WIN32) +- list(APPEND GANDIVA_INTERNALS_TEST_ARGUMENTS EXTRA_LINK_LIBS LLVM::LLVM_INTERFACE) ++ list(APPEND GANDIVA_INTERNALS_TEST_ARGUMENTS EXTRA_LINK_LIBS llvm-core::llvm-core) + endif() + add_gandiva_test(internals-test + SOURCES +@@ -225,9 +232,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/8.0.0-0001-cmake.patch b/ci/conan/all/patches/10.0.0-0001-mallctl-takes-size_t.patch similarity index 65% rename from ci/conan/all/patches/8.0.0-0001-cmake.patch rename to ci/conan/all/patches/10.0.0-0001-mallctl-takes-size_t.patch index 9e67f4a191208..3428797472ca1 100644 --- a/ci/conan/all/patches/8.0.0-0001-cmake.patch +++ b/ci/conan/all/patches/10.0.0-0001-mallctl-takes-size_t.patch @@ -20,16 +20,16 @@ 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 ab7d2ed..6f1e411 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() +diff --git a/cpp/src/arrow/memory_pool_jemalloc.cc b/cpp/src/arrow/memory_pool_jemalloc.cc +index c7d73c8..34c7c63 100644 +--- a/cpp/src/arrow/memory_pool_jemalloc.cc ++++ b/cpp/src/arrow/memory_pool_jemalloc.cc +@@ -140,7 +140,7 @@ void JemallocAllocator::ReleaseUnused() { + } while (0) - # Top level cmake dir --if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") -+if(1) - #---------------------------------------------------------------------- - set_option_category("Compile and link") + Status jemalloc_set_decay_ms(int ms) { +- 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/10.0.0-0002-fix-cmake.patch b/ci/conan/all/patches/10.0.0-0002-fix-cmake.patch new file mode 100644 index 0000000000000..15d197836ec23 --- /dev/null +++ b/ci/conan/all/patches/10.0.0-0002-fix-cmake.patch @@ -0,0 +1,333 @@ +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 029f13f..3518a23 100644 +--- a/cpp/CMakeLists.txt ++++ b/cpp/CMakeLists.txt +@@ -659,7 +659,7 @@ endif() + + if(ARROW_WITH_BROTLI) + # Order is important for static linking +- set(ARROW_BROTLI_LIBS Brotli::brotlienc Brotli::brotlidec Brotli::brotlicommon) ++ set(ARROW_BROTLI_LIBS brotli::brotlienc brotli::brotlidec brotli::brotlicommon) + list(APPEND ARROW_SHARED_LINK_LIBS ${ARROW_BROTLI_LIBS}) + list(APPEND ARROW_STATIC_LINK_LIBS ${ARROW_BROTLI_LIBS}) + if(Brotli_SOURCE STREQUAL "SYSTEM") +@@ -675,14 +675,21 @@ if(ARROW_WITH_BZ2) + endif() + + if(ARROW_WITH_LZ4) +- list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4) ++if (TARGET LZ4::lz4_static) ++ list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4_static) + if(lz4_SOURCE STREQUAL "SYSTEM") +- list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4) ++ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4_static) + endif() ++else() ++ list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4_shared) ++ if(lz4_SOURCE STREQUAL "SYSTEM") ++ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4_shared) ++ endif() ++endif() + endif() + + if(ARROW_WITH_SNAPPY) +- list(APPEND ARROW_STATIC_LINK_LIBS ${Snappy_TARGET}) ++ list(APPEND ARROW_STATIC_LINK_LIBS Snappy::snappy) + if(Snappy_SOURCE STREQUAL "SYSTEM") + list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS ${Snappy_TARGET}) + endif() +diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake +index b7cd31f..78f3df3 100644 +--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake ++++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake +@@ -1162,10 +1162,12 @@ endmacro() + + if(ARROW_WITH_SNAPPY) + resolve_dependency(Snappy +- HAVE_ALT ++ USE_CONFIG + TRUE + PC_PACKAGE_NAMES + snappy) ++ ++ if(0) + if(${Snappy_SOURCE} STREQUAL "SYSTEM" AND NOT snappy_PC_FOUND) + get_target_property(SNAPPY_TYPE ${Snappy_TARGET} TYPE) + if(NOT SNAPPY_TYPE STREQUAL "INTERFACE_LIBRARY") +@@ -1180,6 +1182,9 @@ if(ARROW_WITH_SNAPPY) + string(APPEND ARROW_PC_LIBS_PRIVATE " ${SNAPPY_LIB}") + endif() + endif() ++ else() ++ string(APPEND ARROW_PC_LIBS_PRIVATE " ${Snappy_LIBRARIES}") ++ endif() + endif() + + # ---------------------------------------------------------------------- +@@ -1242,7 +1247,7 @@ macro(build_brotli) + endmacro() + + if(ARROW_WITH_BROTLI) +- resolve_dependency(Brotli PC_PACKAGE_NAMES libbrotlidec libbrotlienc) ++ resolve_dependency(brotli PC_PACKAGE_NAMES libbrotlidec libbrotlienc) + endif() + + if(PARQUET_REQUIRE_ENCRYPTION AND NOT ARROW_PARQUET) +@@ -1256,7 +1261,7 @@ if(PARQUET_REQUIRE_ENCRYPTION + OR ARROW_GANDIVA) + set(OpenSSL_SOURCE "SYSTEM") + resolve_dependency(OpenSSL +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_OPENSSL_REQUIRED_VERSION}) +@@ -1399,22 +1404,14 @@ endmacro() + if(ARROW_NEED_GFLAGS) + set(ARROW_GFLAGS_REQUIRED_VERSION "2.1.0") + resolve_dependency(gflags +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_GFLAGS_REQUIRED_VERSION} + IS_RUNTIME_DEPENDENCY + FALSE) + +- if(NOT TARGET ${GFLAGS_LIBRARIES}) +- if(TARGET gflags::gflags_shared) +- set(GFLAGS_LIBRARIES gflags::gflags_shared) +- elseif(TARGET gflags-shared) +- set(GFLAGS_LIBRARIES gflags-shared) +- elseif(TARGET gflags_shared) +- set(GFLAGS_LIBRARIES gflags_shared) +- endif() +- endif() ++ set(GFLAGS_LIBRARIES gflags::gflags) + endif() + + # ---------------------------------------------------------------------- +@@ -1638,7 +1635,7 @@ if(ARROW_WITH_PROTOBUF) + set(ARROW_PROTOBUF_REQUIRED_VERSION "2.6.1") + endif() + resolve_dependency(Protobuf +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_PROTOBUF_REQUIRED_VERSION} +@@ -1770,7 +1767,7 @@ macro(build_substrait) + + add_custom_target(substrait_gen ALL DEPENDS ${SUBSTRAIT_PROTO_GEN_ALL}) + +- set(SUBSTRAIT_INCLUDES ${SUBSTRAIT_CPP_DIR} ${PROTOBUF_INCLUDE_DIR}) ++ set(SUBSTRAIT_INCLUDES ${SUBSTRAIT_CPP_DIR} ${protobuf_INCLUDE_DIR}) + + add_library(substrait STATIC ${SUBSTRAIT_SOURCES}) + set_target_properties(substrait PROPERTIES POSITION_INDEPENDENT_CODE ON) +@@ -1781,6 +1778,8 @@ macro(build_substrait) + list(APPEND ARROW_BUNDLED_STATIC_LIBS substrait) + endmacro() + ++set(CMAKE_VERBOSE_MAKEFILE ON) ++ + if(ARROW_SUBSTRAIT) + # Currently, we can only build Substrait from source. + set(Substrait_SOURCE "BUNDLED") +@@ -1866,7 +1865,10 @@ macro(build_jemalloc) + endmacro() + + if(ARROW_JEMALLOC) +- resolve_dependency(jemalloc) ++ #resolve_dependency(jemalloc) ++ find_package(jemalloc REQUIRED CONFIG) ++ include_directories(SYSTEM "${jemalloc_INCLUDE_DIR}") ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${jemalloc_LIBRARIES_TARGETS}) + endif() + + # ---------------------------------------------------------------------- +@@ -2186,7 +2188,7 @@ endmacro() + if(ARROW_WITH_RAPIDJSON) + set(ARROW_RAPIDJSON_REQUIRED_VERSION "1.1.0") + resolve_dependency(RapidJSON +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_RAPIDJSON_REQUIRED_VERSION} +@@ -2334,19 +2336,29 @@ macro(build_lz4) + BUILD_BYPRODUCTS ${LZ4_STATIC_LIB}) + + file(MAKE_DIRECTORY "${LZ4_PREFIX}/include") +- add_library(LZ4::lz4 STATIC IMPORTED) +- set_target_properties(LZ4::lz4 +- PROPERTIES IMPORTED_LOCATION "${LZ4_STATIC_LIB}" +- INTERFACE_INCLUDE_DIRECTORIES "${LZ4_PREFIX}/include") +- add_dependencies(toolchain lz4_ep) +- add_dependencies(LZ4::lz4 lz4_ep) +- +- list(APPEND ARROW_BUNDLED_STATIC_LIBS LZ4::lz4) ++ if (TARGET LZ4::lz4_static) ++ add_library(LZ4::lz4_static STATIC IMPORTED) ++ set_target_properties(LZ4::lz4_static ++ PROPERTIES IMPORTED_LOCATION "${LZ4_STATIC_LIB}" ++ INTERFACE_INCLUDE_DIRECTORIES "${LZ4_PREFIX}/include") ++ add_dependencies(toolchain lz4_ep) ++ add_dependencies(LZ4::lz4_static lz4_ep) ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS LZ4::lz4_static) ++ else() ++ add_library(LZ4::lz4_shared STATIC IMPORTED) ++ set_target_properties(LZ4::lz4_shared ++ PROPERTIES IMPORTED_LOCATION "${LZ4_SHARED_LIB}" ++ INTERFACE_INCLUDE_DIRECTORIES "${LZ4_PREFIX}/include") ++ add_dependencies(toolchain lz4_ep) ++ add_dependencies(LZ4::lz4_shared lz4_ep) ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS LZ4::lz4_shared) ++ endif() ++ + endmacro() + + if(ARROW_WITH_LZ4) + resolve_dependency(lz4 +- HAVE_ALT ++ USE_CONFIG + TRUE + PC_PACKAGE_NAMES + liblz4) +@@ -2415,7 +2427,7 @@ endmacro() + if(ARROW_WITH_ZSTD) + # ARROW-13384: ZSTD_minCLevel was added in v1.4.0, required by ARROW-13091 + resolve_dependency(zstd +- HAVE_ALT ++ USE_CONFIG + TRUE + PC_PACKAGE_NAMES + libzstd +@@ -2477,7 +2489,7 @@ if(ARROW_WITH_RE2) + # 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. +- resolve_dependency(re2 HAVE_ALT TRUE) ++ resolve_dependency(re2 USE_CONFIG TRUE) + if(${re2_SOURCE} STREQUAL "SYSTEM") + get_target_property(RE2_TYPE re2::re2 TYPE) + if(NOT RE2_TYPE STREQUAL "INTERFACE_LIBRARY") +@@ -3922,7 +3934,7 @@ if(ARROW_WITH_GRPC) + set(gRPC_SOURCE "${Protobuf_SOURCE}") + endif() + resolve_dependency(gRPC +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_GRPC_REQUIRED_VERSION} +@@ -3939,9 +3951,9 @@ if(ARROW_WITH_GRPC) + get_target_property(GRPC_INCLUDE_DIR gRPC::grpc++ INTERFACE_INCLUDE_DIRECTORIES) + if(GRPC_INCLUDE_DIR MATCHES "^\\$<" + OR # generator expression +- EXISTS "${GRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h") ++ 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") ++ 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}") +@@ -4282,8 +4294,11 @@ macro(build_orc) + get_target_property(ORC_SNAPPY_INCLUDE_DIR ${Snappy_TARGET} + INTERFACE_INCLUDE_DIRECTORIES) + get_filename_component(ORC_SNAPPY_ROOT "${ORC_SNAPPY_INCLUDE_DIR}" DIRECTORY) +- +- get_target_property(ORC_LZ4_ROOT LZ4::lz4 INTERFACE_INCLUDE_DIRECTORIES) ++ if (TARGET LZ4::lz4_static) ++ get_target_property(ORC_LZ4_ROOT LZ4::lz4_static INTERFACE_INCLUDE_DIRECTORIES) ++ else() ++ get_target_property(ORC_LZ4_ROOT LZ4::lz4_shared INTERFACE_INCLUDE_DIRECTORIES) ++ endif() + get_filename_component(ORC_LZ4_ROOT "${ORC_LZ4_ROOT}" DIRECTORY) + + get_target_property(ORC_ZSTD_ROOT ${ARROW_ZSTD_LIBZSTD} INTERFACE_INCLUDE_DIRECTORIES) +@@ -4321,16 +4336,29 @@ macro(build_orc) + # Work around CMake bug + file(MAKE_DIRECTORY ${ORC_INCLUDE_DIR}) + +- externalproject_add(orc_ep +- URL ${ORC_SOURCE_URL} +- URL_HASH "SHA256=${ARROW_ORC_BUILD_SHA256_CHECKSUM}" +- BUILD_BYPRODUCTS ${ORC_STATIC_LIB} +- CMAKE_ARGS ${ORC_CMAKE_ARGS} ${EP_LOG_OPTIONS} +- DEPENDS ${ARROW_PROTOBUF_LIBPROTOBUF} +- ${ARROW_ZSTD_LIBZSTD} +- ${Snappy_TARGET} +- LZ4::lz4 +- ZLIB::ZLIB) ++ if (TARGET LZ4::lz4_static) ++ externalproject_add(orc_ep ++ URL ${ORC_SOURCE_URL} ++ URL_HASH "SHA256=${ARROW_ORC_BUILD_SHA256_CHECKSUM}" ++ BUILD_BYPRODUCTS ${ORC_STATIC_LIB} ++ CMAKE_ARGS ${ORC_CMAKE_ARGS} ${EP_LOG_OPTIONS} ++ DEPENDS ${ARROW_PROTOBUF_LIBPROTOBUF} ++ ${ARROW_ZSTD_LIBZSTD} ++ ${Snappy_TARGET} ++ LZ4::lz4_static ++ ZLIB::ZLIB) ++ else() ++ externalproject_add(orc_ep ++ URL ${ORC_SOURCE_URL} ++ URL_HASH "SHA256=${ARROW_ORC_BUILD_SHA256_CHECKSUM}" ++ BUILD_BYPRODUCTS ${ORC_STATIC_LIB} ++ CMAKE_ARGS ${ORC_CMAKE_ARGS} ${EP_LOG_OPTIONS} ++ DEPENDS ${ARROW_PROTOBUF_LIBPROTOBUF} ++ ${ARROW_ZSTD_LIBZSTD} ++ ${Snappy_TARGET} ++ LZ4::lz4_shared ++ ZLIB::ZLIB) ++ endif() + + set(ORC_VENDORED 1) + +@@ -4338,7 +4366,11 @@ macro(build_orc) + set_target_properties(orc::liborc + PROPERTIES IMPORTED_LOCATION "${ORC_STATIC_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${ORC_INCLUDE_DIR}") +- set(ORC_LINK_LIBRARIES LZ4::lz4 ZLIB::ZLIB ${ARROW_ZSTD_LIBZSTD} ${Snappy_TARGET}) ++ if (TARGET LZ4::lz4_static) ++ set(ORC_LINK_LIBRARIES LZ4::lz4_static ZLIB::ZLIB ${ARROW_ZSTD_LIBZSTD} ${Snappy_TARGET}) ++ else() ++ set(ORC_LINK_LIBRARIES LZ4::lz4_shared ZLIB::ZLIB ${ARROW_ZSTD_LIBZSTD} ${Snappy_TARGET}) ++ endif() + if(NOT MSVC) + if(NOT APPLE) + list(APPEND ORC_LINK_LIBRARIES Threads::Threads) +@@ -4765,7 +4797,7 @@ macro(build_awssdk) + endmacro() + + if(ARROW_S3) +- resolve_dependency(AWSSDK HAVE_ALT TRUE) ++ resolve_dependency(AWSSDK USE_CONFIG TRUE) + + message(STATUS "Found AWS SDK headers: ${AWSSDK_INCLUDE_DIR}") + message(STATUS "Found AWS SDK libraries: ${AWSSDK_LINK_LIBRARIES}") diff --git a/ci/conan/all/patches/2.0.0-0001-cmake.patch b/ci/conan/all/patches/2.0.0-0001-cmake.patch deleted file mode 100644 index a41b8e5d20c86..0000000000000 --- a/ci/conan/all/patches/2.0.0-0001-cmake.patch +++ /dev/null @@ -1,41 +0,0 @@ -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 deleted file mode 100644 index f1ff9eee78b62..0000000000000 --- a/ci/conan/all/patches/2.0.0-0002-jemalloc.patch +++ /dev/null @@ -1,65 +0,0 @@ -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-0006-gandiva-llvm-re2.patch b/ci/conan/all/patches/2.0.0-0006-gandiva-llvm-re2.patch deleted file mode 100644 index 5e87d541a9df2..0000000000000 --- a/ci/conan/all/patches/2.0.0-0006-gandiva-llvm-re2.patch +++ /dev/null @@ -1,100 +0,0 @@ -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 deleted file mode 100644 index c7157f06e0c65..0000000000000 --- a/ci/conan/all/patches/2.0.0-0007-fix-protoc-cmake.patch +++ /dev/null @@ -1,33 +0,0 @@ -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/2.0.0-0008-fix-cmake.patch b/ci/conan/all/patches/2.0.0-0008-fix-cmake.patch new file mode 100644 index 0000000000000..abdcf7a0fa36a --- /dev/null +++ b/ci/conan/all/patches/2.0.0-0008-fix-cmake.patch @@ -0,0 +1,295 @@ +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 515e6af..7488161 100644 +--- a/cpp/CMakeLists.txt ++++ b/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 "13" "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 +@@ -667,7 +667,7 @@ endif() + + if(ARROW_WITH_BROTLI) + # Order is important for static linking +- set(ARROW_BROTLI_LIBS Brotli::brotlienc Brotli::brotlidec Brotli::brotlicommon) ++ set(ARROW_BROTLI_LIBS brotli::brotlienc brotli::brotlidec brotli::brotlicommon) + list(APPEND ARROW_LINK_LIBS ${ARROW_BROTLI_LIBS}) + list(APPEND ARROW_STATIC_LINK_LIBS ${ARROW_BROTLI_LIBS}) + if(Brotli_SOURCE STREQUAL "SYSTEM") +@@ -683,9 +683,9 @@ 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) ++ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS lz4::lz4) + endif() + endif() + +@@ -842,8 +842,14 @@ endif() + + if(ARROW_MIMALLOC) + add_definitions(-DARROW_MIMALLOC) +- list(APPEND ARROW_LINK_LIBS mimalloc::mimalloc) +- list(APPEND ARROW_STATIC_LINK_LIBS mimalloc::mimalloc) ++ if (TARGET mimalloc-static) ++ list(APPEND ARROW_LINK_LIBS mimalloc-static) ++ list(APPEND ARROW_STATIC_LINK_LIBS mimalloc-static) ++ else() ++ list(APPEND ARROW_LINK_LIBS mimalloc) ++ list(APPEND ARROW_STATIC_LINK_LIBS mimalloc) ++ endif() ++ + endif() + + # ---------------------------------------------------------------------- +diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake +index cc37a3c..8fe6db9 100644 +--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake ++++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake +@@ -171,6 +171,7 @@ macro(provide_find_module DEPENDENCY_NAME) + endmacro() + + macro(resolve_dependency DEPENDENCY_NAME) ++if(0) + set(options) + set(one_value_args REQUIRED_VERSION) + cmake_parse_arguments(ARG +@@ -207,6 +208,14 @@ macro(resolve_dependency DEPENDENCY_NAME) + provide_find_module(${DEPENDENCY_NAME}) + list(APPEND ARROW_SYSTEM_DEPENDENCIES ${DEPENDENCY_NAME}) + endif() ++else() ++ if(ARG_REQUIRED_VERSION) ++ find_package(${DEPENDENCY_NAME} ${ARG_REQUIRED_VERSION} REQUIRED) ++ else() ++ find_package(${DEPENDENCY_NAME} REQUIRED) ++ endif() ++ list(APPEND ARROW_SYSTEM_DEPENDENCIES ${DEPENDENCY_NAME}) ++endif() + endmacro() + + # ---------------------------------------------------------------------- +@@ -826,6 +835,7 @@ endif() + # - Tests need Boost at runtime. + # - S3FS and Flight benchmarks need Boost at runtime. + if(ARROW_BUILD_INTEGRATION ++ OR ARROW_BOOST_REQUIRED + OR ARROW_BUILD_TESTS + OR ARROW_GANDIVA + OR (ARROW_FLIGHT AND ARROW_BUILD_BENCHMARKS) +@@ -846,7 +856,7 @@ if(ARROW_BOOST_REQUIRED) + elseif(BOOST_SOURCE STREQUAL "BUNDLED") + build_boost() + elseif(BOOST_SOURCE STREQUAL "SYSTEM") +- find_package(BoostAlt ${ARROW_BOOST_REQUIRED_VERSION} REQUIRED) ++ find_package(Boost ${ARROW_BOOST_REQUIRED_VERSION} REQUIRED) + endif() + + if(TARGET Boost::system) +@@ -973,11 +983,11 @@ macro(build_brotli) + endmacro() + + if(ARROW_WITH_BROTLI) +- resolve_dependency(Brotli) ++ resolve_dependency(brotli) + # TODO: Don't use global includes but rather target_include_directories +- get_target_property(BROTLI_INCLUDE_DIR Brotli::brotlicommon ++ get_target_property(BROTLI_INCLUDE_DIR brotli::brotlicommon + INTERFACE_INCLUDE_DIRECTORIES) +- include_directories(SYSTEM ${BROTLI_INCLUDE_DIR}) ++ include_directories(SYSTEM ${brotli_INCLUDE_DIR}) + endif() + + if(PARQUET_REQUIRE_ENCRYPTION AND NOT ARROW_PARQUET) +@@ -1200,9 +1210,10 @@ if(ARROW_NEED_GFLAGS) + endif() + endif() + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${GFLAGS_INCLUDE_DIR}) ++ include_directories(SYSTEM ${gflags_INCLUDE_DIR}) ++ set(GFLAGS_LIBRARIES ${gflags_LIBRARIES}) + +- if(NOT TARGET ${GFLAGS_LIBRARIES}) ++ if(0) + if(TARGET gflags-shared) + set(GFLAGS_LIBRARIES gflags-shared) + elseif(TARGET gflags_shared) +@@ -1291,12 +1302,13 @@ endmacro() + if(ARROW_WITH_THRIFT) + # We already may have looked for Thrift earlier, when considering whether + # to build Boost, so don't look again if already found. +- if(NOT Thrift_FOUND AND NOT THRIFT_FOUND) ++ if(0) + # Thrift c++ code generated by 0.13 requires 0.11 or greater + resolve_dependency(Thrift REQUIRED_VERSION 0.11.0) + endif() ++ find_package(Thrift CONFIG REQUIRED) + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${THRIFT_INCLUDE_DIR}) ++ include_directories(SYSTEM ${Thrift_INCLUDE_DIR}) + endif() + + # ---------------------------------------------------------------------- +@@ -1461,6 +1473,7 @@ 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 +@@ -1519,12 +1532,18 @@ if(ARROW_JEMALLOC) + add_dependencies(jemalloc::jemalloc jemalloc_ep) + + list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc::jemalloc) ++else() ++ find_package(jemalloc REQUIRED CONFIG) ++ include_directories(SYSTEM "${jemalloc_INCLUDE_DIR}") ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${jemalloc_LIBRARIES_TARGETS} ) ++endif() + 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. + +@@ -1572,6 +1591,11 @@ if(ARROW_MIMALLOC) + add_dependencies(toolchain mimalloc_ep) + + list(APPEND ARROW_BUNDLED_STATIC_LIBS mimalloc::mimalloc) ++else() ++ find_package(mimalloc REQUIRED CONFIG) ++ include_directories(SYSTEM "${mimalloc_INCLUDE_DIR}") ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${mimalloc_LIBRARIES_TARGETS} ) ++endif() + endif() + + # ---------------------------------------------------------------------- +@@ -1971,11 +1995,16 @@ macro(build_lz4) + endmacro() + + if(ARROW_WITH_LZ4) +- resolve_dependency(Lz4) ++ resolve_dependency(lz4) + + # 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}) ++ if(TARGET LZ4::lz4_static) ++ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_static INTERFACE_INCLUDE_DIRECTORIES) ++ else() ++ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_shared INTERFACE_INCLUDE_DIRECTORIES) ++ endif() ++ include_directories(SYSTEM ${lz4_INCLUDE_DIR}) ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${lz4_LIBRARIES_TARGETS} ) + endif() + + macro(build_zstd) +@@ -2090,10 +2119,10 @@ macro(build_re2) + endmacro() + + if(ARROW_GANDIVA) +- resolve_dependency(RE2) ++ 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() + +@@ -2541,17 +2570,24 @@ if(ARROW_WITH_GRPC) + endif() + + # TODO: Don't use global includes but rather target_include_directories +- get_target_property(GRPC_INCLUDE_DIR gRPC::grpc INTERFACE_INCLUDE_DIRECTORIES) ++ if(grpc_INCLUDE_DIRS_RELEASE) ++ set(GRPC_INCLUDE_DIR ${grpc_INCLUDE_DIRS_RELEASE}) ++ elseif(grpc_INCLUDE_DIRS_DEBUG) ++ set(GRPC_INCLUDE_DIR ${grpc_INCLUDE_DIRS_DEBUG}) ++ endif() ++ + include_directories(SYSTEM ${GRPC_INCLUDE_DIR}) ++ include_directories(SYSTEM ${absl_INCLUDE_DIR}) ++ include_directories(SYSTEM ${protobuf_INCLUDE_DIR}) + + if(GRPC_VENDORED) + set(GRPCPP_PP_INCLUDE TRUE) + 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") ++ 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") ++ 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}") +diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt +index 2751254..842fc9e 100644 +--- a/cpp/src/arrow/CMakeLists.txt ++++ b/cpp/src/arrow/CMakeLists.txt +@@ -307,10 +307,14 @@ 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) ++ if (TARGET mimalloc-static) ++ list(APPEND _allocator_dependencies mimalloc-static) ++ else() ++ list(APPEND _allocator_dependencies mimalloc) ++ endif() + endif() + + if(_allocator_dependencies) +diff --git a/cpp/src/arrow/memory_pool.cc b/cpp/src/arrow/memory_pool.cc +index 784bf7b..8f005a5 100644 +--- a/cpp/src/arrow/memory_pool.cc ++++ b/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/7.0.0-0001-cmake.patch b/ci/conan/all/patches/7.0.0-0001-cmake.patch deleted file mode 100644 index 0c7638d67ab5a..0000000000000 --- a/ci/conan/all/patches/7.0.0-0001-cmake.patch +++ /dev/null @@ -1,35 +0,0 @@ -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 deleted file mode 100644 index 0deaba80a8741..0000000000000 --- a/ci/conan/all/patches/7.0.0-0002-jemalloc.patch +++ /dev/null @@ -1,48 +0,0 @@ -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-0004-remove-find-modules.patch b/ci/conan/all/patches/7.0.0-0004-remove-find-modules.patch deleted file mode 100644 index f0b299479e22f..0000000000000 --- a/ci/conan/all/patches/7.0.0-0004-remove-find-modules.patch +++ /dev/null @@ -1,22 +0,0 @@ -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/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 deleted file mode 100644 index 0759339c23ac7..0000000000000 --- a/ci/conan/all/patches/7.0.0-0005-use-find-package.patch +++ /dev/null @@ -1,440 +0,0 @@ -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..84fc279 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) -@@ -1156,6 +1152,15 @@ if(PARQUET_REQUIRE_ENCRYPTION - set(OpenSSL_USE_STATIC_LIBS ON) - set(OPENSSL_USE_STATIC_LIBS ON) - find_package(OpenSSL ${ARROW_OPENSSL_REQUIRED_VERSION} REQUIRED) -+ find_package(OpenSSL REQUIRED CONFIG) -+ message("OPENSSL_FOUND: ${OPENSSL_FOUND}") -+ message("OPENSSL_INCLUDE_DIR: ${OPENSSL_INCLUDE_DIR}") -+ message("OPENSSL_CRYPTO_LIBRARY: ${OPENSSL_CRYPTO_LIBRARY}") -+ message("OPENSSL_CRYPTO_LIBRARIES: ${OPENSSL_CRYPTO_LIBRARIES}") -+ message("OPENSSL_SSL_LIBRARY: ${OPENSSL_SSL_LIBRARY}") -+ message("OPENSSL_SSL_LIBRARIES: ${OPENSSL_SSL_LIBRARIES}") -+ message("OPENSSL_LIBRARIES: ${OPENSSL_LIBRARIES}") -+ message("OPENSSL_VERSION: ${OPENSSL_VERSION}") - endif() - set(ARROW_USE_OPENSSL ON) - endif() -@@ -1228,10 +1233,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,17 +1308,11 @@ 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}) - -+if(0) - if(NOT TARGET ${GFLAGS_LIBRARIES}) - if(TARGET gflags-shared) - set(GFLAGS_LIBRARIES gflags-shared) -@@ -1318,6 +1320,10 @@ if(ARROW_NEED_GFLAGS) - set(GFLAGS_LIBRARIES gflags_shared) - endif() - endif() -+else() -+ set(GFLAGS_LIBRARIES gflags::gflags) -+endif() -+ - endif() - - # ---------------------------------------------------------------------- -@@ -1400,6 +1406,7 @@ macro(build_thrift) - endmacro() - - if(ARROW_WITH_THRIFT) -+if (0) - # We already may have looked for Thrift earlier, when considering whether - # to build Boost, so don't look again if already found. - if(NOT Thrift_FOUND) -@@ -1412,6 +1419,9 @@ if(ARROW_WITH_THRIFT) - endif() - # TODO: Don't use global includes but rather target_include_directories - include_directories(SYSTEM ${THRIFT_INCLUDE_DIR}) -+else() -+ find_package(Thrift REQUIRED CONFIG) -+endif() - - string(REPLACE "." ";" VERSION_LIST ${THRIFT_VERSION}) - list(GET VERSION_LIST 0 THRIFT_VERSION_MAJOR) -@@ -1606,7 +1616,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 +1674,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 +1684,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 +1730,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() - -@@ -1999,6 +2021,7 @@ macro(build_rapidjson) - endmacro() - - if(ARROW_WITH_RAPIDJSON) -+if(0) - set(ARROW_RAPIDJSON_REQUIRED_VERSION "1.1.0") - resolve_dependency(RapidJSON - HAVE_ALT -@@ -2011,6 +2034,10 @@ if(ARROW_WITH_RAPIDJSON) - if(RapidJSON_INCLUDE_DIR) - set(RAPIDJSON_INCLUDE_DIR "${RapidJSON_INCLUDE_DIR}") - endif() -+else() -+ find_package(RapidJSON REQUIRED) -+ set(RAPIDJSON_INCLUDE_DIR "${RapidJSON_INCLUDE_DIR}") -+endif() - - # TODO: Don't use global includes but rather target_include_directories - include_directories(SYSTEM ${RAPIDJSON_INCLUDE_DIR}) -@@ -2036,10 +2063,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 +2120,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 +2181,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 +2249,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 +2277,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 +2318,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 +2332,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 +2385,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 +2437,7 @@ macro(build_utf8proc) - endmacro() - - if(ARROW_WITH_UTF8PROC) -- resolve_dependency(utf8proc -- REQUIRED_VERSION -- "2.2.0" -- PC_PACKAGE_NAMES -- libutf8proc) -+ find_package(utf8proc REQUIRED CONFIG) - - add_definitions(-DARROW_WITH_UTF8PROC) - -@@ -3554,33 +3597,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() - - # ---------------------------------------------------------------------- -@@ -3770,7 +3792,12 @@ macro(build_google_cloud_cpp_storage) - endmacro() - - if(ARROW_WITH_GOOGLE_CLOUD_CPP) -+if(0) - resolve_dependency(google_cloud_cpp_storage) -+else() -+ find_package(google-cloud-cpp REQUIRED) -+endif() -+ - get_target_property(google_cloud_cpp_storage_INCLUDE_DIR google-cloud-cpp::storage - INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${google_cloud_cpp_storage_INCLUDE_DIR}) -@@ -4097,11 +4124,15 @@ macro(build_opentelemetry) - endmacro() - - if(ARROW_WITH_OPENTELEMETRY) -+if(0) - set(opentelemetry-cpp_SOURCE "AUTO") - resolve_dependency(opentelemetry-cpp) - get_target_property(OPENTELEMETRY_INCLUDE_DIR opentelemetry-cpp::api - INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${OPENTELEMETRY_INCLUDE_DIR}) -+else() -+ find_package(opentelemetry-cpp REQUIRED) -+endif() - message(STATUS "Found OpenTelemetry headers: ${OPENTELEMETRY_INCLUDE_DIR}") - 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/patches/7.0.0-0007-fix-cmake.patch b/ci/conan/all/patches/7.0.0-0007-fix-cmake.patch new file mode 100644 index 0000000000000..eb2acb1523fc3 --- /dev/null +++ b/ci/conan/all/patches/7.0.0-0007-fix-cmake.patch @@ -0,0 +1,369 @@ +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..dff5b1a 100644 +--- a/cpp/CMakeLists.txt ++++ b/cpp/CMakeLists.txt +@@ -699,7 +699,7 @@ endif() + + if(ARROW_WITH_BROTLI) + # Order is important for static linking +- set(ARROW_BROTLI_LIBS Brotli::brotlienc Brotli::brotlidec Brotli::brotlicommon) ++ set(ARROW_BROTLI_LIBS brotli::brotlienc brotli::brotlidec brotli::brotlicommon) + list(APPEND ARROW_LINK_LIBS ${ARROW_BROTLI_LIBS}) + list(APPEND ARROW_STATIC_LINK_LIBS ${ARROW_BROTLI_LIBS}) + if(Brotli_SOURCE STREQUAL "SYSTEM") +@@ -715,10 +715,17 @@ if(ARROW_WITH_BZ2) + endif() + + if(ARROW_WITH_LZ4) +- list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4) +- if(Lz4_SOURCE STREQUAL "SYSTEM") +- list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4) +- endif() ++ if (TARGET LZ4::lz4_static) ++ list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4_static) ++ if(Lz4_SOURCE STREQUAL "SYSTEM") ++ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4_static) ++ endif() ++ else() ++ list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4_shared) ++ if(Lz4_SOURCE STREQUAL "SYSTEM") ++ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4_shared) ++ endif() ++endif() + endif() + + if(ARROW_WITH_SNAPPY) +@@ -907,8 +914,13 @@ endif() + + if(ARROW_MIMALLOC) + add_definitions(-DARROW_MIMALLOC) +- list(APPEND ARROW_LINK_LIBS mimalloc::mimalloc) +- list(APPEND ARROW_STATIC_LINK_LIBS mimalloc::mimalloc) ++ if (TARGET mimalloc-static) ++ list(APPEND ARROW_LINK_LIBS mimalloc-static) ++ list(APPEND ARROW_STATIC_LINK_LIBS mimalloc-static) ++ else() ++ list(APPEND ARROW_LINK_LIBS mimalloc) ++ list(APPEND ARROW_STATIC_LINK_LIBS mimalloc) ++ endif() + endif() + + # ---------------------------------------------------------------------- +diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake +index bc38952..62bf314 100644 +--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake ++++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake +@@ -954,7 +954,7 @@ endif() + + if(ARROW_BOOST_REQUIRED) + resolve_dependency(Boost +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_BOOST_REQUIRED_VERSION} +@@ -965,7 +965,7 @@ if(ARROW_BOOST_REQUIRED) + if(TARGET Boost::system) + set(BOOST_SYSTEM_LIBRARY Boost::system) + set(BOOST_FILESYSTEM_LIBRARY Boost::filesystem) +- elseif(BoostAlt_FOUND) ++ elseif(Boost_FOUND) + set(BOOST_SYSTEM_LIBRARY ${Boost_SYSTEM_LIBRARY}) + set(BOOST_FILESYSTEM_LIBRARY ${Boost_FILESYSTEM_LIBRARY}) + else() +@@ -1108,9 +1108,9 @@ macro(build_brotli) + endmacro() + + if(ARROW_WITH_BROTLI) +- resolve_dependency(Brotli PC_PACKAGE_NAMES libbrotlidec libbrotlienc) ++ resolve_dependency(brotli PC_PACKAGE_NAMES libbrotlidec libbrotlienc) + # TODO: Don't use global includes but rather target_include_directories +- get_target_property(BROTLI_INCLUDE_DIR Brotli::brotlicommon ++ get_target_property(BROTLI_INCLUDE_DIR brotli::brotlicommon + INTERFACE_INCLUDE_DIRECTORIES) + include_directories(SYSTEM ${BROTLI_INCLUDE_DIR}) + endif() +@@ -1302,22 +1302,17 @@ endmacro() + if(ARROW_NEED_GFLAGS) + set(ARROW_GFLAGS_REQUIRED_VERSION "2.1.0") + resolve_dependency(gflags +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_GFLAGS_REQUIRED_VERSION} + IS_RUNTIME_DEPENDENCY + FALSE) + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${GFLAGS_INCLUDE_DIR}) ++ include_directories(SYSTEM ${gflags_INCLUDE_DIR}) + +- if(NOT TARGET ${GFLAGS_LIBRARIES}) +- if(TARGET gflags-shared) +- set(GFLAGS_LIBRARIES gflags-shared) +- elseif(TARGET gflags_shared) +- set(GFLAGS_LIBRARIES gflags_shared) +- endif() +- endif() ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${gflags_LIBRARIES_TARGETS}) ++ set(GFLAGS_LIBRARIES gflags::gflags) + endif() + + # ---------------------------------------------------------------------- +@@ -1411,9 +1406,9 @@ if(ARROW_WITH_THRIFT) + thrift) + endif() + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${THRIFT_INCLUDE_DIR}) ++ include_directories(SYSTEM ${Thrift_INCLUDE_DIR}) + +- string(REPLACE "." ";" VERSION_LIST ${THRIFT_VERSION}) ++ string(REPLACE "." ";" VERSION_LIST ${Thrift_VERSION}) + list(GET VERSION_LIST 0 THRIFT_VERSION_MAJOR) + list(GET VERSION_LIST 1 THRIFT_VERSION_MINOR) + list(GET VERSION_LIST 2 THRIFT_VERSION_PATCH) +@@ -1528,6 +1523,7 @@ if(ARROW_WITH_PROTOBUF) + set(ARROW_PROTOBUF_REQUIRED_VERSION "2.6.1") + endif() + resolve_dependency(Protobuf ++ USE_CONFIG + REQUIRED_VERSION + ${ARROW_PROTOBUF_REQUIRED_VERSION} + PC_PACKAGE_NAMES +@@ -1538,7 +1534,7 @@ if(ARROW_WITH_PROTOBUF) + endif() + + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${PROTOBUF_INCLUDE_DIR}) ++ include_directories(SYSTEM ${protobuf_INCLUDE_DIR}) + + if(TARGET arrow::protobuf::libprotobuf) + set(ARROW_PROTOBUF_LIBPROTOBUF arrow::protobuf::libprotobuf) +@@ -1547,9 +1543,9 @@ if(ARROW_WITH_PROTOBUF) + if(NOT TARGET protobuf::libprotobuf) + add_library(protobuf::libprotobuf UNKNOWN IMPORTED) + set_target_properties(protobuf::libprotobuf +- PROPERTIES IMPORTED_LOCATION "${PROTOBUF_LIBRARY}" ++ PROPERTIES IMPORTED_LOCATION "${Protobuf_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES +- "${PROTOBUF_INCLUDE_DIR}") ++ "${Protobuf_INCLUDE_DIR}") + endif() + set(ARROW_PROTOBUF_LIBPROTOBUF protobuf::libprotobuf) + endif() +@@ -1569,7 +1565,7 @@ if(ARROW_WITH_PROTOBUF) + set_target_properties(protobuf::libprotoc + PROPERTIES IMPORTED_LOCATION "${Protobuf_PROTOC_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES +- "${PROTOBUF_INCLUDE_DIR}") ++ "${Protobuf_INCLUDE_DIR}") + endif() + set(ARROW_PROTOBUF_LIBPROTOC protobuf::libprotoc) + endif() +@@ -1600,6 +1596,7 @@ 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 +@@ -1665,12 +1662,18 @@ if(ARROW_JEMALLOC) + add_dependencies(jemalloc::jemalloc jemalloc_ep) + + list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc::jemalloc) ++else() ++ find_package(jemalloc REQUIRED CONFIG) ++ include_directories(SYSTEM "${jemalloc_INCLUDE_DIR}") ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${jemalloc_LIBRARIES_TARGETS}) ++endif() + 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. + +@@ -1716,6 +1719,11 @@ if(ARROW_MIMALLOC) + add_dependencies(toolchain mimalloc_ep) + + list(APPEND ARROW_BUNDLED_STATIC_LIBS mimalloc::mimalloc) ++else() ++ find_package(mimalloc REQUIRED CONFIG) ++ include_directories(SYSTEM "${mimalloc_INCLUDE_DIR}") ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${mimalloc_LIBRARIES_TARGETS} ) ++endif() + endif() + + # ---------------------------------------------------------------------- +@@ -2001,7 +2009,7 @@ endmacro() + if(ARROW_WITH_RAPIDJSON) + set(ARROW_RAPIDJSON_REQUIRED_VERSION "1.1.0") + resolve_dependency(RapidJSON +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_RAPIDJSON_REQUIRED_VERSION} +@@ -2038,10 +2046,9 @@ endmacro() + + if((NOT ARROW_SIMD_LEVEL STREQUAL "NONE") OR (NOT ARROW_RUNTIME_SIMD_LEVEL STREQUAL "NONE" + )) +- set(xsimd_SOURCE "BUNDLED") + resolve_dependency(xsimd) + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${XSIMD_INCLUDE_DIR}) ++ include_directories(SYSTEM ${xsimd_INCLUDE_DIR}) + endif() + + macro(build_zlib) +@@ -2140,10 +2147,14 @@ macro(build_lz4) + endmacro() + + if(ARROW_WITH_LZ4) +- resolve_dependency(Lz4 PC_PACKAGE_NAMES liblz4) ++ resolve_dependency(lz4) + + # TODO: Don't use global includes but rather target_include_directories +- get_target_property(LZ4_INCLUDE_DIR LZ4::lz4 INTERFACE_INCLUDE_DIRECTORIES) ++ if (TARGET LZ4::lz4_static) ++ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_static INTERFACE_INCLUDE_DIRECTORIES) ++ else() ++ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_shared INTERFACE_INCLUDE_DIRECTORIES) ++ endif() + include_directories(SYSTEM ${LZ4_INCLUDE_DIR}) + endif() + +@@ -2274,7 +2285,7 @@ if(ARROW_WITH_RE2) + # 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. +- resolve_dependency(re2 HAVE_ALT TRUE) ++ resolve_dependency(re2 USE_CONFIG TRUE) + if(${re2_SOURCE} STREQUAL "SYSTEM") + get_target_property(RE2_LIB re2::re2 IMPORTED_LOCATION) + string(APPEND ARROW_PC_LIBS_PRIVATE " ${RE2_LIB}") +@@ -2337,7 +2348,7 @@ endmacro() + if(ARROW_WITH_BZ2) + resolve_dependency(BZip2) + if(${BZip2_SOURCE} STREQUAL "SYSTEM") +- string(APPEND ARROW_PC_LIBS_PRIVATE " ${BZIP2_LIBRARIES}") ++ string(APPEND ARROW_PC_LIBS_PRIVATE " ${BZip2_LIBRARIES}") + endif() + + if(NOT TARGET BZip2::BZip2) +@@ -2346,7 +2357,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) +@@ -3555,7 +3566,7 @@ if(ARROW_WITH_GRPC) + set(gRPC_SOURCE "${Protobuf_SOURCE}") + endif() + resolve_dependency(gRPC +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_GRPC_REQUIRED_VERSION} +@@ -3573,9 +3584,9 @@ if(ARROW_WITH_GRPC) + 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") ++ 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") ++ elseif(EXISTS ${gPC_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}") +@@ -4097,9 +4108,9 @@ macro(build_opentelemetry) + endmacro() + + if(ARROW_WITH_OPENTELEMETRY) +- set(opentelemetry-cpp_SOURCE "AUTO") ++ set(opentelemetry-cpp_SOURCE "SYSTEM") + resolve_dependency(opentelemetry-cpp) +- get_target_property(OPENTELEMETRY_INCLUDE_DIR opentelemetry-cpp::api ++ get_target_property(OPENTELEMETRY_INCLUDE_DIR opentelemetry-cpp::opentelemetry_common + INTERFACE_INCLUDE_DIRECTORIES) + include_directories(SYSTEM ${OPENTELEMETRY_INCLUDE_DIR}) + message(STATUS "Found OpenTelemetry headers: ${OPENTELEMETRY_INCLUDE_DIR}") +diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt +index b984bc1..2c78cd9 100644 +--- a/cpp/src/arrow/CMakeLists.txt ++++ b/cpp/src/arrow/CMakeLists.txt +@@ -323,10 +323,14 @@ 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) ++ if (TARGET mimalloc-static) ++ list(APPEND _allocator_dependencies mimalloc-static) ++ else() ++ list(APPEND _allocator_dependencies mimalloc) ++ endif() + endif() + + if(_allocator_dependencies) +diff --git a/cpp/src/arrow/flight/CMakeLists.txt b/cpp/src/arrow/flight/CMakeLists.txt +index 2cf8c99..90ebb9a 100644 +--- a/cpp/src/arrow/flight/CMakeLists.txt ++++ b/cpp/src/arrow/flight/CMakeLists.txt +@@ -17,6 +17,9 @@ + + add_custom_target(arrow_flight) + ++# TODO: This is a temporary workaround. absl should be LINKED as TARGET. ++include_directories(SYSTEM ${absl_INCLUDE_DIR}) ++ + arrow_install_all_headers("arrow/flight") + + set(ARROW_FLIGHT_LINK_LIBS gRPC::grpc++ ${ARROW_PROTOBUF_LIBPROTOBUF}) +diff --git a/cpp/src/arrow/memory_pool.cc b/cpp/src/arrow/memory_pool.cc +index 2dcfb01..0394c01 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/8.0.0-0002-jemalloc.patch b/ci/conan/all/patches/8.0.0-0002-jemalloc.patch deleted file mode 100644 index 99b92e3308f6f..0000000000000 --- a/ci/conan/all/patches/8.0.0-0002-jemalloc.patch +++ /dev/null @@ -1,48 +0,0 @@ -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 690c51a..c518b7d 100644 ---- a/cpp/src/arrow/CMakeLists.txt -+++ b/cpp/src/arrow/CMakeLists.txt -@@ -326,7 +326,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 2fab6f3..1f8f896 100644 ---- a/cpp/src/arrow/memory_pool.cc -+++ b/cpp/src/arrow/memory_pool.cc -@@ -52,7 +52,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/8.0.0-0004-use-find-package.patch b/ci/conan/all/patches/8.0.0-0004-use-find-package.patch deleted file mode 100644 index e7bc2320c76d9..0000000000000 --- a/ci/conan/all/patches/8.0.0-0004-use-find-package.patch +++ /dev/null @@ -1,401 +0,0 @@ -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 aba18c8..bb463d0 100644 ---- a/cpp/CMakeLists.txt -+++ b/cpp/CMakeLists.txt -@@ -721,7 +721,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() -@@ -907,8 +907,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 f070323..2e2a03b 100644 ---- a/cpp/cmake_modules/ThirdpartyToolchain.cmake -+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake -@@ -974,6 +974,7 @@ else() - endif() - - if(ARROW_BOOST_REQUIRED) -+if(0) - resolve_dependency(Boost - HAVE_ALT - TRUE -@@ -982,6 +983,9 @@ if(ARROW_BOOST_REQUIRED) - IS_RUNTIME_DEPENDENCY - # libarrow.so doesn't depend on libboost*. - FALSE) -+else() -+ find_package(Boost REQUIRED CONFIG) -+endif() - - if(TARGET Boost::system) - set(BOOST_SYSTEM_LIBRARY Boost::system) -@@ -1059,6 +1063,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) -@@ -1067,6 +1072,9 @@ 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}) -+else() -+ find_package(Snappy REQUIRED) -+endif() - endif() - - # ---------------------------------------------------------------------- -@@ -1129,7 +1137,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) -@@ -1169,8 +1177,16 @@ if(PARQUET_REQUIRE_ENCRYPTION - set(BUILD_SHARED_LIBS_KEEP ${BUILD_SHARED_LIBS}) - set(BUILD_SHARED_LIBS ON) - -- find_package(OpenSSL ${ARROW_OPENSSL_REQUIRED_VERSION} REQUIRED) -- set(BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_KEEP}) -+ find_package(OpenSSL REQUIRED CONFIG) -+ message("OPENSSL_FOUND: ${OPENSSL_FOUND}") -+ message("OPENSSL_INCLUDE_DIR: ${OPENSSL_INCLUDE_DIR}") -+ message("OPENSSL_CRYPTO_LIBRARY: ${OPENSSL_CRYPTO_LIBRARY}") -+ message("OPENSSL_CRYPTO_LIBRARIES: ${OPENSSL_CRYPTO_LIBRARIES}") -+ message("OPENSSL_SSL_LIBRARY: ${OPENSSL_SSL_LIBRARY}") -+ message("OPENSSL_SSL_LIBRARIES: ${OPENSSL_SSL_LIBRARIES}") -+ message("OPENSSL_LIBRARIES: ${OPENSSL_LIBRARIES}") -+ message("OPENSSL_VERSION: ${OPENSSL_VERSION}") -+ set(BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_KEEP}) - unset(BUILD_SHARED_LIBS_KEEP) - else() - # Find static OpenSSL headers and libs -@@ -1249,10 +1265,14 @@ 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}) -+else() -+ find_package(glog REQUIRED) -+endif() - endif() - - # ---------------------------------------------------------------------- -@@ -1321,6 +1341,7 @@ macro(build_gflags) - endmacro() - - if(ARROW_NEED_GFLAGS) -+if(0) - set(ARROW_GFLAGS_REQUIRED_VERSION "2.1.0") - resolve_dependency(gflags - HAVE_ALT -@@ -1339,6 +1360,10 @@ if(ARROW_NEED_GFLAGS) - set(GFLAGS_LIBRARIES gflags_shared) - endif() - endif() -+else() -+ find_package(gflags REQUIRED) -+ set(GFLAGS_LIBRARIES gflags::gflags) -+endif() - endif() - - # ---------------------------------------------------------------------- -@@ -1718,6 +1756,7 @@ if(ARROW_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/") -@@ -1778,6 +1817,9 @@ if(ARROW_JEMALLOC) - INTERFACE_INCLUDE_DIRECTORIES - "${CMAKE_CURRENT_BINARY_DIR}/jemalloc_ep-prefix/src") - add_dependencies(jemalloc::jemalloc jemalloc_ep) -+else() -+ find_package(jemalloc REQUIRED) -+endif() - - list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc::jemalloc) - endif() -@@ -1786,6 +1828,7 @@ 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. - -@@ -1834,6 +1877,10 @@ if(ARROW_MIMALLOC) - endif() - add_dependencies(mimalloc::mimalloc mimalloc_ep) - add_dependencies(toolchain mimalloc_ep) -+else() -+ find_package(mimalloc REQUIRED CONFIG) -+ add_dependencies(toolchain mimalloc::mimalloc) -+endif() - - list(APPEND ARROW_BUNDLED_STATIC_LIBS mimalloc::mimalloc) - endif() -@@ -2119,6 +2166,7 @@ macro(build_rapidjson) - endmacro() - - if(ARROW_WITH_RAPIDJSON) -+if(0) - set(ARROW_RAPIDJSON_REQUIRED_VERSION "1.1.0") - resolve_dependency(RapidJSON - HAVE_ALT -@@ -2131,6 +2179,10 @@ if(ARROW_WITH_RAPIDJSON) - if(RapidJSON_INCLUDE_DIR) - set(RAPIDJSON_INCLUDE_DIR "${RapidJSON_INCLUDE_DIR}") - endif() -+else() -+ find_package(RapidJSON REQUIRED) -+ set(RAPIDJSON_INCLUDE_DIR "${RapidJSON_INCLUDE_DIR}") -+endif() - - # TODO: Don't use global includes but rather target_include_directories - include_directories(SYSTEM ${RAPIDJSON_INCLUDE_DIR}) -@@ -2158,8 +2210,14 @@ endmacro() - - 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() -@@ -2202,11 +2260,15 @@ 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}) -+else() -+ find_package(ZLIB REQUIRED) -+endif() - endif() - - macro(build_lz4) -@@ -2260,11 +2322,15 @@ 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}) -+else() -+ find_package(lz4 REQUIRED) -+endif() - endif() - - macro(build_zstd) -@@ -2325,6 +2391,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 -@@ -2352,6 +2419,9 @@ if(ARROW_WITH_ZSTD) - get_target_property(ZSTD_INCLUDE_DIR ${ARROW_ZSTD_LIBZSTD} - INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${ZSTD_INCLUDE_DIR}) -+else() -+ find_package(zstd REQUIRED) -+endif() - endif() - - # ---------------------------------------------------------------------- -@@ -2391,6 +2461,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. -@@ -2411,6 +2482,9 @@ 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}) -+else() -+ find_package(re2 REQUIRED) -+endif() - endif() - - macro(build_bzip2) -@@ -2462,6 +2536,7 @@ macro(build_bzip2) - endmacro() - - if(ARROW_WITH_BZ2) -+if(0) - resolve_dependency(BZip2) - if(${BZip2_SOURCE} STREQUAL "SYSTEM") - string(APPEND ARROW_PC_LIBS_PRIVATE " ${BZIP2_LIBRARIES}") -@@ -2474,6 +2549,9 @@ if(ARROW_WITH_BZ2) - INTERFACE_INCLUDE_DIRECTORIES "${BZIP2_INCLUDE_DIR}") - endif() - include_directories(SYSTEM "${BZIP2_INCLUDE_DIR}") -+else() -+ find_package(BZip2 REQUIRED) -+endif() - endif() - - macro(build_utf8proc) -@@ -2517,6 +2595,7 @@ macro(build_utf8proc) - endmacro() - - if(ARROW_WITH_UTF8PROC) -+if(0) - resolve_dependency(utf8proc - REQUIRED_VERSION - "2.2.0" -@@ -2538,6 +2617,10 @@ if(ARROW_WITH_UTF8PROC) - get_target_property(UTF8PROC_INCLUDE_DIR utf8proc::utf8proc - INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${UTF8PROC_INCLUDE_DIR}) -+else() -+ find_package(utf8proc REQUIRED CONFIG) -+ add_definitions(-DARROW_WITH_UTF8PROC) -+endif() - endif() - - macro(build_cares) -@@ -3702,6 +3785,7 @@ macro(build_grpc) - endmacro() - - if(ARROW_WITH_GRPC) -+if(0) - set(ARROW_GRPC_REQUIRED_VERSION "1.17.0") - if(NOT Protobuf_SOURCE STREQUAL gRPC_SOURCE) - # ARROW-15495: Protobuf/gRPC must come from the same source -@@ -3735,6 +3819,9 @@ if(ARROW_WITH_GRPC) - message(FATAL_ERROR "Cannot find grpc++ headers in ${GRPC_INCLUDE_DIR}") - endif() - endif() -+else() -+ find_package(gRPC REQUIRED CONFIG) -+endif() - endif() - - # ---------------------------------------------------------------------- -@@ -3937,10 +4024,14 @@ macro(build_google_cloud_cpp_storage) - endmacro() - - if(ARROW_WITH_GOOGLE_CLOUD_CPP) -+if(0) - resolve_dependency(google_cloud_cpp_storage) - get_target_property(google_cloud_cpp_storage_INCLUDE_DIR google-cloud-cpp::storage - INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${google_cloud_cpp_storage_INCLUDE_DIR}) -+else() -+ find_package(google-cloud-cpp REQUIRED) -+endif() - get_target_property(absl_base_INCLUDE_DIR absl::base INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${absl_base_INCLUDE_DIR}) - message(STATUS "Found google-cloud-cpp::storage headers: ${google_cloud_cpp_storage_INCLUDE_DIR}" -@@ -4261,6 +4352,7 @@ macro(build_opentelemetry) - endmacro() - - if(ARROW_WITH_OPENTELEMETRY) -+if(0) - # cURL is required whether we build from source or use an existing installation - # (OTel's cmake files do not call find_curl for you) - find_curl() -@@ -4269,7 +4361,10 @@ if(ARROW_WITH_OPENTELEMETRY) - get_target_property(OPENTELEMETRY_INCLUDE_DIR opentelemetry-cpp::api - INTERFACE_INCLUDE_DIRECTORIES) - include_directories(SYSTEM ${OPENTELEMETRY_INCLUDE_DIR}) -- message(STATUS "Found OpenTelemetry headers: ${OPENTELEMETRY_INCLUDE_DIR}") -+else() -+ find_package(opentelemetry-cpp REQUIRED) -+endif() -+ message(STATUS "Found OpenTelemetry headers: ${OPENTELEMETRY_INCLUDE_DIR}") - endif() - - # ---------------------------------------------------------------------- -diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt -index c518b7d..40b4853 100644 ---- a/cpp/src/arrow/CMakeLists.txt -+++ b/cpp/src/arrow/CMakeLists.txt -@@ -584,6 +584,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) - -@@ -594,7 +598,7 @@ if(ARROW_WITH_BACKTRACE) - endforeach() - endif() - --if(ARROW_BUILD_BUNDLED_DEPENDENCIES) -+if(0) - arrow_car(_FIRST_LIB ${ARROW_BUNDLED_STATIC_LIBS}) - arrow_cdr(_OTHER_LIBS ${ARROW_BUNDLED_STATIC_LIBS}) - create_merged_static_lib(arrow_bundled_dependencies diff --git a/ci/conan/all/patches/8.0.0-0006-fix-cmake.patch b/ci/conan/all/patches/8.0.0-0006-fix-cmake.patch new file mode 100644 index 0000000000000..7be516e1b4855 --- /dev/null +++ b/ci/conan/all/patches/8.0.0-0006-fix-cmake.patch @@ -0,0 +1,447 @@ +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 bb463d0..ce2d1df 100644 +--- a/cpp/CMakeLists.txt ++++ b/cpp/CMakeLists.txt +@@ -705,7 +705,7 @@ endif() + + if(ARROW_WITH_BROTLI) + # Order is important for static linking +- set(ARROW_BROTLI_LIBS Brotli::brotlienc Brotli::brotlidec Brotli::brotlicommon) ++ set(ARROW_BROTLI_LIBS brotli::brotlienc brotli::brotlidec brotli::brotlicommon) + list(APPEND ARROW_LINK_LIBS ${ARROW_BROTLI_LIBS}) + list(APPEND ARROW_STATIC_LINK_LIBS ${ARROW_BROTLI_LIBS}) + if(Brotli_SOURCE STREQUAL "SYSTEM") +@@ -721,11 +721,18 @@ if(ARROW_WITH_BZ2) + endif() + + if(ARROW_WITH_LZ4) +- list(APPEND ARROW_STATIC_LINK_LIBS lz4::lz4) +- if(Lz4_SOURCE STREQUAL "SYSTEM") +- list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4) ++ if (TARGET LZ4::lz4_static) ++ list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4_static) ++ if(Lz4_SOURCE STREQUAL "SYSTEM") ++ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4_static) ++ endif() ++ else() ++ list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4_shared) ++ if(Lz4_SOURCE STREQUAL "SYSTEM") ++ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4_shared) + endif() + endif() ++endif() + + if(ARROW_WITH_SNAPPY) + list(APPEND ARROW_STATIC_LINK_LIBS Snappy::snappy) +@@ -913,8 +920,13 @@ endif() + + if(ARROW_MIMALLOC) + add_definitions(-DARROW_MIMALLOC) +- list(APPEND ARROW_LINK_LIBS mimalloc::mimalloc) +- list(APPEND ARROW_STATIC_LINK_LIBS mimalloc::mimalloc) ++ if (TARGET mimalloc-static) ++ list(APPEND ARROW_LINK_LIBS mimalloc-static) ++ list(APPEND ARROW_STATIC_LINK_LIBS mimalloc-static) ++ else() ++ list(APPEND ARROW_LINK_LIBS mimalloc) ++ list(APPEND ARROW_STATIC_LINK_LIBS mimalloc) ++ endif() + endif() + + # ---------------------------------------------------------------------- +diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake +index f070323..16faf73 100644 +--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake ++++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake +@@ -959,6 +959,7 @@ endif() + # - Tests need Boost at runtime. + # - S3FS and Flight benchmarks need Boost at runtime. + if(ARROW_BUILD_INTEGRATION ++ OR ARROW_BOOST_REQUIRED + OR ARROW_BUILD_TESTS + OR (ARROW_FLIGHT AND ARROW_BUILD_BENCHMARKS) + OR (ARROW_S3 AND ARROW_BUILD_BENCHMARKS)) +@@ -975,7 +976,7 @@ endif() + + if(ARROW_BOOST_REQUIRED) + resolve_dependency(Boost +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_BOOST_REQUIRED_VERSION} +@@ -986,7 +987,7 @@ if(ARROW_BOOST_REQUIRED) + if(TARGET Boost::system) + set(BOOST_SYSTEM_LIBRARY Boost::system) + set(BOOST_FILESYSTEM_LIBRARY Boost::filesystem) +- elseif(BoostAlt_FOUND) ++ elseif(Boost_FOUND) + set(BOOST_SYSTEM_LIBRARY ${Boost_SYSTEM_LIBRARY}) + set(BOOST_FILESYSTEM_LIBRARY ${Boost_FILESYSTEM_LIBRARY}) + else() +@@ -1129,9 +1130,9 @@ macro(build_brotli) + endmacro() + + if(ARROW_WITH_BROTLI) +- resolve_dependency(Brotli PC_PACKAGE_NAMES libbrotlidec libbrotlienc) ++ resolve_dependency(brotli PC_PACKAGE_NAMES libbrotlidec libbrotlienc) + # TODO: Don't use global includes but rather target_include_directories +- get_target_property(BROTLI_INCLUDE_DIR Brotli::brotlicommon ++ get_target_property(BROTLI_INCLUDE_DIR brotli::brotlicommon + INTERFACE_INCLUDE_DIRECTORIES) + include_directories(SYSTEM ${BROTLI_INCLUDE_DIR}) + endif() +@@ -1323,22 +1324,16 @@ endmacro() + if(ARROW_NEED_GFLAGS) + set(ARROW_GFLAGS_REQUIRED_VERSION "2.1.0") + resolve_dependency(gflags +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_GFLAGS_REQUIRED_VERSION} + IS_RUNTIME_DEPENDENCY + FALSE) + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${GFLAGS_INCLUDE_DIR}) +- +- if(NOT TARGET ${GFLAGS_LIBRARIES}) +- if(TARGET gflags-shared) +- set(GFLAGS_LIBRARIES gflags-shared) +- elseif(TARGET gflags_shared) +- set(GFLAGS_LIBRARIES gflags_shared) +- endif() +- endif() ++ include_directories(SYSTEM ${gflags_INCLUDE_DIR}) ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${gflags_LIBRARIES_TARGETS}) ++ set(GFLAGS_LIBRARIES gflags::gflags) + endif() + + # ---------------------------------------------------------------------- +@@ -1432,9 +1427,9 @@ if(ARROW_WITH_THRIFT) + thrift) + endif() + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${THRIFT_INCLUDE_DIR}) ++ include_directories(SYSTEM ${Thrift_INCLUDE_DIR}) + +- string(REPLACE "." ";" VERSION_LIST ${THRIFT_VERSION}) ++ string(REPLACE "." ";" VERSION_LIST ${Thrift_VERSION}) + list(GET VERSION_LIST 0 THRIFT_VERSION_MAJOR) + list(GET VERSION_LIST 1 THRIFT_VERSION_MINOR) + list(GET VERSION_LIST 2 THRIFT_VERSION_PATCH) +@@ -1557,6 +1552,7 @@ if(ARROW_WITH_PROTOBUF) + set(ARROW_PROTOBUF_REQUIRED_VERSION "2.6.1") + endif() + resolve_dependency(Protobuf ++ USE_CONFIG + REQUIRED_VERSION + ${ARROW_PROTOBUF_REQUIRED_VERSION} + PC_PACKAGE_NAMES +@@ -1567,7 +1563,7 @@ if(ARROW_WITH_PROTOBUF) + endif() + + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${PROTOBUF_INCLUDE_DIR}) ++ include_directories(SYSTEM ${protobuf_INCLUDE_DIR}) + + if(TARGET arrow::protobuf::libprotobuf) + set(ARROW_PROTOBUF_LIBPROTOBUF arrow::protobuf::libprotobuf) +@@ -1576,9 +1572,9 @@ if(ARROW_WITH_PROTOBUF) + if(NOT TARGET protobuf::libprotobuf) + add_library(protobuf::libprotobuf UNKNOWN IMPORTED) + set_target_properties(protobuf::libprotobuf +- PROPERTIES IMPORTED_LOCATION "${PROTOBUF_LIBRARY}" ++ PROPERTIES IMPORTED_LOCATION "${Protobuf_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES +- "${PROTOBUF_INCLUDE_DIR}") ++ "${Protobuf_INCLUDE_DIR}") + endif() + set(ARROW_PROTOBUF_LIBPROTOBUF protobuf::libprotobuf) + endif() +@@ -1598,7 +1594,7 @@ if(ARROW_WITH_PROTOBUF) + set_target_properties(protobuf::libprotoc + PROPERTIES IMPORTED_LOCATION "${Protobuf_PROTOC_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES +- "${PROTOBUF_INCLUDE_DIR}") ++ "${Protobuf_INCLUDE_DIR}") + endif() + set(ARROW_PROTOBUF_LIBPROTOC protobuf::libprotoc) + endif() +@@ -1690,11 +1686,12 @@ macro(build_substrait) + + add_custom_target(substrait_gen ALL DEPENDS ${SUBSTRAIT_PROTO_GEN_ALL}) + +- set(SUBSTRAIT_INCLUDES ${SUBSTRAIT_CPP_DIR} ${PROTOBUF_INCLUDE_DIR}) ++ set(SUBSTRAIT_INCLUDES ${SUBSTRAIT_CPP_DIR} ${protobuf_INCLUDE_DIR}) + + add_library(substrait STATIC ${SUBSTRAIT_SOURCES}) + set_target_properties(substrait PROPERTIES POSITION_INDEPENDENT_CODE ON) + target_include_directories(substrait PUBLIC ${SUBSTRAIT_INCLUDES}) ++ target_include_directories(substrait PUBLIC ${PROTOBUF_INCLUDE_DIR}) + target_link_libraries(substrait INTERFACE ${ARROW_PROTOBUF_LIBPROTOBUF}) + add_dependencies(substrait substrait_gen) + +@@ -1711,6 +1708,7 @@ 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 +@@ -1780,12 +1778,18 @@ if(ARROW_JEMALLOC) + add_dependencies(jemalloc::jemalloc jemalloc_ep) + + list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc::jemalloc) ++else() ++ find_package(jemalloc REQUIRED CONFIG) ++ include_directories(SYSTEM "${jemalloc_INCLUDE_DIR}") ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${jemalloc_LIBRARIES_TARGETS}) ++endif() + 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. + +@@ -1836,6 +1840,11 @@ if(ARROW_MIMALLOC) + add_dependencies(toolchain mimalloc_ep) + + list(APPEND ARROW_BUNDLED_STATIC_LIBS mimalloc::mimalloc) ++else() ++ find_package(mimalloc REQUIRED CONFIG) ++ include_directories(SYSTEM "${mimalloc_INCLUDE_DIR}") ++ list(APPEND ARROW_BUNDLED_STATIC_LIBS ${mimalloc_LIBRARIES_TARGETS} ) ++endif() + endif() + + # ---------------------------------------------------------------------- +@@ -2121,7 +2130,7 @@ endmacro() + if(ARROW_WITH_RAPIDJSON) + set(ARROW_RAPIDJSON_REQUIRED_VERSION "1.1.0") + resolve_dependency(RapidJSON +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_RAPIDJSON_REQUIRED_VERSION} +@@ -2158,10 +2167,10 @@ endmacro() + + if((NOT ARROW_SIMD_LEVEL STREQUAL "NONE") OR (NOT ARROW_RUNTIME_SIMD_LEVEL STREQUAL "NONE" + )) +- set(xsimd_SOURCE "BUNDLED") ++ set(xsimd_SOURCE "SYSTEM") + resolve_dependency(xsimd) + # TODO: Don't use global includes but rather target_include_directories +- include_directories(SYSTEM ${XSIMD_INCLUDE_DIR}) ++ include_directories(SYSTEM ${xsimd_INCLUDE_DIR}) + endif() + + macro(build_zlib) +@@ -2260,10 +2269,14 @@ macro(build_lz4) + endmacro() + + if(ARROW_WITH_LZ4) +- resolve_dependency(Lz4 PC_PACKAGE_NAMES liblz4) ++ resolve_dependency(Lz4) + + # TODO: Don't use global includes but rather target_include_directories +- get_target_property(LZ4_INCLUDE_DIR LZ4::lz4 INTERFACE_INCLUDE_DIRECTORIES) ++ if (TARGET LZ4::lz4_static) ++ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_static INTERFACE_INCLUDE_DIRECTORIES) ++ else() ++ get_target_property(LZ4_INCLUDE_DIR LZ4::lz4_shared INTERFACE_INCLUDE_DIRECTORIES) ++ endif() + include_directories(SYSTEM ${LZ4_INCLUDE_DIR}) + endif() + +@@ -2394,7 +2407,7 @@ if(ARROW_WITH_RE2) + # 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. +- resolve_dependency(re2 HAVE_ALT TRUE) ++ resolve_dependency(re2 USE_CONFIG TRUE) + if(${re2_SOURCE} STREQUAL "SYSTEM") + get_target_property(RE2_LIB re2::re2 IMPORTED_LOCATION_${UPPERCASE_BUILD_TYPE}) + if(NOT RE2_LIB) +@@ -2464,7 +2477,7 @@ endmacro() + if(ARROW_WITH_BZ2) + resolve_dependency(BZip2) + if(${BZip2_SOURCE} STREQUAL "SYSTEM") +- string(APPEND ARROW_PC_LIBS_PRIVATE " ${BZIP2_LIBRARIES}") ++ string(APPEND ARROW_PC_LIBS_PRIVATE " ${BZip2_LIBRARIES}") + endif() + + if(NOT TARGET BZip2::BZip2) +@@ -2473,7 +2486,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) +@@ -3709,7 +3722,7 @@ if(ARROW_WITH_GRPC) + set(gRPC_SOURCE "${Protobuf_SOURCE}") + endif() + resolve_dependency(gRPC +- HAVE_ALT ++ USE_CONFIG + TRUE + REQUIRED_VERSION + ${ARROW_GRPC_REQUIRED_VERSION} +@@ -3727,9 +3740,9 @@ if(ARROW_WITH_GRPC) + 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") ++ 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") ++ 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}") +@@ -3937,7 +3950,7 @@ macro(build_google_cloud_cpp_storage) + endmacro() + + if(ARROW_WITH_GOOGLE_CLOUD_CPP) +- resolve_dependency(google_cloud_cpp_storage) ++ resolve_dependency(google_cloud_cpp) + get_target_property(google_cloud_cpp_storage_INCLUDE_DIR google-cloud-cpp::storage + INTERFACE_INCLUDE_DIRECTORIES) + include_directories(SYSTEM ${google_cloud_cpp_storage_INCLUDE_DIR}) +@@ -4264,9 +4277,9 @@ if(ARROW_WITH_OPENTELEMETRY) + # cURL is required whether we build from source or use an existing installation + # (OTel's cmake files do not call find_curl for you) + find_curl() +- set(opentelemetry-cpp_SOURCE "AUTO") ++ set(opentelemetry-cpp_SOURCE "SYSTEM") + resolve_dependency(opentelemetry-cpp) +- get_target_property(OPENTELEMETRY_INCLUDE_DIR opentelemetry-cpp::api ++ get_target_property(OPENTELEMETRY_INCLUDE_DIR opentelemetry-cpp::opentelemetry_common + INTERFACE_INCLUDE_DIRECTORIES) + include_directories(SYSTEM ${OPENTELEMETRY_INCLUDE_DIR}) + message(STATUS "Found OpenTelemetry headers: ${OPENTELEMETRY_INCLUDE_DIR}") +diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt +index 690c51a..752f3b9 100644 +--- a/cpp/src/arrow/CMakeLists.txt ++++ b/cpp/src/arrow/CMakeLists.txt +@@ -326,10 +326,14 @@ 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) ++ if (TARGET mimalloc-static) ++ list(APPEND _allocator_dependencies mimalloc-static) ++ else() ++ list(APPEND _allocator_dependencies mimalloc) ++ endif() + endif() + + if(_allocator_dependencies) +diff --git a/cpp/src/arrow/flight/CMakeLists.txt b/cpp/src/arrow/flight/CMakeLists.txt +index f9d1356..c9bcf79 100644 +--- a/cpp/src/arrow/flight/CMakeLists.txt ++++ b/cpp/src/arrow/flight/CMakeLists.txt +@@ -17,6 +17,9 @@ + + add_custom_target(arrow_flight) + ++# TODO: This is a temporary workaround. absl should be LINKED as TARGET. ++include_directories(SYSTEM ${absl_INCLUDE_DIR}) ++ + arrow_install_all_headers("arrow/flight") + + set(ARROW_FLIGHT_LINK_LIBS gRPC::grpc++ ${ARROW_PROTOBUF_LIBPROTOBUF}) +diff --git a/cpp/src/arrow/memory_pool.cc b/cpp/src/arrow/memory_pool.cc +index ed1c2d8..37a89da 100644 +--- a/cpp/src/arrow/memory_pool.cc ++++ b/cpp/src/arrow/memory_pool.cc +@@ -52,7 +52,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/cpp/src/gandiva/CMakeLists.txt b/cpp/src/gandiva/CMakeLists.txt +index 71faf9a..3aabea1 100644 +--- a/cpp/src/gandiva/CMakeLists.txt ++++ b/cpp/src/gandiva/CMakeLists.txt +@@ -25,7 +25,7 @@ add_custom_target(gandiva-benchmarks) + + add_dependencies(gandiva-all gandiva gandiva-tests gandiva-benchmarks) + +-find_package(LLVMAlt REQUIRED) ++find_package(LLVM REQUIRED) + + if(LLVM_VERSION_MAJOR LESS "10") + set(GANDIVA_CXX_STANDARD ${CMAKE_CXX_STANDARD}) +@@ -40,7 +40,7 @@ endif() + + add_definitions(-DGANDIVA_LLVM_VERSION=${LLVM_VERSION_MAJOR}) + +-find_package(OpenSSLAlt REQUIRED) ++find_package(OpenSSL REQUIRED) + + # Set the path where the bitcode file generated, see precompiled/CMakeLists.txt + set(GANDIVA_PRECOMPILED_BC_PATH "${CMAKE_CURRENT_BINARY_DIR}/irhelpers.bc") +@@ -98,10 +98,11 @@ set(SRC_FILES + random_generator_holder.cc + ${GANDIVA_PRECOMPILED_CC_PATH}) + +-set(GANDIVA_SHARED_PRIVATE_LINK_LIBS arrow_shared LLVM::LLVM_INTERFACE +- ${GANDIVA_OPENSSL_LIBS}) ++set(GANDIVA_SHARED_PRIVATE_LINK_LIBS arrow_shared llvm-core::llvm-core NTERFACE ++ ${GANDIVA_OPENSSL_LIBS}) ++ ++set(GANDIVA_STATIC_LINK_LIBS arrow_static llvm-core::llvm-core ${GANDIVA_OPENSSL_LIBS}) + +-set(GANDIVA_STATIC_LINK_LIBS arrow_static LLVM::LLVM_INTERFACE ${GANDIVA_OPENSSL_LIBS}) + + if(ARROW_GANDIVA_STATIC_LIBSTDCPP AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX + )) +@@ -139,7 +140,7 @@ add_arrow_lib(gandiva + arrow_dependencies + precompiled + EXTRA_INCLUDES +- $ ++ $ + ${GANDIVA_OPENSSL_INCLUDE_DIR} + ${UTF8PROC_INCLUDE_DIR} + SHARED_LINK_FLAGS diff --git a/ci/conan/all/test_package/CMakeLists.txt b/ci/conan/all/test_package/CMakeLists.txt index 4ea8b3605d1dc..18761d0f52c21 100644 --- a/ci/conan/all/test_package/CMakeLists.txt +++ b/ci/conan/all/test_package/CMakeLists.txt @@ -21,14 +21,14 @@ # SOFTWARE. cmake_minimum_required(VERSION 3.8) -project(test_package) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -find_package(Arrow REQUIRED) +find_package(Arrow REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} arrow::arrow) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) -target_compile_definitions(${PROJECT_NAME} PRIVATE WITH_JEMALLOC) +target_link_libraries(${PROJECT_NAME} PRIVATE arrow::arrow) +if (${Arrow_VERSION} VERSION_LESS "10.0.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +endif() diff --git a/ci/conan/all/test_package/conanfile.py b/ci/conan/all/test_package/conanfile.py index 8bfa021563a54..ce24052acb4e6 100644 --- a/ci/conan/all/test_package/conanfile.py +++ b/ci/conan/all/test_package/conanfile.py @@ -20,13 +20,23 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os +# It will become the standard on Conan 2.x class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -34,6 +44,6 @@ def build(self): 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) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/ci/conan/all/CMakeLists.txt b/ci/conan/all/test_v1_package/CMakeLists.txt similarity index 83% rename from ci/conan/all/CMakeLists.txt rename to ci/conan/all/test_v1_package/CMakeLists.txt index cb849a6633c37..faf547dec70c2 100644 --- a/ci/conan/all/CMakeLists.txt +++ b/ci/conan/all/test_v1_package/CMakeLists.txt @@ -21,9 +21,11 @@ # SOFTWARE. cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) -include(conanbuildinfo.cmake) -conan_basic_setup() +project(test_package) -add_subdirectory(source_subfolder/cpp) +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/ci/conan/all/test_v1_package/conanfile.py b/ci/conan/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..4f5cc2b61011b --- /dev/null +++ b/ci/conan/all/test_v1_package/conanfile.py @@ -0,0 +1,40 @@ +# 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 +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/ci/conan/config.yml b/ci/conan/config.yml index b38fe36930ca3..4e0975bc59e97 100644 --- a/ci/conan/config.yml +++ b/ci/conan/config.yml @@ -21,6 +21,8 @@ # SOFTWARE. versions: + "10.0.0": + folder: all "8.0.1": folder: all "8.0.0": diff --git a/ci/conan/merge_status.sh b/ci/conan/merge_status.sh index 0e047ab753a7c..862d27ee3c5d5 100644 --- a/ci/conan/merge_status.sh +++ b/ci/conan/merge_status.sh @@ -15,4 +15,4 @@ # specific language governing permissions and limitations # under the License. -UPSTREAM_REVISION=d659daa941be8ea8d2b22e8802c61f15688c67d5 +UPSTREAM_REVISION=5c8f8538e32edd0911fd70710ce2d188bcd409f2 diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index e0db50e0dd64d..52a47f4b353ba 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -883,8 +883,8 @@ if(ARROW_BUILD_BENCHMARKS) endif() if(ARROW_JEMALLOC) - list(APPEND ARROW_SHARED_LINK_LIBS jemalloc) - list(APPEND ARROW_STATIC_LINK_LIBS jemalloc) + list(APPEND ARROW_SHARED_LINK_LIBS jemalloc::jemalloc) + list(APPEND ARROW_STATIC_LINK_LIBS jemalloc::jemalloc) endif() if(ARROW_MIMALLOC) diff --git a/cpp/cmake_modules/FindBrotli.cmake b/cpp/cmake_modules/FindBrotliAlt.cmake similarity index 82% rename from cpp/cmake_modules/FindBrotli.cmake rename to cpp/cmake_modules/FindBrotliAlt.cmake index 2ef6ec439c6e9..3c90329be9651 100644 --- a/cpp/cmake_modules/FindBrotli.cmake +++ b/cpp/cmake_modules/FindBrotliAlt.cmake @@ -15,28 +15,39 @@ # # Usage of this module as follows: # -# find_package(Brotli) +# find_package(BrotliAlt) -if(Brotli_FOUND) +if(BrotliAlt_FOUND) return() endif() -if(ARROW_PACAKGE_KIND STREQUAL "vcpkg") +if(ARROW_PACKAGE_KIND STREQUAL "vcpkg" OR ARROW_PACKAGE_KIND STREQUAL "conan") set(find_package_args "") - if(Brotli_FIND_VERSION) - list(APPEND find_package_args ${Brotli_FIND_VERSION}) + if(BrotliAlt_FIND_VERSION) + list(APPEND find_package_args ${BrotliAlt_FIND_VERSION}) endif() - if(Brotli_FIND_QUIETLY) + if(BrotliAlt_FIND_QUIETLY) list(APPEND find_package_args QUIET) endif() - if(Brotli_FIND_REQUIRED) + if(BrotliAlt_FIND_REQUIRED) list(APPEND find_package_args REQUIRED) endif() - find_package(Brotli NAMES unofficial-brotli ${find_package_args}) - if(Brotli_FOUND) - add_library(Brotli::brotlicommon ALIAS unofficial::brotli::brotlicommon) - add_library(Brotli::brotlienc ALIAS unofficial::brotli::brotlienc) - add_library(Brotli::brotlidec ALIAS unofficial::brotli::brotlidec) + if(ARROW_PACKAGE_KIND STREQUAL "vcpkg") + find_package(BrotliAlt NAMES unofficial-brotli ${find_package_args}) + else() + find_package(BrotliAlt NAMES brotli ${find_package_args}) + endif() + set(Brotli_FOUND ${BrotliAlt_FOUND}) + if(BrotliAlt_FOUND) + if(ARROW_PACKAGE_KIND STREQUAL "vcpkg") + add_library(Brotli::brotlicommon ALIAS unofficial::brotli::brotlicommon) + add_library(Brotli::brotlienc ALIAS unofficial::brotli::brotlienc) + add_library(Brotli::brotlidec ALIAS unofficial::brotli::brotlidec) + else() + add_library(Brotli::brotlicommon ALIAS brotli::brotlicommon) + add_library(Brotli::brotlienc ALIAS brotli::brotlienc) + add_library(Brotli::brotlidec ALIAS brotli::brotlidec) + endif() return() endif() endif() @@ -135,10 +146,10 @@ else() 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) + BrotliAlt REQUIRED_VARS BROTLI_COMMON_LIBRARY BROTLI_ENC_LIBRARY BROTLI_DEC_LIBRARY + BROTLI_INCLUDE_DIR) +set(Brotli_FOUND ${BrotliAlt_FOUND}) +if(BrotliAlt_FOUND) add_library(Brotli::brotlicommon UNKNOWN IMPORTED) set_target_properties(Brotli::brotlicommon PROPERTIES IMPORTED_LOCATION "${BROTLI_COMMON_LIBRARY}" diff --git a/cpp/cmake_modules/Findjemalloc.cmake b/cpp/cmake_modules/FindjemallocAlt.cmake similarity index 56% rename from cpp/cmake_modules/Findjemalloc.cmake rename to cpp/cmake_modules/FindjemallocAlt.cmake index 6f4c482c570f5..49616425db492 100644 --- a/cpp/cmake_modules/Findjemalloc.cmake +++ b/cpp/cmake_modules/FindjemallocAlt.cmake @@ -14,35 +14,53 @@ # # Usage of this module as follows: # -# find_package(jemalloc) +# find_package(jemallocAlt) # # This module defines # jemalloc::jemalloc, target to use jemalloc -if(jemalloc_FOUND) +if(jemallocAlt_FOUND) return() endif() +if(ARROW_PACKAGE_KIND STREQUAL "conan") + set(find_package_args "") + if(jemallocAlt_FIND_VERSION) + list(APPEND find_package_args ${jemallocAlt_FIND_VERSION}) + endif() + if(jemallocAlt_FIND_QUIETLY) + list(APPEND find_package_args QUIET) + endif() + if(jemallocAlt_FIND_REQUIRED) + list(APPEND find_package_args REQUIRED) + endif() + find_package(jemallocAlt NAMES jemalloc ${find_package_args}) + set(jemalloc_FOUND ${jemallocAlt_FOUND}) + if(jemallocAlt_FOUND) + return() + endif() +endif() + if(ARROW_JEMALLOC_USE_SHARED) - set(jemalloc_LIB_NAMES) + set(jemallocAlt_LIB_NAMES) if(CMAKE_IMPORT_LIBRARY_SUFFIX) - list(APPEND jemalloc_LIB_NAMES + list(APPEND jemallocAlt_LIB_NAMES "${CMAKE_IMPORT_LIBRARY_PREFIX}jemalloc${CMAKE_IMPORT_LIBRARY_SUFFIX}") endif() - list(APPEND jemalloc_LIB_NAMES + list(APPEND jemallocAlt_LIB_NAMES "${CMAKE_SHARED_LIBRARY_PREFIX}jemalloc${CMAKE_SHARED_LIBRARY_SUFFIX}") else() - set(jemalloc_LIB_NAMES + set(jemallocAlt_LIB_NAMES "${CMAKE_STATIC_LIBRARY_PREFIX}jemalloc${CMAKE_STATIC_LIBRARY_SUFFIX}") endif() if(jemalloc_ROOT) - find_library(jemalloc_LIB - NAMES ${jemallc_LIB_NAMES} - PATHS ${jemallc_ROOT} + find_library(jemallocAlt_LIB + NAMES ${jemallocAlt_LIB_NAMES} + PATHS ${jemalloc_ROOT} PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES} NO_DEFAULT_PATH) - find_path(jemalloc_INCLUDE_DIR + find_path(jemallocAlt_INCLUDE_DIR NAMES jemalloc/jemalloc.h PATHS ${jemalloc_ROOT} NO_DEFAULT_PATH @@ -50,29 +68,29 @@ if(jemalloc_ROOT) else() find_package(PkgConfig QUIET) - pkg_check_modules(jemalloc_PC jemalloc) - if(jemalloc_PC_FOUND) - set(jemalloc_INCLUDE_DIR "${jemalloc_PC_INCLUDEDIR}") - list(APPEND jemalloc_PC_LIBRARY_DIRS "${jemalloc_PC_LIBDIR}") - find_library(jemalloc_LIB - NAMES ${jemalloc_LIB_NAMES} - PATHS ${jemalloc_PC_LIBRARY_DIRS} + pkg_check_modules(jemallocAlt_PC jemalloc) + if(jemallocAlt_PC_FOUND) + set(jemallocAlt_INCLUDE_DIR "${jemallocAlt_PC_INCLUDEDIR}") + list(APPEND jemallocAlt_PC_LIBRARY_DIRS "${jemallocAlt_PC_LIBDIR}") + find_library(jemallocAlt_LIB + NAMES ${jemallocAlt_LIB_NAMES} + PATHS ${jemallocAlt_PC_LIBRARY_DIRS} NO_DEFAULT_PATH PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES}) else() - find_library(jemalloc_LIB - NAMES ${jemalloc_LIB_NAMES} + find_library(jemallocAlt_LIB + NAMES ${jemallocAlt_LIB_NAMES} PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES}) - find_path(jemalloc_INCLUDE_DIR + find_path(jemallocAlt_INCLUDE_DIR NAMES jemalloc/jemalloc.h PATH_SUFFIXES ${ARROW_INCLUDE_PATH_SUFFIXES}) endif() endif() -find_package_handle_standard_args(jemalloc REQUIRED_VARS jemalloc_LIB - jemalloc_INCLUDE_DIR) - -if(jemalloc_FOUND) +find_package_handle_standard_args(jemallocAlt REQUIRED_VARS jemallocAlt_LIB + jemallocAlt_INCLUDE_DIR) +set(jemalloc_FOUND ${jemallocAlt_FOUND}) +if(jemallocAlt_FOUND) if(NOT TARGET jemalloc::jemalloc) if(ARROW_JEMALLOC_USE_SHARED) add_library(jemalloc::jemalloc SHARED IMPORTED) @@ -80,8 +98,8 @@ if(jemalloc_FOUND) add_library(jemalloc::jemalloc STATIC IMPORTED) endif() set_target_properties(jemalloc::jemalloc - PROPERTIES IMPORTED_LOCATION "${jemalloc_LIB}" + PROPERTIES IMPORTED_LOCATION "${jemallocAlt_LIB}" INTERFACE_INCLUDE_DIRECTORIES - "${jemalloc_INCLUDE_DIR}") + "${jemallocAlt_INCLUDE_DIR}") endif() endif() diff --git a/cpp/cmake_modules/Findutf8proc.cmake b/cpp/cmake_modules/Findutf8proc.cmake index d03ca73a7c909..e347414090549 100644 --- a/cpp/cmake_modules/Findutf8proc.cmake +++ b/cpp/cmake_modules/Findutf8proc.cmake @@ -19,7 +19,7 @@ if(utf8proc_FOUND) return() endif() -if(ARROW_PACAKGE_KIND STREQUAL "vcpkg") +if(ARROW_PACKAGE_KIND STREQUAL "vcpkg") set(find_package_args "") if(utf8proc_FIND_VERSION) list(APPEND find_package_args ${utf8proc_FIND_VERSION}) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index c4b358bbf0a7a..ac239daed0115 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -1233,7 +1233,12 @@ macro(build_brotli) endmacro() if(ARROW_WITH_BROTLI) - resolve_dependency(Brotli PC_PACKAGE_NAMES libbrotlidec libbrotlienc) + resolve_dependency(Brotli + HAVE_ALT + TRUE + PC_PACKAGE_NAMES + libbrotlidec + libbrotlienc) endif() if(PARQUET_REQUIRE_ENCRYPTION AND NOT ARROW_PARQUET) @@ -1843,15 +1848,15 @@ macro(build_jemalloc) set(JEMALLOC_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/jemalloc_ep-prefix/src/") # The include directory must exist before it is referenced by a target. file(MAKE_DIRECTORY "${JEMALLOC_INCLUDE_DIR}") - add_library(jemalloc STATIC IMPORTED) - set_target_properties(jemalloc + add_library(jemalloc::jemalloc STATIC IMPORTED) + set_target_properties(jemalloc::jemalloc PROPERTIES INTERFACE_LINK_LIBRARIES Threads::Threads IMPORTED_LOCATION "${JEMALLOC_STATIC_LIB}" INTERFACE_INCLUDE_DIRECTORIES "${JEMALLOC_INCLUDE_DIR}") - add_dependencies(jemalloc jemalloc_ep) + add_dependencies(jemalloc::jemalloc jemalloc_ep) - list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc) + list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc::jemalloc) set(jemalloc_VENDORED TRUE) # For config.h.cmake @@ -1859,7 +1864,7 @@ macro(build_jemalloc) endmacro() if(ARROW_JEMALLOC) - resolve_dependency(jemalloc) + resolve_dependency(jemalloc HAVE_ALT TRUE) endif() # ----------------------------------------------------------------------