Skip to content

Commit f131879

Browse files
jbonofreclaude
andcommitted
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 <noreply@anthropic.com>
1 parent 62f28bb commit f131879

3 files changed

Lines changed: 16 additions & 0 deletions

File tree

‎CMakeLists.txt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ set(ARROW_JAVA_JNI_ABSL_INCLUDE_DIR
4141
""
4242
CACHE PATH "Path to Abseil source headers for the Gandiva JNI build")
4343
mark_as_advanced(ARROW_JAVA_JNI_ABSL_INCLUDE_DIR)
44+
set(ARROW_JAVA_JNI_UTF8_RANGE_INCLUDE_DIR
45+
""
46+
CACHE PATH "Path to utf8_range source headers for the Gandiva JNI build")
47+
mark_as_advanced(ARROW_JAVA_JNI_UTF8_RANGE_INCLUDE_DIR)
4448

4549
include(GNUInstallDirs)
4650

‎ci/scripts/jni_macos_build.sh‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,17 @@ if [ ! -d "${absl_include_dir}/absl" ]; then
8686
exit 1
8787
fi
8888

89+
# Protobuf 32+ headers include utf8_validity.h from the bundled utf8_range.
90+
utf8_range_include_dir="${build_dir}/cpp/_deps/protobuf-src/third_party/utf8_range"
91+
if [ ! -f "${utf8_range_include_dir}/utf8_validity.h" ]; then
92+
echo "Bundled utf8_range headers were not found in ${utf8_range_include_dir}" >&2
93+
exit 1
94+
fi
95+
8996
JAVA_JNI_CMAKE_ARGS="-DProtobuf_ROOT=${build_dir}/cpp/_deps/protobuf-build"
9097
JAVA_JNI_CMAKE_ARGS+=" -DProtobuf_SRC_ROOT_FOLDER=${build_dir}/cpp/_deps/protobuf-src"
9198
JAVA_JNI_CMAKE_ARGS+=" -DARROW_JAVA_JNI_ABSL_INCLUDE_DIR=${absl_include_dir}"
99+
JAVA_JNI_CMAKE_ARGS+=" -DARROW_JAVA_JNI_UTF8_RANGE_INCLUDE_DIR=${utf8_range_include_dir}"
92100
export JAVA_JNI_CMAKE_ARGS
93101
"${source_dir}/ci/scripts/jni_build.sh" \
94102
"${source_dir}" \

‎gandiva/CMakeLists.txt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ if(ARROW_JAVA_JNI_ABSL_INCLUDE_DIR)
5858
target_include_directories(arrow_java_jni_gandiva SYSTEM
5959
PRIVATE "${ARROW_JAVA_JNI_ABSL_INCLUDE_DIR}")
6060
endif()
61+
if(ARROW_JAVA_JNI_UTF8_RANGE_INCLUDE_DIR)
62+
target_include_directories(arrow_java_jni_gandiva SYSTEM
63+
PRIVATE "${ARROW_JAVA_JNI_UTF8_RANGE_INCLUDE_DIR}")
64+
endif()
6165
target_link_libraries(arrow_java_jni_gandiva
6266
arrow_java_jni_gandiva_headers
6367
jni

0 commit comments

Comments
 (0)