Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 4.3k
GH-47632: [CI][C++] Add a CI job for JNI on Linux#47746
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
d17eec833febe56388be4b7eaa97651e4f22e2408fe19f5dd6cd6fe519994522186d472ec5f605748fa3dcbcbf7b8ec827d7e89a09656683ef3327e48dac5dd8fa54f177d0c73f30e630321c0c45df0cbFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
| ARG base | ||
| FROM ${base} | ||
| ARG arch | ||
| ARG arch_short | ||
| SHELL ["/bin/bash", "-i", "-c"] | ||
| ENTRYPOINT ["/bin/bash", "-i", "-c"] | ||
| # Install basic dependencies | ||
| RUN dnf install -y \ | ||
| autoconf \ | ||
| curl \ | ||
| flex \ | ||
| gdb \ | ||
| git \ | ||
| perl-IPC-Cmd \ | ||
| wget \ | ||
| zip | ||
| # A system Python is required for Ninja and vcpkg in this Dockerfile. | ||
| # On manylinux_2_28 base images, no system Python is installed. | ||
| # We therefore override the PATH with Python 3.10 in /opt/python | ||
| # so that we have a consistent Python version across base images. | ||
| ENV CPYTHON_VERSION=cp310 | ||
| ENV PATH=/opt/python/${CPYTHON_VERSION}-${CPYTHON_VERSION}/bin:${PATH} | ||
| # Install CMake | ||
| ARG cmake=3.29.2 | ||
| COPY ci/scripts/install_cmake.sh arrow/ci/scripts/ | ||
| RUN /arrow/ci/scripts/install_cmake.sh ${cmake} /usr/local | ||
| # Install Ninja | ||
| ARG ninja=1.10.2 | ||
| COPY ci/scripts/install_ninja.sh arrow/ci/scripts/ | ||
| RUN /arrow/ci/scripts/install_ninja.sh ${ninja} /usr/local | ||
| # Install ccache | ||
| ARG ccache=4.1 | ||
| COPY ci/scripts/install_ccache.sh arrow/ci/scripts/ | ||
| RUN /arrow/ci/scripts/install_ccache.sh ${ccache} /usr/local | ||
| # Install vcpkg | ||
| ARG vcpkg | ||
| COPY ci/vcpkg/*.patch \ | ||
| ci/vcpkg/*linux*.cmake \ | ||
| ci/vcpkg/vcpkg.json \ | ||
| arrow/ci/vcpkg/ | ||
| COPY ci/scripts/install_vcpkg.sh \ | ||
| arrow/ci/scripts/ | ||
| ENV VCPKG_ROOT=/opt/vcpkg | ||
| ARG build_type=release | ||
| ENV CMAKE_BUILD_TYPE=${build_type} \ | ||
| PATH="${PATH}:${VCPKG_ROOT}" \ | ||
| VCPKG_DEFAULT_TRIPLET=${arch_short}-linux-static-${build_type} \ | ||
| VCPKG_FEATURE_FLAGS="manifests" \ | ||
| VCPKG_FORCE_SYSTEM_BINARIES=1 \ | ||
| VCPKG_OVERLAY_TRIPLETS=/arrow/ci/vcpkg | ||
| # For --mount=type=secret: The GITHUB_TOKEN is the only real secret but we use | ||
| # --mount=type=secret for GITHUB_REPOSITORY_OWNER and | ||
| # VCPKG_BINARY_SOURCES too because we don't want to store them | ||
| # into the built image in order to easily reuse the built image cache. | ||
| # | ||
| # For vcpkg install: cannot use the S3 feature here because while | ||
| # aws-sdk-cpp=1.9.160 contains ssl related fixes as well as we can | ||
| # patch the vcpkg portfile to support arm machines it hits ARROW-15141 | ||
| # where we would need to fall back to 1.8.186 but we cannot patch | ||
| # those portfiles since vcpkg-tool handles the checkout of previous | ||
| # versions => use bundled S3 build | ||
| RUN --mount=type=secret,id=github_repository_owner \ | ||
| --mount=type=secret,id=github_token \ | ||
| --mount=type=secret,id=vcpkg_binary_sources \ | ||
| export GITHUB_REPOSITORY_OWNER=$(cat /run/secrets/github_repository_owner); \ | ||
| export GITHUB_TOKEN=$(cat /run/secrets/github_token); \ | ||
| export VCPKG_BINARY_SOURCES=$(cat /run/secrets/vcpkg_binary_sources); \ | ||
| arrow/ci/scripts/install_vcpkg.sh ${VCPKG_ROOT} ${vcpkg} && \ | ||
| vcpkg install \ | ||
| --clean-after-build \ | ||
| --x-install-root=${VCPKG_ROOT}/installed \ | ||
| --x-manifest-root=/arrow/ci/vcpkg \ | ||
| --x-feature=azure \ | ||
| --x-feature=dev \ | ||
| --x-feature=flight \ | ||
| --x-feature=gandiva \ | ||
| --x-feature=gcs \ | ||
| --x-feature=json \ | ||
| --x-feature=orc \ | ||
| --x-feature=parquet \ | ||
| --x-feature=s3 && \ | ||
| rm -rf ~/.config/NuGet/ | ||
| ENV ARROW_BUILD_TESTS=ON \ | ||
| ARROW_CMAKE_ARGS="-DARROW_BUILD_TESTS=ON" \ | ||
| CMAKE_PRESET=ninja-${CMAKE_BUILD_TYPE}-jni-linux |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -174,6 +174,11 @@ elif [ "${ARROW_EMSCRIPTEN:-OFF}" = "ON" ]; then | ||
| -DCMAKE_UNITY_BUILD=${CMAKE_UNITY_BUILD:-OFF} \ | ||
| ${ARROW_CMAKE_ARGS} \ | ||
| ${source_dir} | ||
| elif [ -n "${CMAKE_PRESET}" ]; then | ||
| cmake \ | ||
| --preset="${CMAKE_PRESET}" \ | ||
| ${ARROW_CMAKE_ARGS} \ | ||
| ${source_dir} | ||
| else | ||
| cmake \ | ||
| -Dabsl_SOURCE=${absl_SOURCE:-} \ | ||
| @@ -308,10 +313,14 @@ fi | ||
| popd | ||
| if [ -x "$(command -v ldconfig)" ]; then | ||
| if [ -x "$(command -v sudo)" ]; then | ||
| SUDO=sudo | ||
| else | ||
| if [ "$(id --user)" -eq 0 ]; then | ||
MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need to use manylinux image doesn't provide | ||
| SUDO= | ||
| else | ||
| if [ -x "$(command -v sudo)" ]; then | ||
| SUDO=sudo | ||
| else | ||
| SUDO= | ||
| fi | ||
| fi | ||
| ${SUDO} ldconfig ${ARROW_HOME}/${CMAKE_INSTALL_LIBDIR:-lib} | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -47,6 +47,12 @@ ctest_options=() | ||
| if ! type azurite >/dev/null 2>&1; then | ||
| exclude_tests+=("arrow-azurefs-test") | ||
| fi | ||
| if ! type storage-testbench >/dev/null 2>&1; then | ||
| exclude_tests+=("arrow-gcsfs-test") | ||
| fi | ||
| if ! type minio >/dev/null 2>&1; then | ||
| exclude_tests+=("arrow-s3fs-test") | ||
| fi | ||
Comment on lines
+50
to
+55
MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They don't exist in manylinux image. | ||
| case "$(uname)" in | ||
| Linux) | ||
| n_jobs=$(nproc) | ||
| @@ -114,6 +120,41 @@ else | ||
| "$@" | ||
| fi | ||
| # This is for testing find_package(Arrow). | ||
| # | ||
| # Note that this is not a perfect solution. We should improve this | ||
| # later. | ||
Comment on lines
+123
to
+126
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems that this new check is breaking some C++ builds (CUDA, Thread Sanitizer). @kou MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, sorry. I missed these failures: #47840 | ||
| # | ||
| # * This is ad-hoc | ||
| # * This doesn't test other CMake packages such as ArrowDataset | ||
| if [ "${ARROW_USE_MESON:-OFF}" = "OFF" ] && \ | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Who are these additions related to JNI? MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is for testing I'll add a comment for this part. | ||
| [ "${ARROW_EMSCRIPTEN:-OFF}" = "OFF" ] && \ | ||
| [ "${ARROW_USE_ASAN:-OFF}" = "OFF" ]; then | ||
| CMAKE_PREFIX_PATH="${CMAKE_INSTALL_PREFIX:-${ARROW_HOME}}" | ||
| case "$(uname)" in | ||
| MINGW*) | ||
| # <prefix>/lib/cmake/ isn't searched on Windows. | ||
| # | ||
| # See also: | ||
| # https://cmake.org/cmake/help/latest/command/find_package.html#config-mode-search-procedure | ||
| CMAKE_PREFIX_PATH+="/lib/cmake/" | ||
| ;; | ||
| esac | ||
| if [ -n "${VCPKG_ROOT}" ] && [ -n "${VCPKG_DEFAULT_TRIPLET}" ]; then | ||
| CMAKE_PREFIX_PATH+=";${VCPKG_ROOT}/installed/${VCPKG_DEFAULT_TRIPLET}" | ||
| fi | ||
| cmake \ | ||
| -S "${source_dir}/examples/minimal_build" \ | ||
| -B "${build_dir}/examples/minimal_build" \ | ||
| -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" | ||
| cmake --build "${build_dir}/examples/minimal_build" | ||
| pushd "${source_dir}/examples/minimal_build" | ||
| # PATH= is for Windows. | ||
| PATH="${CMAKE_INSTALL_PREFIX:-${ARROW_HOME}}/bin:${PATH}" \ | ||
| "${build_dir}/examples/minimal_build/arrow-example" | ||
| popd | ||
| fi | ||
| if [ "${ARROW_BUILD_EXAMPLES}" == "ON" ]; then | ||
| examples=$(find "${binary_output_dir}" -executable -name "*example") | ||
| if [ "${examples}" == "" ]; then | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -19,6 +19,7 @@ | ||
| "re2", | ||
| "snappy", | ||
| "utf8proc", | ||
| "xsimd", | ||
MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
| "zlib", | ||
| "zstd", | ||
| { | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -582,6 +582,37 @@ | ||
| "displayName": "Benchmarking build with everything enabled", | ||
| "cacheVariables": {} | ||
| }, | ||
| { | ||
| "name": "ninja-release-jni-linux", | ||
| "inherits": [ | ||
| "base-release" | ||
| ], | ||
| "displayName": "Build for JNI on Linux", | ||
| "cacheVariables": { | ||
| "ARROW_ACERO": "ON", | ||
| "ARROW_BUILD_SHARED": "OFF", | ||
| "ARROW_BUILD_STATIC": "ON", | ||
Comment on lines
+593
to
+594
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm surprised, wouldn't we want shared libs with JNI? MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm. Shared libraries will not work. Or we need to set Python wheels use shared libraries because one "pyarrow" package includes all modules such as compute and dataset. So Python wheels can find If we use shared libraries in JNI, arrow-dataset needs to find If we split pyarrow to pyarrow-core, pyarrow-dataset, ... or something, Python wheels may face the same problem. #22300 may be related. | ||
| "ARROW_CSV": "ON", | ||
| "ARROW_DATASET": "ON", | ||
| "ARROW_DEPENDENCY_SOURCE": "VCPKG", | ||
| "ARROW_DEPENDENCY_USE_SHARED": "OFF", | ||
| "ARROW_GANDIVA": "ON", | ||
| "ARROW_GANDIVA_STATIC_LIBSTDCPP": "ON", | ||
| "ARROW_GCS": "ON", | ||
| "ARROW_JSON": "ON", | ||
| "ARROW_ORC": "ON", | ||
| "ARROW_PARQUET": "ON", | ||
| "ARROW_RPATH_ORIGIN": "ON", | ||
| "ARROW_S3": "ON", | ||
| "ARROW_SUBSTRAIT": "ON", | ||
| "PARQUET_BUILD_EXAMPLES": "OFF", | ||
| "PARQUET_BUILD_EXECUTABLES": "OFF", | ||
| "PARQUET_REQUIRE_ENCRYPTION": "OFF", | ||
| "VCPKG_MANIFEST_MODE": "OFF", | ||
| "VCPKG_ROOT": "$env{VCPKG_ROOT}", | ||
| "VCPKG_TARGET_TRIPLET": "$env{VCPKG_TARGET_TRIPLET}" | ||
| } | ||
| }, | ||
| { | ||
| "name": "ninja-release-jni-macos", | ||
| "inherits": [ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -176,7 +176,7 @@ class Process::Impl { | ||
| for (const auto& kv : process::environment::current()) { | ||
| env[kv.key()] = process::environment::value(kv.value()); | ||
| } | ||
| env["PATH"] = process::environment::value(current_exe.parent_path()); | ||
| env["PATH"] = process::environment::value(current_exe.parent_path().string()); | ||
MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Recent Boost or old g++ (12.2.1) don't accept We need to convert | ||
| executable_ = process::environment::find_executable(name, env); | ||
| # else | ||
| executable_ = process::search_path(name, {current_exe.parent_path()}); | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to provide preset for JNI build to share build options in apache/arrow and apache/arrow-java.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not pass
--presetto the existingcmakecall below?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we use it, all variables by
--presetare overridden because it specify most variables explicitly. Explicit variables are used instead of variables set by--preset.