Skip to content
Merged
124 changes: 124 additions & 0 deletions .github/workflows/cpp_extra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
26 changes: 26 additions & 0 deletions cpp/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Comment thread
Reranko05 marked this conversation as resolved.
"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"
}
}
]
}
4 changes: 4 additions & 0 deletions cpp/src/arrow/compute/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
7 changes: 5 additions & 2 deletions cpp/src/arrow/engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading