This is an automated email from the ASF dual-hosted git repository.
kou 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 5a0b57aac5d GH-50565: [CI][C++] Add a JNI Windows CI job (#50606)
5a0b57aac5d is described below
commit 5a0b57aac5d6953601cbf86e5094ea0781691a35
Author: Aaditya Srinivasan <[email protected]>
AuthorDate: Fri Jul 24 14:12:59 2026 +0530
GH-50565: [CI][C++] Add a JNI Windows CI job (#50606)
### Rationale
This adds a Windows CI job for the JNI build configuration, following the
existing Linux and macOS JNI CI jobs. The new job uses a dedicated CMake preset
to match the build options used by the Windows JNI build.
### What changes are included?
- Add a `ninja-release-jni-windows` CMake preset.
- Add a `jni-windows` job to `cpp_extra.yml`.
* GitHub Issue: #50565
Authored-by: Aaditya Srinivasan <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
---
.github/workflows/cpp_extra.yml | 124 +++++++++++++++++++++++++++++++++++
cpp/CMakePresets.json | 26 ++++++++
cpp/src/arrow/compute/CMakeLists.txt | 4 ++
cpp/src/arrow/engine/CMakeLists.txt | 7 +-
4 files changed, 159 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml
index 908d830b485..c384f5f0f7f 100644
--- a/.github/workflows/cpp_extra.yml
+++ b/.github/workflows/cpp_extra.yml
@@ -351,6 +351,130 @@ jobs:
path: ccache
key: jni-macos
+ jni-windows:
+ needs: check-enabled
+ if: needs.check-enabled.outputs.is_enabled == 'true'
+ name: JNI Windows
+ runs-on: windows-2022
+ timeout-minutes: 240
+
+ steps:
+ - name: Disable Crash Dialogs
+ run: |
+ reg add `
+ "HKCU\SOFTWARE\Microsoft\Windows\Windows Error Reporting" `
+ /v DontShowUI `
+ /t REG_DWORD `
+ /d 1 `
+ /f
+
+ - name: Checkout Arrow
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
+ fetch-depth: 0
+ submodules: recursive
+
+ - name: Install msys2 (for tzdata for ORC tests)
+ uses: msys2/setup-msys2@v2
+ id: setup-msys2
+
+ - name: Install cmake
+ shell: bash
+ run: |
+ ci/scripts/install_cmake.sh 4.1.2 /usr
+
+ - name: Install ccache
+ shell: bash
+ run: |
+ ci/scripts/install_ccache.sh 4.13.6 /usr
+
+ - name: Setup ccache
+ shell: bash
+ run: |
+ ci/scripts/ccache_setup.sh
+
+ - name: ccache info
+ id: ccache-info
+ shell: bash
+ run: |
+ echo "cache-dir=$(ccache --get-config cache_dir)" >> $GITHUB_OUTPUT
+
+ - name: Restore ccache
+ uses:
apache/infrastructure-actions/stash/restore@0ba14156c9f4c3cfbe4b0c9f36339ab0f8d81e53
+ with:
+ path: ${{ steps.ccache-info.outputs.cache-dir }}
+ key: jni-windows
+
+ - name: CMake
+ shell: cmd
+ run: |
+ call "C:\Program Files\Microsoft Visual
Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
+ cmake ^
+ -S cpp ^
+ -B cpp.build ^
+ --preset=ninja-release-jni-windows ^
+ -DARROW_BUILD_TESTS=ON ^
+ -DCMAKE_INSTALL_PREFIX=%CD%\cpp.install
+
+ - name: Build
+ shell: cmd
+ run: |
+ call "C:\Program Files\Microsoft Visual
Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
+ cmake --build cpp.build
+
+ - name: Install
+ shell: cmd
+ run: |
+ call "C:\Program Files\Microsoft Visual
Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
+ cmake --install cpp.build
+
+ - name: Test
+ shell: cmd
+ env:
+ MSYS2_LOCATION: ${{ steps.setup-msys2.outputs.msys2-location }}
+ ARROW_TEST_DATA: ${{ github.workspace }}\testing\data
+ PARQUET_TEST_DATA: ${{ github.workspace
}}\cpp\submodules\parquet-testing\data
+ run: |
+ call "C:\Program Files\Microsoft Visual
Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
+ set TZDIR=%MSYS2_LOCATION%\usr\share\zoneinfo
+
+ set exclude_tests=arrow-acero-asof-join-node-test
+ set exclude_tests=%exclude_tests%^|arrow-acero-hash-join-node-test
+
+ ctest ^
+ --exclude-regex "%exclude_tests%" ^
+ --label-regex unittest ^
+ --output-on-failure ^
+ --parallel %NUMBER_OF_PROCESSORS% ^
+ --test-dir cpp.build ^
+ --timeout 300
+
+ - name: Build example
+ shell: cmd
+ run: |
+ call "C:\Program Files\Microsoft Visual
Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
+
+ cmake ^
+ -S cpp/examples/minimal_build ^
+ -B cpp/examples/minimal_build.build ^
+ -GNinja ^
+ -DCMAKE_BUILD_TYPE=Release ^
+ -DCMAKE_INSTALL_PREFIX=%CD%\cpp.install
+
+ cmake --build cpp/examples/minimal_build.build
+
+ cd cpp\examples\minimal_build
+ call ..\minimal_build.build\arrow-example.exe
+
+ - name: Save ccache
+ if: ${{ !cancelled() }}
+ continue-on-error: true
+ uses:
apache/infrastructure-actions/stash/save@0ba14156c9f4c3cfbe4b0c9f36339ab0f8d81e53
+ with:
+ path: ${{ steps.ccache-info.outputs.cache-dir }}
+ key: jni-windows
+
odbc-linux:
needs: check-enabled
if: needs.check-enabled.outputs.is_enabled == 'true'
diff --git a/cpp/CMakePresets.json b/cpp/CMakePresets.json
index 17f6317e17e..2780d19c6ee 100644
--- a/cpp/CMakePresets.json
+++ b/cpp/CMakePresets.json
@@ -681,6 +681,32 @@
"PARQUET_REQUIRE_ENCRYPTION": "OFF",
"re2_SOURCE": "BUNDLED"
}
+ },
+ {
+ "name": "ninja-release-jni-windows",
+ "inherits": [
+ "base-release"
+ ],
+ "displayName": "Build for JNI on Windows",
+ "cacheVariables": {
+ "ARROW_ACERO": "ON",
+ "ARROW_BUILD_SHARED": "OFF",
+ "ARROW_BUILD_STATIC": "ON",
+ "ARROW_CSV": "ON",
+ "ARROW_DATASET": "ON",
+ "ARROW_DEPENDENCY_USE_SHARED": "OFF",
+ "ARROW_ORC": "ON",
+ "ARROW_PARQUET": "ON",
+ "ARROW_S3": "ON",
+ "ARROW_SUBSTRAIT": "ON",
+ "ARROW_WITH_BROTLI": "ON",
+ "ARROW_WITH_LZ4": "ON",
+ "ARROW_WITH_SNAPPY": "ON",
+ "ARROW_WITH_ZSTD": "ON",
+ "PARQUET_BUILD_EXAMPLES": "OFF",
+ "PARQUET_BUILD_EXECUTABLES": "OFF",
+ "PARQUET_REQUIRE_ENCRYPTION": "OFF"
+ }
}
]
}
diff --git a/cpp/src/arrow/compute/CMakeLists.txt
b/cpp/src/arrow/compute/CMakeLists.txt
index e965b89ec05..88f9ae90064 100644
--- a/cpp/src/arrow/compute/CMakeLists.txt
+++ b/cpp/src/arrow/compute/CMakeLists.txt
@@ -46,6 +46,10 @@ if(ARROW_TESTING AND ARROW_COMPUTE)
target_link_libraries(arrow_compute_testing
PUBLIC $<TARGET_OBJECTS:arrow_compute_core_testing>
PUBLIC ${ARROW_GTEST_GTEST})
+ if(ARROW_BUILD_STATIC AND WIN32)
+ target_compile_definitions(arrow_compute_testing PUBLIC
ARROW_COMPUTE_STATIC
+ ARROW_STATIC)
+ endif()
endif()
set(ARROW_COMPUTE_TEST_PREFIX "arrow-compute")
diff --git a/cpp/src/arrow/engine/CMakeLists.txt
b/cpp/src/arrow/engine/CMakeLists.txt
index adf98087ad1..dbb5d7e95ab 100644
--- a/cpp/src/arrow/engine/CMakeLists.txt
+++ b/cpp/src/arrow/engine/CMakeLists.txt
@@ -70,10 +70,13 @@ foreach(LIB_TARGET ${ARROW_SUBSTRAIT_LIBRARIES})
target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_ENGINE_EXPORTING)
endforeach()
+if(ARROW_BUILD_STATIC AND WIN32)
+ target_compile_definitions(arrow_substrait_static PUBLIC ARROW_ENGINE_STATIC)
+endif()
+
set(ARROW_SUBSTRAIT_TEST_LINK_LIBS ${ARROW_SUBSTRAIT_LINK_lIBS}
${ARROW_TEST_LINK_LIBS})
if(ARROW_TEST_LINKAGE STREQUAL "static")
- list(APPEND ARROW_SUBSTRAIT_TEST_LINK_LIBS arrow_substrait_static
- arrow_substrait_static)
+ list(APPEND ARROW_SUBSTRAIT_TEST_LINK_LIBS arrow_substrait_static)
else()
list(APPEND ARROW_SUBSTRAIT_TEST_LINK_LIBS arrow_substrait_shared)
endif()