From f1318798c79cef411d4a272eceed2223188e04fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Baptiste=20Onofr=C3=A9?= Date: Mon, 26 Oct 2026 18:16:13 +0100 Subject: [PATCH 1/2] GH-1408: Add bundled utf8_range headers to the macOS Gandiva JNI build Newer bundled protobuf headers include utf8_validity.h, which lives in third_party/utf8_range of the protobuf source. Add it to the Gandiva JNI include path, like the bundled Abseil headers. Closes #1408. Co-Authored-By: Claude Sonnet 5.5 --- CMakeLists.txt | 4 ++++ ci/scripts/jni_macos_build.sh | 8 ++++++++ gandiva/CMakeLists.txt | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 11e6eb7448..b6b06d1a74 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,6 +41,10 @@ set(ARROW_JAVA_JNI_ABSL_INCLUDE_DIR "" CACHE PATH "Path to Abseil source headers for the Gandiva JNI build") mark_as_advanced(ARROW_JAVA_JNI_ABSL_INCLUDE_DIR) +set(ARROW_JAVA_JNI_UTF8_RANGE_INCLUDE_DIR + "" + CACHE PATH "Path to utf8_range source headers for the Gandiva JNI build") +mark_as_advanced(ARROW_JAVA_JNI_UTF8_RANGE_INCLUDE_DIR) include(GNUInstallDirs) diff --git a/ci/scripts/jni_macos_build.sh b/ci/scripts/jni_macos_build.sh index efc2446752..c28980f5bc 100755 --- a/ci/scripts/jni_macos_build.sh +++ b/ci/scripts/jni_macos_build.sh @@ -86,9 +86,17 @@ if [ ! -d "${absl_include_dir}/absl" ]; then exit 1 fi +# Protobuf 32+ headers include utf8_validity.h from the bundled utf8_range. +utf8_range_include_dir="${build_dir}/cpp/_deps/protobuf-src/third_party/utf8_range" +if [ ! -f "${utf8_range_include_dir}/utf8_validity.h" ]; then + echo "Bundled utf8_range headers were not found in ${utf8_range_include_dir}" >&2 + exit 1 +fi + JAVA_JNI_CMAKE_ARGS="-DProtobuf_ROOT=${build_dir}/cpp/_deps/protobuf-build" JAVA_JNI_CMAKE_ARGS+=" -DProtobuf_SRC_ROOT_FOLDER=${build_dir}/cpp/_deps/protobuf-src" JAVA_JNI_CMAKE_ARGS+=" -DARROW_JAVA_JNI_ABSL_INCLUDE_DIR=${absl_include_dir}" +JAVA_JNI_CMAKE_ARGS+=" -DARROW_JAVA_JNI_UTF8_RANGE_INCLUDE_DIR=${utf8_range_include_dir}" export JAVA_JNI_CMAKE_ARGS "${source_dir}/ci/scripts/jni_build.sh" \ "${source_dir}" \ diff --git a/gandiva/CMakeLists.txt b/gandiva/CMakeLists.txt index ca041c9fb1..0750547786 100644 --- a/gandiva/CMakeLists.txt +++ b/gandiva/CMakeLists.txt @@ -58,6 +58,10 @@ if(ARROW_JAVA_JNI_ABSL_INCLUDE_DIR) target_include_directories(arrow_java_jni_gandiva SYSTEM PRIVATE "${ARROW_JAVA_JNI_ABSL_INCLUDE_DIR}") endif() +if(ARROW_JAVA_JNI_UTF8_RANGE_INCLUDE_DIR) + target_include_directories(arrow_java_jni_gandiva SYSTEM + PRIVATE "${ARROW_JAVA_JNI_UTF8_RANGE_INCLUDE_DIR}") +endif() target_link_libraries(arrow_java_jni_gandiva arrow_java_jni_gandiva_headers jni From bb9f52c56c66347b921b45e6ddd8aaf27fc877a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?JB=20Onofr=C3=A9?= Date: Tue, 27 Oct 2026 06:07:03 +0100 Subject: [PATCH 2/2] Apply suggestion from @kou Co-authored-by: Sutou Kouhei --- ci/scripts/jni_macos_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/scripts/jni_macos_build.sh b/ci/scripts/jni_macos_build.sh index c28980f5bc..277987aa88 100755 --- a/ci/scripts/jni_macos_build.sh +++ b/ci/scripts/jni_macos_build.sh @@ -86,7 +86,7 @@ if [ ! -d "${absl_include_dir}/absl" ]; then exit 1 fi -# Protobuf 32+ headers include utf8_validity.h from the bundled utf8_range. +# Protobuf 33+ headers include utf8_validity.h from the bundled utf8_range. utf8_range_include_dir="${build_dir}/cpp/_deps/protobuf-src/third_party/utf8_range" if [ ! -f "${utf8_range_include_dir}/utf8_validity.h" ]; then echo "Bundled utf8_range headers were not found in ${utf8_range_include_dir}" >&2