This is an automated email from the ASF dual-hosted git repository.
assignuser pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 62fd98704d GH-43467: [C++] Add support for the official LZ4 CMake
package (#43468)
62fd98704d is described below
commit 62fd98704dbe2684018707a7b135751fa7bfbe5a
Author: Sutou Kouhei <[email protected]>
AuthorDate: Wed Jul 31 11:43:05 2024 +0900
GH-43467: [C++] Add support for the official LZ4 CMake package (#43468)
### Rationale for this change
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.
### What changes are included in this PR?
Define `LZ4::lz4` by `LZ4::lz4_shared` or `LZ4::lz4_static` if `LZ4::lz4`
doesn't exist.
### Are these changes tested?
Yes.
### Are there any user-facing changes?
Yes.
* GitHub Issue: #43467
Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Jacob Wujciak-Jens <[email protected]>
---
cpp/cmake_modules/Findlz4Alt.cmake | 12 +++++++++---
cpp/cmake_modules/ThirdpartyToolchain.cmake | 5 ++++-
.../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 ++
dev/tasks/linux-packages/apache-arrow/debian/rules | 4 +++-
9 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/cpp/cmake_modules/Findlz4Alt.cmake
b/cpp/cmake_modules/Findlz4Alt.cmake
index 77a22957f7..91e735107a 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 92bd80014e..495aa70483 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -4516,9 +4516,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
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 b38ee72d68..ec3bf7751d 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 8a6accbfc8..c6a09da2df 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 fdd0362680..fe783638b6 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 e6718e59b0..1d9065d6b2 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 87ea240245..f5f5e12f4d 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 24e2839021..cf3f488cc1 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,
diff --git a/dev/tasks/linux-packages/apache-arrow/debian/rules
b/dev/tasks/linux-packages/apache-arrow/debian/rules
index 6c3074ab23..40877f44db 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