From 3f3f1751b1eccc5f9d78bd2de51a19d3f6f49cb4 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Mon, 29 Jul 2024 17:07:53 +0900 Subject: [PATCH 1/3] GH-43467: [C++] Add support for the official LZ4 CMake package LZ4 1.10.0 provides `LZ4::lz4` but LZ4 1.9.4 provides only `LZ4::lz4_shared` and `LZ4::lz4_static`. So we need to prepare `LZ4::lz4` in our side. --- cpp/cmake_modules/Findlz4Alt.cmake | 12 +++++++++--- cpp/cmake_modules/ThirdpartyToolchain.cmake | 5 ++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/cpp/cmake_modules/Findlz4Alt.cmake b/cpp/cmake_modules/Findlz4Alt.cmake index 77a22957f79..91e735107a9 100644 --- a/cpp/cmake_modules/Findlz4Alt.cmake +++ b/cpp/cmake_modules/Findlz4Alt.cmake @@ -29,9 +29,15 @@ endif() find_package(lz4 ${find_package_args}) if(lz4_FOUND) set(lz4Alt_FOUND TRUE) - # Conan uses lz4::lz4 not LZ4::lz4 - if(NOT TARGET LZ4::lz4 AND TARGET lz4::lz4) - add_library(LZ4::lz4 ALIAS lz4::lz4) + if(NOT TARGET LZ4::lz4) + # Conan uses lz4::lz4 not LZ4::lz4 + if(TARGET lz4::lz4) + add_library(LZ4::lz4 ALIAS lz4::lz4) + elseif(ARROW_LZ4_USE_SHARED) + add_library(LZ4::lz4 ALIAS LZ4::lz4_shared) + else() + add_library(LZ4::lz4 ALIAS LZ4::lz4_static) + endif() endif() return() endif() diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 1c8c40d6f9c..26fed710ae5 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -4510,9 +4510,12 @@ function(build_orc) OFF CACHE BOOL "" FORCE) get_target_property(LZ4_INCLUDE_DIR LZ4::lz4 INTERFACE_INCLUDE_DIRECTORIES) + if(NOT LZ4_INCLUDE_DIR) + find_path(LZ4_INCLUDE_DIR NAMES lz4.h) + endif() get_filename_component(LZ4_ROOT "${LZ4_INCLUDE_DIR}" DIRECTORY) set(LZ4_HOME - ${LZ4_ROOT} + "${LZ4_ROOT}" CACHE STRING "" FORCE) set(LZ4_LIBRARY LZ4::lz4 From 90f2b4d2158f7a62d8ff4dc2b285abc76ed9f835 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Wed, 31 Jul 2024 10:04:39 +0900 Subject: [PATCH 2/3] Add libxxhash-dev dependency explicitly Because liblz4-dev misses it. --- .../linux-packages/apache-arrow/apt/debian-bookworm/Dockerfile | 1 + .../linux-packages/apache-arrow/apt/debian-trixie/Dockerfile | 1 + .../linux-packages/apache-arrow/apt/ubuntu-focal/Dockerfile | 1 + .../linux-packages/apache-arrow/apt/ubuntu-jammy/Dockerfile | 1 + .../linux-packages/apache-arrow/apt/ubuntu-noble/Dockerfile | 1 + dev/tasks/linux-packages/apache-arrow/debian/control.in | 2 ++ 6 files changed, 7 insertions(+) diff --git a/dev/tasks/linux-packages/apache-arrow/apt/debian-bookworm/Dockerfile b/dev/tasks/linux-packages/apache-arrow/apt/debian-bookworm/Dockerfile index b38ee72d68c..ec3bf7751d2 100644 --- a/dev/tasks/linux-packages/apache-arrow/apt/debian-bookworm/Dockerfile +++ b/dev/tasks/linux-packages/apache-arrow/apt/debian-bookworm/Dockerfile @@ -65,6 +65,7 @@ RUN \ libssl-dev \ libthrift-dev \ libutf8proc-dev \ + libxxhash-dev \ libzstd-dev \ llvm-dev \ lsb-release \ diff --git a/dev/tasks/linux-packages/apache-arrow/apt/debian-trixie/Dockerfile b/dev/tasks/linux-packages/apache-arrow/apt/debian-trixie/Dockerfile index 8a6accbfc8b..c6a09da2dfd 100644 --- a/dev/tasks/linux-packages/apache-arrow/apt/debian-trixie/Dockerfile +++ b/dev/tasks/linux-packages/apache-arrow/apt/debian-trixie/Dockerfile @@ -66,6 +66,7 @@ RUN \ libssl-dev \ libthrift-dev \ libutf8proc-dev \ + libxxhash-dev \ libzstd-dev \ llvm-dev \ lsb-release \ diff --git a/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-focal/Dockerfile b/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-focal/Dockerfile index fdd0362680c..fe783638b63 100644 --- a/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-focal/Dockerfile +++ b/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-focal/Dockerfile @@ -56,6 +56,7 @@ RUN \ libssl-dev \ libthrift-dev \ libutf8proc-dev \ + libxxhash-dev \ libzstd-dev \ llvm-dev \ lsb-release \ diff --git a/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-jammy/Dockerfile b/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-jammy/Dockerfile index e6718e59b0a..1d9065d6b2e 100644 --- a/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-jammy/Dockerfile +++ b/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-jammy/Dockerfile @@ -58,6 +58,7 @@ RUN \ libssl-dev \ libthrift-dev \ libutf8proc-dev \ + libxxhash-dev \ libzstd-dev \ llvm-dev \ lsb-release \ diff --git a/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-noble/Dockerfile b/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-noble/Dockerfile index 87ea2402456..f5f5e12f4d5 100644 --- a/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-noble/Dockerfile +++ b/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-noble/Dockerfile @@ -60,6 +60,7 @@ RUN \ libssl-dev \ libthrift-dev \ libutf8proc-dev \ + libxxhash-dev \ libzstd-dev \ llvm-dev \ lsb-release \ diff --git a/dev/tasks/linux-packages/apache-arrow/debian/control.in b/dev/tasks/linux-packages/apache-arrow/debian/control.in index 24e2839021a..cf3f488cc17 100644 --- a/dev/tasks/linux-packages/apache-arrow/debian/control.in +++ b/dev/tasks/linux-packages/apache-arrow/debian/control.in @@ -27,6 +27,7 @@ Build-Depends: libssl-dev, libthrift-dev, libutf8proc-dev, + libxxhash-dev, libzstd-dev, meson, ninja-build, @@ -152,6 +153,7 @@ Depends: libsnappy-dev, libssl-dev, libutf8proc-dev, + libxxhash-dev, libzstd-dev, nlohmann-json-dev | nlohmann-json3-dev, @USE_SYSTEM_GRPC@ protobuf-compiler-grpc, From c2c28c8ca24c72df331788abe760ff33e9d4da4c Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Wed, 31 Jul 2024 10:08:02 +0900 Subject: [PATCH 3/3] Exclude libparquet.so --- dev/tasks/linux-packages/apache-arrow/debian/rules | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dev/tasks/linux-packages/apache-arrow/debian/rules b/dev/tasks/linux-packages/apache-arrow/debian/rules index 6c3074ab234..40877f44dbe 100755 --- a/dev/tasks/linux-packages/apache-arrow/debian/rules +++ b/dev/tasks/linux-packages/apache-arrow/debian/rules @@ -107,8 +107,10 @@ override_dh_auto_test: # libarrow.so: avoid failing with "Unknown DWARF DW_OP_172" # libgandiva.so: avoid failing with "Unknown DWARF DW_OP_255" +# libparquet.so: avoid failing with "Unknown DWARF DW_OP_4" # See also: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=949296 override_dh_dwz: dh_dwz \ --exclude=libarrow.so \ - --exclude=libgandiva.so + --exclude=libgandiva.so \ + --exclude=libparquet.so