Skip to content

Apache DataFusion SQL Query Engine

ARROW-8961: [C++] Add utf8proc library to toolchain

Uwe L. Korn6a2488d07639
diff --git a/ci/conda_env_cpp.yml b/ci/conda_env_cpp.yml
index 3c0f7f51d1..a0c2e99aca 100644
--- a/ci/conda_env_cpp.yml
+++ b/ci/conda_env_cpp.yml
@@ -28,6 +28,7 @@ gmock>=1.8.1
grpc-cpp>=1.21.4
gtest=1.8.1
libprotobuf
+libutf8proc
lz4-c
make
ninja
diff --git a/ci/docker/debian-10-cpp.dockerfile b/ci/docker/debian-10-cpp.dockerfile
index 955e7aeba7..f86c009b57 100644
--- a/ci/docker/debian-10-cpp.dockerfile
+++ b/ci/docker/debian-10-cpp.dockerfile
@@ -58,6 +58,7 @@ RUN apt-get update -y -q && \
libsnappy-dev \
libssl-dev \
libthrift-dev \
+ libutf8proc-dev \
libzstd-dev \
llvm-${llvm}-dev \
make \
diff --git a/ci/docker/fedora-32-cpp.dockerfile b/ci/docker/fedora-32-cpp.dockerfile
index 766e6b343d..535f8b4b76 100644
--- a/ci/docker/fedora-32-cpp.dockerfile
+++ b/ci/docker/fedora-32-cpp.dockerfile
@@ -53,6 +53,7 @@ RUN dnf update -y && \
re2-devel \
snappy-devel \
thrift-devel \
+ utf8proc-devel \
which \
zlib-devel
diff --git a/ci/docker/ubuntu-14.04-cpp.dockerfile b/ci/docker/ubuntu-14.04-cpp.dockerfile
index f44326df0c..2316b6ed0d 100644
--- a/ci/docker/ubuntu-14.04-cpp.dockerfile
+++ b/ci/docker/ubuntu-14.04-cpp.dockerfile
@@ -90,4 +90,5 @@ ENV ARROW_BUILD_TESTS=ON \
RapidJSON_SOURCE=BUNDLED \
RE2_SOURCE=BUNDLED \
Thrift_SOURCE=BUNDLED \
+ utf8proc_SOURCE=BUNDLED \
ZSTD_SOURCE=BUNDLED
diff --git a/ci/docker/ubuntu-16.04-cpp.dockerfile b/ci/docker/ubuntu-16.04-cpp.dockerfile
index 5ab0a88dd9..e94dc8ac53 100644
--- a/ci/docker/ubuntu-16.04-cpp.dockerfile
+++ b/ci/docker/ubuntu-16.04-cpp.dockerfile
@@ -51,6 +51,7 @@ RUN apt-get update -y -q && \
liblz4-dev \
libre2-dev \
libssl-dev \
+ libutf8proc-dev \
libzstd1-dev \
llvm-${llvm}-dev \
make \
diff --git a/ci/docker/ubuntu-18.04-cpp.dockerfile b/ci/docker/ubuntu-18.04-cpp.dockerfile
index 21d15ea09e..f93f59867d 100644
--- a/ci/docker/ubuntu-18.04-cpp.dockerfile
+++ b/ci/docker/ubuntu-18.04-cpp.dockerfile
@@ -78,6 +78,7 @@ RUN apt-get update -y -q && \
libre2-dev \
libsnappy-dev \
libssl-dev \
+ libutf8proc-dev \
libzstd-dev \
ninja-build \
pkg-config \
diff --git a/ci/docker/ubuntu-20.04-cpp.dockerfile b/ci/docker/ubuntu-20.04-cpp.dockerfile
index 726a2fdc18..2b0e32c1e8 100644
--- a/ci/docker/ubuntu-20.04-cpp.dockerfile
+++ b/ci/docker/ubuntu-20.04-cpp.dockerfile
@@ -65,6 +65,7 @@ RUN apt-get update -y -q && \
libsnappy-dev \
libssl-dev \
libthrift-dev \
+ libutf8proc-dev \
libzstd-dev \
make \
ninja-build \
diff --git a/ci/scripts/cpp_build.sh b/ci/scripts/cpp_build.sh
index b84d72c352..6420a5331a 100755
--- a/ci/scripts/cpp_build.sh
+++ b/ci/scripts/cpp_build.sh
@@ -123,6 +123,7 @@ cmake -G "${CMAKE_GENERATOR:-Ninja}" \
-DRE2_SOURCE=${RE2_SOURCE:-} \
-DSnappy_SOURCE=${Snappy_SOURCE:-} \
-DThrift_SOURCE=${Thrift_SOURCE:-} \
+ -Dutf8proc_SOURCE=${utf8proc_SOURCE:-} \
-DZSTD_SOURCE=${ZSTD_SOURCE:-} \
${CMAKE_ARGS} \
${source_dir}
diff --git a/ci/scripts/msys2_setup.sh b/ci/scripts/msys2_setup.sh
index 9cd999b00e..585a143677 100755
--- a/ci/scripts/msys2_setup.sh
+++ b/ci/scripts/msys2_setup.sh
@@ -41,6 +41,7 @@ case "${target}" in
packages+=(${MINGW_PACKAGE_PREFIX}-rapidjson)
packages+=(${MINGW_PACKAGE_PREFIX}-snappy)
packages+=(${MINGW_PACKAGE_PREFIX}-thrift)
+ packages+=(${MINGW_PACKAGE_PREFIX}-libutf8proc)
packages+=(${MINGW_PACKAGE_PREFIX}-zlib)
packages+=(${MINGW_PACKAGE_PREFIX}-zstd)
;;
diff --git a/dev/tasks/conda-recipes/arrow-cpp/meta.yaml b/dev/tasks/conda-recipes/arrow-cpp/meta.yaml
index c9b1a210fa..85c1da84f8 100644
--- a/dev/tasks/conda-recipes/arrow-cpp/meta.yaml
+++ b/dev/tasks/conda-recipes/arrow-cpp/meta.yaml
@@ -68,6 +68,7 @@ outputs:
- glog
- grpc-cpp
- libprotobuf
+ - libutf8proc
- clangdev 10.* # [not win]
- llvmdev 10.* # [not win]
# llvmdev 9.* or later require Visual Studio 2017
diff --git a/dev/tasks/linux-packages/apache-arrow/apt/debian-buster/Dockerfile b/dev/tasks/linux-packages/apache-arrow/apt/debian-buster/Dockerfile
index 7acff38cbb..fdb57005ca 100644
--- a/dev/tasks/linux-packages/apache-arrow/apt/debian-buster/Dockerfile
+++ b/dev/tasks/linux-packages/apache-arrow/apt/debian-buster/Dockerfile
@@ -71,6 +71,7 @@ RUN \
libsnappy-dev \
libssl-dev \
libthrift-dev \
+ libutf8proc-dev \
libzstd-dev \
lsb-release \
ninja-build \
diff --git a/dev/tasks/linux-packages/apache-arrow/apt/debian-stretch/Dockerfile b/dev/tasks/linux-packages/apache-arrow/apt/debian-stretch/Dockerfile
index 7194897c66..606b2c9fe7 100644
--- a/dev/tasks/linux-packages/apache-arrow/apt/debian-stretch/Dockerfile
+++ b/dev/tasks/linux-packages/apache-arrow/apt/debian-stretch/Dockerfile
@@ -70,6 +70,7 @@ RUN \
libre2-dev \
libsnappy-dev \
libssl-dev \
+ libutf8proc-dev \
libzstd-dev \
lsb-release \
ninja-build \
diff --git a/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-bionic/Dockerfile b/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-bionic/Dockerfile
index da52efc0f3..606db04a27 100644
--- a/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-bionic/Dockerfile
+++ b/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-bionic/Dockerfile
@@ -62,6 +62,7 @@ RUN \
libre2-dev \
libsnappy-dev \
libssl-dev \
+ libutf8proc-dev \
libzstd-dev \
lsb-release \
ninja-build \
diff --git a/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-eoan/Dockerfile b/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-eoan/Dockerfile
index 05ee1fad90..dceb8ba3a0 100644
--- a/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-eoan/Dockerfile
+++ b/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-eoan/Dockerfile
@@ -64,6 +64,7 @@ RUN \
libsnappy-dev \
libssl-dev \
libthrift-dev \
+ libutf8proc-dev \
libzstd-dev \
lsb-release \
ninja-build \
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 3b1b3eb398..e9468d4109 100644
--- a/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-focal/Dockerfile
+++ b/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-focal/Dockerfile
@@ -55,6 +55,7 @@ RUN \
libsnappy-dev \
libssl-dev \
libthrift-dev \
+ libutf8proc-dev \
libzstd-dev \
lsb-release \
ninja-build \
diff --git a/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-xenial/Dockerfile b/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-xenial/Dockerfile
index 2e09b7053a..79da9f5906 100644
--- a/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-xenial/Dockerfile
+++ b/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-xenial/Dockerfile
@@ -68,6 +68,7 @@ RUN \
libre2-dev \
libsnappy-dev \
libssl-dev \
+ libutf8proc-dev \
libzstd1-dev \
lsb-release \
pkg-config \
diff --git a/dev/tasks/linux-packages/apache-arrow/debian.ubuntu-xenial/control b/dev/tasks/linux-packages/apache-arrow/debian.ubuntu-xenial/control
index 97e7410a9e..b78e0893ee 100644
--- a/dev/tasks/linux-packages/apache-arrow/debian.ubuntu-xenial/control
+++ b/dev/tasks/linux-packages/apache-arrow/debian.ubuntu-xenial/control
@@ -22,6 +22,7 @@ Build-Depends:
libre2-dev,
libsnappy-dev,
libssl-dev,
+ libutf8proc-dev,
libzstd1-dev,
nvidia-cuda-toolkit [!arm64],
pkg-config,
diff --git a/dev/tasks/linux-packages/apache-arrow/debian/control b/dev/tasks/linux-packages/apache-arrow/debian/control
index e6c431044f..928412ef2c 100644
--- a/dev/tasks/linux-packages/apache-arrow/debian/control
+++ b/dev/tasks/linux-packages/apache-arrow/debian/control
@@ -20,6 +20,7 @@ Build-Depends:
libre2-dev,
libsnappy-dev,
libssl-dev,
+ libutf8proc-dev,
libzstd-dev,
ninja-build,
nvidia-cuda-toolkit [!arm64],
diff --git a/dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in b/dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in
index 092efefe49..7cb543db8d 100644
--- a/dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in
+++ b/dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in
@@ -45,7 +45,7 @@
%define use_meson (%{_centos_ver} >= 8)
%define have_rapidjson (%{_centos_ver} == 7)
-%define have_zstd (%{_centos_ver} < 8)
+%define have_utf8proc (%{_centos_ver} == 7)
Name: @PACKAGE@
Version: @VERSION@
@@ -71,9 +71,7 @@ BuildRequires: git
%if %{_centos_ver} >= 7
BuildRequires: glog-devel
%endif
-%if %{have_zstd}
BuildRequires: libzstd-devel
-%endif
BuildRequires: lz4-devel
BuildRequires: pkgconfig
BuildRequires: python%{python_version}-devel
@@ -85,6 +83,9 @@ BuildRequires: rapidjson-devel
BuildRequires: re2-devel
%endif
BuildRequires: snappy-devel
+%if %{have_utf8proc}
+BuildRequires: utf8proc-devel
+%endif
BuildRequires: zlib-devel
%if %{use_flight}
@@ -223,14 +224,15 @@ Requires: brotli
Requires: gflags
Requires: glog
%endif
-%if %{have_zstd}
Requires: libzstd
-%endif
Requires: lz4
%if %{_centos_ver} >= 8
Requires: re2
%endif
Requires: snappy
+%if %{have_utf8proc}
+Requires: utf8proc
+%endif
Requires: zlib
%description libs
diff --git a/dev/tasks/linux-packages/apache-arrow/yum/centos-7/Dockerfile b/dev/tasks/linux-packages/apache-arrow/yum/centos-7/Dockerfile
index a375c971df..93436bbbf3 100644
--- a/dev/tasks/linux-packages/apache-arrow/yum/centos-7/Dockerfile
+++ b/dev/tasks/linux-packages/apache-arrow/yum/centos-7/Dockerfile
@@ -51,6 +51,7 @@ RUN \
rpmdevtools \
snappy-devel \
tar \
+ utf8proc-devel \
zlib-devel && \
yum clean ${quiet} all
diff --git a/dev/tasks/linux-packages/apache-arrow/yum/centos-8/Dockerfile b/dev/tasks/linux-packages/apache-arrow/yum/centos-8/Dockerfile
index 3f6701da3f..19e947200f 100644
--- a/dev/tasks/linux-packages/apache-arrow/yum/centos-8/Dockerfile
+++ b/dev/tasks/linux-packages/apache-arrow/yum/centos-8/Dockerfile
@@ -39,7 +39,7 @@ RUN \
glog-devel \
gobject-introspection-devel \
gtk-doc \
- # libzstd-devel \
+ libzstd-devel \
llvm-devel \
llvm-static \
lz4-devel \
@@ -58,5 +58,6 @@ RUN \
rpmdevtools \
snappy-devel \
tar \
+ # utf8proc-devel \
zlib-devel && \
dnf clean ${quiet} all