diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index 7755818f9e48..0161b04a98bc 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -90,403 +90,404 @@ jobs: contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++') run: echo "is_enabled=true" >> "$GITHUB_OUTPUT" - docker: - needs: check-enabled - if: needs.check-enabled.outputs.is_enabled == 'true' - name: ${{ matrix.title }} - runs-on: ${{ matrix.runs-on }} - timeout-minutes: 75 - strategy: - fail-fast: false - matrix: - include: - - image: alpine-linux-cpp - runs-on: ubuntu-latest - title: AMD64 Alpine Linux - - image: ubuntu-cpp - run-options: >- - -e ARROW_CTEST_TIMEOUT=2000 - -e ARROW_C_FLAGS_DEBUG="-O1" - -e ARROW_CXX_FLAGS_DEBUG="-O1" - -e ARROW_GANDIVA=OFF - -e ARROW_LARGE_MEMORY_TESTS=ON - -e BUILD_WARNING_LEVEL=PRODUCTION - runs-on: "runs-on=${{ github.run_id }}/family=x8i.2xlarge/volume=80gb/spot=capacity-optimized" - title: AMD64 Ubuntu Large Memory Tests - - image: ubuntu-cpp-bundled-offline - runs-on: ubuntu-latest - envs: - - UBUNTU=24.04 - title: AMD64 Ubuntu Bundled Offline - - image: conda-cpp - run-options: >- - -e ARROW_USE_MESON=ON - runs-on: ubuntu-latest - title: AMD64 Ubuntu Meson - # TODO: We should remove this "continue-on-error: true" once GH-47207 is resolved - - continue-on-error: true - envs: - - DEBIAN=13 - image: debian-cpp - run-options: >- - -e CMAKE_CXX_STANDARD=23 - runs-on: ubuntu-latest - title: AMD64 Debian C++23 - - image: debian-cpp - run-options: >- - -e ARROW_SIMD_LEVEL=NONE - -e ARROW_CXXFLAGS=-march=x86-64 - runs-on: ubuntu-latest - title: AMD64 Debian SIMD Level NONE - steps: - - name: Checkout Arrow - uses: actions/checkout@v7 - with: - persist-credentials: false - fetch-depth: 0 - submodules: recursive - - name: Restore Docker Volumes - uses: apache/infrastructure-actions/stash/restore@b41ca1cbe4d8a214dea50788a0e037184a69ad3f - with: - path: .docker - key: cpp-extra-${{ matrix.image }} - - name: Setup Python - uses: actions/setup-python@v7 - with: - python-version: 3 - - name: Setup Archery - run: python3 -m pip install -e dev/archery[docker] - - name: Execute Docker Build - continue-on-error: ${{ matrix.continue-on-error || false }} - env: - ARCHERY_DOCKER_USER: ${{ secrets.DOCKERHUB_USER }} - ARCHERY_DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} - ENVS: ${{ toJSON(matrix.envs) }} - run: | - # GH-40558: reduce ASLR to avoid ASAN/LSAN crashes - sudo sysctl -w vm.mmap_rnd_bits=28 - source ci/scripts/util_enable_core_dumps.sh - if [ "${ENVS}" != "null" ]; then - echo "${ENVS}" | jq -r '.[]' | while read env; do - echo "${env}" >> .env - done - fi - archery docker run ${{ matrix.run-options || '' }} ${{ matrix.image }} - - name: Save Docker Volumes - if: ${{ !cancelled() }} - continue-on-error: true - uses: apache/infrastructure-actions/stash/save@b41ca1cbe4d8a214dea50788a0e037184a69ad3f - with: - path: .docker - key: cpp-extra-${{ matrix.image }} - include-hidden-files: true - - name: Docker Push - if: >- - success() && github.event_name == 'schedule' - env: - ARCHERY_DOCKER_USER: ${{ secrets.DOCKERHUB_USER }} - ARCHERY_DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} - continue-on-error: true - run: archery docker push ${{ matrix.image }} - - msvc-arm64: - needs: check-enabled - if: needs.check-enabled.outputs.is_enabled == 'true' - name: ARM64 Windows 11 MSVC - uses: ./.github/workflows/cpp_windows.yml - with: - arch: arm64 - os: windows-11-arm - simd-level: NONE - - jni-linux: - needs: check-enabled - if: needs.check-enabled.outputs.is_enabled == 'true' - name: JNI ${{ matrix.platform.runs-on }} ${{ matrix.platform.arch }} - runs-on: ${{ matrix.platform.runs-on }} - timeout-minutes: 240 - permissions: - actions: read - contents: read - # This is for using GitHub Packages for vcpkg cache - packages: write - strategy: - fail-fast: false - matrix: - platform: - - arch: "amd64" - runs-on: ubuntu-latest - - arch: "arm64/v8" - runs-on: ubuntu-24.04-arm - env: - ARCH: ${{ matrix.platform.arch }} - REPO: ghcr.io/${{ github.repository }}-dev - steps: - - name: Checkout Arrow - uses: actions/checkout@v7 - with: - persist-credentials: false - fetch-depth: 0 - submodules: recursive - - name: Free up disk space - run: | - ci/scripts/util_free_space.sh - - name: Restore Docker Volumes - uses: apache/infrastructure-actions/stash/restore@b41ca1cbe4d8a214dea50788a0e037184a69ad3f - with: - path: .docker - key: jni-${{ matrix.platform.runs-on }} - - name: Setup Python - uses: actions/setup-python@v7 - with: - python-version: 3 - - name: Setup Archery - run: python3 -m pip install -e dev/archery[docker] - - name: Execute Docker Build - env: - ARCHERY_DOCKER_USER: ${{ github.actor }} - ARCHERY_DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,readwrite" - run: | - source ci/scripts/util_enable_core_dumps.sh - archery docker run cpp-jni - - name: Save Docker Volumes - if: ${{ !cancelled() }} - continue-on-error: true - uses: apache/infrastructure-actions/stash/save@b41ca1cbe4d8a214dea50788a0e037184a69ad3f - with: - path: .docker - key: jni-${{ matrix.platform.runs-on }} - include-hidden-files: true - - name: Docker Push - if: >- - success() && github.event_name == 'schedule' - env: - ARCHERY_DOCKER_USER: ${{ github.actor }} - ARCHERY_DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }} - continue-on-error: true - run: archery docker push cpp-jni - - jni-macos: - needs: check-enabled - if: needs.check-enabled.outputs.is_enabled == 'true' - name: JNI macOS - runs-on: macos-26 - timeout-minutes: 60 - env: - MACOSX_DEPLOYMENT_TARGET: "14.0" - steps: - - name: Checkout Arrow - uses: actions/checkout@v7 - with: - persist-credentials: false - fetch-depth: 0 - submodules: recursive - - name: Install dependencies - run: | - brew bundle --file=cpp/Brewfile - # We want to link aws-sdk-cpp statically but Homebrew's - # aws-sdk-cpp provides only shared library. If we have - # Homebrew's aws-sdk-cpp, our build mix Homebrew's - # aws-sdk-cpp and bundled aws-sdk-cpp. We uninstall Homebrew's - # aws-sdk-cpp to ensure using only bundled aws-sdk-cpp. - brew uninstall aws-sdk-cpp - # We want to use bundled RE2 for static linking. If - # Homebrew's RE2 is installed, its header file may be used. - # We uninstall Homebrew's RE2 to ensure using bundled RE2. - brew uninstall grpc || : # gRPC depends on RE2 - brew uninstall grpc@1.54 || : # gRPC 1.54 may be installed too - brew uninstall re2 - # We want to use bundled Protobuf for static linking. If - # Homebrew's Protobuf is installed, its library file may be - # used on test We uninstall Homebrew's Protobuf to ensure using - # bundled Protobuf. - brew uninstall protobuf - - name: Prepare ccache - run: | - echo "CCACHE_DIR=${PWD}/ccache" >> ${GITHUB_ENV} - - name: Restore ccache - uses: apache/infrastructure-actions/stash/restore@b41ca1cbe4d8a214dea50788a0e037184a69ad3f - with: - path: ccache - key: jni-macos - - name: CMake - run: | - cmake \ - -S cpp \ - -B cpp.build \ - --preset=ninja-release-jni-macos \ - -DARROW_BUILD_TESTS=ON \ - -DCMAKE_INSTALL_PREFIX=$PWD/cpp.install - - name: Build - run: | - cmake --build cpp.build - - name: Install - run: | - cmake --install cpp.build - - name: Test - env: - ARROW_TEST_DATA: ${{ github.workspace }}/testing/data - PARQUET_TEST_DATA: ${{ github.workspace }}/cpp/submodules/parquet-testing/data - run: | - # unstable - exclude_tests="arrow-acero-asof-join-node-test" - exclude_tests="${exclude_tests}|arrow-acero-hash-join-node-test" - ctest \ - --exclude-regex "${exclude_tests}" \ - --label-regex unittest \ - --output-on-failure \ - --parallel "$(sysctl -n hw.ncpu)" \ - --test-dir "cpp.build" \ - --timeout 300 - - name: Build example - run: | - cmake \ - -S cpp/examples/minimal_build/ \ - -B cpp/examples/minimal_build.build \ - -GNinja \ - -DCMAKE_INSTALL_PREFIX=$PWD/cpp.install - cmake --build cpp/examples/minimal_build.build - cd cpp/examples/minimal_build - ../minimal_build.build/arrow-example - - name: Save ccache - if: ${{ !cancelled() }} - continue-on-error: true - uses: apache/infrastructure-actions/stash/save@b41ca1cbe4d8a214dea50788a0e037184a69ad3f - with: - 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@b41ca1cbe4d8a214dea50788a0e037184a69ad3f - with: - path: ${{ steps.ccache-info.outputs.cache-dir }} - key: jni-windows - - - name: Find Visual Studio - shell: pwsh - run: | - "VS_INSTALL_PATH=$(vswhere -latest -property installationPath)" >> $env:GITHUB_ENV - - - name: CMake - shell: cmd - run: | - call "%VS_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 || exit /b 1 - 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 "%VS_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 || exit /b 1 - cmake --build cpp.build - - - name: Install - shell: cmd - run: | - call "%VS_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 || exit /b 1 - 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 "%VS_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 || exit /b 1 - 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 "%VS_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 || exit /b 1 - - 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@b41ca1cbe4d8a214dea50788a0e037184a69ad3f - with: - path: ${{ steps.ccache-info.outputs.cache-dir }} - key: jni-windows - +# docker: +# needs: check-enabled +# if: needs.check-enabled.outputs.is_enabled == 'true' +# name: ${{ matrix.title }} +# runs-on: ${{ matrix.runs-on }} +# timeout-minutes: 75 +# strategy: +# fail-fast: false +# matrix: +# include: +# - image: alpine-linux-cpp +# runs-on: ubuntu-latest +# title: AMD64 Alpine Linux +# - image: ubuntu-cpp +# run-options: >- +# -e ARROW_CTEST_TIMEOUT=2000 +# -e ARROW_C_FLAGS_DEBUG="-O1" +# -e ARROW_CXX_FLAGS_DEBUG="-O1" +# -e ARROW_GANDIVA=OFF +# -e ARROW_LARGE_MEMORY_TESTS=ON +# -e BUILD_WARNING_LEVEL=PRODUCTION +# runs-on: "runs-on=${{ github.run_id }}/family=x8i.2xlarge/volume=80gb/spot=capacity-optimized" +# title: AMD64 Ubuntu Large Memory Tests +# - image: ubuntu-cpp-bundled-offline +# runs-on: ubuntu-latest +# envs: +# - UBUNTU=24.04 +# title: AMD64 Ubuntu Bundled Offline +# - image: conda-cpp +# run-options: >- +# -e ARROW_USE_MESON=ON +# runs-on: ubuntu-latest +# title: AMD64 Ubuntu Meson +# # TODO: We should remove this "continue-on-error: true" once GH-47207 is resolved +# - continue-on-error: true +# envs: +# - DEBIAN=13 +# image: debian-cpp +# run-options: >- +# -e CMAKE_CXX_STANDARD=23 +# runs-on: ubuntu-latest +# title: AMD64 Debian C++23 +# - image: debian-cpp +# run-options: >- +# -e ARROW_SIMD_LEVEL=NONE +# -e ARROW_CXXFLAGS=-march=x86-64 +# runs-on: ubuntu-latest +# title: AMD64 Debian SIMD Level NONE +# steps: +# - name: Checkout Arrow +# uses: actions/checkout@v7 +# with: +# persist-credentials: false +# fetch-depth: 0 +# submodules: recursive +# - name: Restore Docker Volumes +# uses: apache/infrastructure-actions/stash/restore@b41ca1cbe4d8a214dea50788a0e037184a69ad3f +# with: +# path: .docker +# key: cpp-extra-${{ matrix.image }} +# - name: Setup Python +# uses: actions/setup-python@v7 +# with: +# python-version: 3 +# - name: Setup Archery +# run: python3 -m pip install -e dev/archery[docker] +# - name: Execute Docker Build +# continue-on-error: ${{ matrix.continue-on-error || false }} +# env: +# ARCHERY_DOCKER_USER: ${{ secrets.DOCKERHUB_USER }} +# ARCHERY_DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} +# ENVS: ${{ toJSON(matrix.envs) }} +# run: | +# # GH-40558: reduce ASLR to avoid ASAN/LSAN crashes +# sudo sysctl -w vm.mmap_rnd_bits=28 +# source ci/scripts/util_enable_core_dumps.sh +# if [ "${ENVS}" != "null" ]; then +# echo "${ENVS}" | jq -r '.[]' | while read env; do +# echo "${env}" >> .env +# done +# fi +# archery docker run ${{ matrix.run-options || '' }} ${{ matrix.image }} +# - name: Save Docker Volumes +# if: ${{ !cancelled() }} +# continue-on-error: true +# uses: apache/infrastructure-actions/stash/save@b41ca1cbe4d8a214dea50788a0e037184a69ad3f +# with: +# path: .docker +# key: cpp-extra-${{ matrix.image }} +# include-hidden-files: true +# - name: Docker Push +# if: >- +# success() && github.event_name == 'schedule' +# env: +# ARCHERY_DOCKER_USER: ${{ secrets.DOCKERHUB_USER }} +# ARCHERY_DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} +# continue-on-error: true +# run: archery docker push ${{ matrix.image }} + +# msvc-arm64: +# needs: check-enabled +# if: needs.check-enabled.outputs.is_enabled == 'true' +# name: ARM64 Windows 11 MSVC +# uses: ./.github/workflows/cpp_windows.yml +# with: +# arch: arm64 +# os: windows-11-arm +# simd-level: NONE + +# jni-linux: +# needs: check-enabled +# if: needs.check-enabled.outputs.is_enabled == 'true' +# name: JNI ${{ matrix.platform.runs-on }} ${{ matrix.platform.arch }} +# runs-on: ${{ matrix.platform.runs-on }} +# timeout-minutes: 240 +# permissions: +# actions: read +# contents: read +# # This is for using GitHub Packages for vcpkg cache +# packages: write +# strategy: +# fail-fast: false +# matrix: +# platform: +# - arch: "amd64" +# runs-on: ubuntu-latest +# - arch: "arm64/v8" +# runs-on: ubuntu-24.04-arm +# env: +# ARCH: ${{ matrix.platform.arch }} +# REPO: ghcr.io/${{ github.repository }}-dev +# steps: +# - name: Checkout Arrow +# uses: actions/checkout@v7 +# with: +# persist-credentials: false +# fetch-depth: 0 +# submodules: recursive +# - name: Free up disk space +# run: | +# ci/scripts/util_free_space.sh +# - name: Restore Docker Volumes +# uses: apache/infrastructure-actions/stash/restore@b41ca1cbe4d8a214dea50788a0e037184a69ad3f +# with: +# path: .docker +# key: jni-${{ matrix.platform.runs-on }} +# - name: Setup Python +# uses: actions/setup-python@v7 +# with: +# python-version: 3 +# - name: Setup Archery +# run: python3 -m pip install -e dev/archery[docker] +# - name: Execute Docker Build +# env: +# ARCHERY_DOCKER_USER: ${{ github.actor }} +# ARCHERY_DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }} +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,readwrite" +# run: | +# source ci/scripts/util_enable_core_dumps.sh +# archery docker run cpp-jni +# - name: Save Docker Volumes +# if: ${{ !cancelled() }} +# continue-on-error: true +# uses: apache/infrastructure-actions/stash/save@b41ca1cbe4d8a214dea50788a0e037184a69ad3f +# with: +# path: .docker +# key: jni-${{ matrix.platform.runs-on }} +# include-hidden-files: true +# - name: Docker Push +# if: >- +# success() && github.event_name == 'schedule' +# env: +# ARCHERY_DOCKER_USER: ${{ github.actor }} +# ARCHERY_DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }} +# continue-on-error: true +# run: archery docker push cpp-jni + +# jni-macos: +# needs: check-enabled +# if: needs.check-enabled.outputs.is_enabled == 'true' +# name: JNI macOS +# runs-on: macos-26 +# timeout-minutes: 60 +# env: +# MACOSX_DEPLOYMENT_TARGET: "14.0" +# steps: +# - name: Checkout Arrow +# uses: actions/checkout@v7 +# with: +# persist-credentials: false +# fetch-depth: 0 +# submodules: recursive +# - name: Install dependencies +# run: | +# brew bundle --file=cpp/Brewfile +# # We want to link aws-sdk-cpp statically but Homebrew's +# # aws-sdk-cpp provides only shared library. If we have +# # Homebrew's aws-sdk-cpp, our build mix Homebrew's +# # aws-sdk-cpp and bundled aws-sdk-cpp. We uninstall Homebrew's +# # aws-sdk-cpp to ensure using only bundled aws-sdk-cpp. +# brew uninstall aws-sdk-cpp +# # We want to use bundled RE2 for static linking. If +# # Homebrew's RE2 is installed, its header file may be used. +# # We uninstall Homebrew's RE2 to ensure using bundled RE2. +# brew uninstall grpc || : # gRPC depends on RE2 +# brew uninstall grpc@1.54 || : # gRPC 1.54 may be installed too +# brew uninstall re2 +# # We want to use bundled Protobuf for static linking. If +# # Homebrew's Protobuf is installed, its library file may be +# # used on test We uninstall Homebrew's Protobuf to ensure using +# # bundled Protobuf. +# brew uninstall protobuf +# - name: Prepare ccache +# run: | +# echo "CCACHE_DIR=${PWD}/ccache" >> ${GITHUB_ENV} +# - name: Restore ccache +# uses: apache/infrastructure-actions/stash/restore@b41ca1cbe4d8a214dea50788a0e037184a69ad3f +# with: +# path: ccache +# key: jni-macos +# - name: CMake +# run: | +# cmake \ +# -S cpp \ +# -B cpp.build \ +# --preset=ninja-release-jni-macos \ +# -DARROW_BUILD_TESTS=ON \ +# -DCMAKE_INSTALL_PREFIX=$PWD/cpp.install +# - name: Build +# run: | +# cmake --build cpp.build +# - name: Install +# run: | +# cmake --install cpp.build +# - name: Test +# env: +# ARROW_TEST_DATA: ${{ github.workspace }}/testing/data +# PARQUET_TEST_DATA: ${{ github.workspace }}/cpp/submodules/parquet-testing/data +# run: | +# # unstable +# exclude_tests="arrow-acero-asof-join-node-test" +# exclude_tests="${exclude_tests}|arrow-acero-hash-join-node-test" +# ctest \ +# --exclude-regex "${exclude_tests}" \ +# --label-regex unittest \ +# --output-on-failure \ +# --parallel "$(sysctl -n hw.ncpu)" \ +# --test-dir "cpp.build" \ +# --timeout 300 +# - name: Build example +# run: | +# cmake \ +# -S cpp/examples/minimal_build/ \ +# -B cpp/examples/minimal_build.build \ +# -GNinja \ +# -DCMAKE_INSTALL_PREFIX=$PWD/cpp.install +# cmake --build cpp/examples/minimal_build.build +# cd cpp/examples/minimal_build +# ../minimal_build.build/arrow-example +# - name: Save ccache +# if: ${{ !cancelled() }} +# continue-on-error: true +# uses: apache/infrastructure-actions/stash/save@b41ca1cbe4d8a214dea50788a0e037184a69ad3f +# with: +# 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@b41ca1cbe4d8a214dea50788a0e037184a69ad3f +# with: +# path: ${{ steps.ccache-info.outputs.cache-dir }} +# key: jni-windows + +# - name: Find Visual Studio +# shell: pwsh +# run: | +# "VS_INSTALL_PATH=$(vswhere -latest -property installationPath)" >> $env:GITHUB_ENV + +# - name: CMake +# shell: cmd +# run: | +# call "%VS_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 || exit /b 1 +# 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 "%VS_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 || exit /b 1 +# cmake --build cpp.build + +# - name: Install +# shell: cmd +# run: | +# call "%VS_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 || exit /b 1 +# 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 "%VS_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 || exit /b 1 +# 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 "%VS_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 || exit /b 1 + +# 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@b41ca1cbe4d8a214dea50788a0e037184a69ad3f +# with: +# path: ${{ steps.ccache-info.outputs.cache-dir }} +# key: jni-windows + + # On Linux, link ODBC dynamically to follow general RPM/DEB guidelines odbc-linux: needs: check-enabled if: needs.check-enabled.outputs.is_enabled == 'true' @@ -515,11 +516,6 @@ jobs: run: | docker compose up -d dremio cpp/src/arrow/flight/sql/odbc/tests/dremio/set_up_dremio_instance.sh - - name: Restore Docker Volumes - uses: apache/infrastructure-actions/stash/restore@b41ca1cbe4d8a214dea50788a0e037184a69ad3f - with: - path: .docker - key: ubuntu-cpp-odbc - name: Execute Docker Build env: ARCHERY_DOCKER_USER: ${{ secrets.DOCKERHUB_USER }} @@ -529,14 +525,6 @@ jobs: sudo sysctl -w vm.mmap_rnd_bits=28 source ci/scripts/util_enable_core_dumps.sh archery docker run ubuntu-cpp-odbc - - name: Save Docker Volumes - if: ${{ !cancelled() }} - continue-on-error: true - uses: apache/infrastructure-actions/stash/save@b41ca1cbe4d8a214dea50788a0e037184a69ad3f - with: - path: .docker - key: ubuntu-cpp-odbc - include-hidden-files: true - name: Docker Push if: >- success() && github.event_name == 'schedule' @@ -561,6 +549,7 @@ jobs: - { architecture: ARM64, macos-version: "26", build-type : debug } - { architecture: ARM64, macos-version: "26", build-type : release } env: + # on macOS, always link ODBC statically to support sandbox env ARROW_BUILD_TESTS: ON ARROW_BUILD_TYPE: ${{ matrix.build-type }} ARROW_DEPENDENCY_SOURCE: BUNDLED @@ -602,11 +591,6 @@ jobs: id: ccache-info run: | echo "cache-dir=$(ccache --get-config cache_dir)" >> $GITHUB_OUTPUT - - name: Restore ccache - uses: apache/infrastructure-actions/stash/restore@b41ca1cbe4d8a214dea50788a0e037184a69ad3f - with: - path: ${{ steps.ccache-info.outputs.cache-dir }} - key: cpp-odbc-ccache-macos-${{ matrix.macos-version }}-${{ matrix.build-type }} - name: Build run: | # Homebrew uses /usr/local as prefix. So packages @@ -623,13 +607,6 @@ jobs: export ARROW_CMAKE_ARGS="-DODBC_INCLUDE_DIR=$ODBC_INCLUDE_DIR" export CXXFLAGS="$CXXFLAGS -I$ODBC_INCLUDE_DIR" ci/scripts/cpp_build.sh $(pwd) $(pwd)/build - - name: Save ccache - if: ${{ !cancelled() }} - continue-on-error: true - uses: apache/infrastructure-actions/stash/save@b41ca1cbe4d8a214dea50788a0e037184a69ad3f - with: - path: ${{ steps.ccache-info.outputs.cache-dir }} - key: cpp-odbc-ccache-macos-${{ matrix.macos-version }}-${{ matrix.build-type }} - name: Setup Python uses: actions/setup-python@v7 with: @@ -801,6 +778,7 @@ jobs: contents: read packages: write env: + # on Windows, link ODBC statically and compile into 1 DLL to minimize signing ARROW_BUILD_SHARED: OFF ARROW_BUILD_STATIC: ON ARROW_BUILD_TESTS: ON @@ -977,10 +955,10 @@ jobs: report-extra-cpp: if: github.event_name == 'schedule' && always() needs: - - docker - - jni-linux - - jni-macos - - msvc-arm64 + # - docker + # - jni-linux + # - jni-macos + # - msvc-arm64 - odbc-linux - odbc-macos - odbc-macos-universal diff --git a/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt index 033a2775b663..3a5bb7f0a392 100644 --- a/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt @@ -59,14 +59,16 @@ if(WIN32) list(APPEND ARROW_FLIGHT_SQL_ODBC_SRCS odbc.def install/versioninfo.rc) endif() -# Initialize install interface libs (only set in Windows static build) +# Initialize install interface libs (only set on Windows and Linux) set(ARROW_FLIGHT_SQL_ODBC_SHARED_INSTALL_INTERFACE_LIBS "") set(ARROW_FLIGHT_SQL_ODBC_STATIC_INSTALL_INTERFACE_LIBS "") set(ARROW_FLIGHT_SQL_ODBC_SHARED_PRIVATE_LINK_LIBS "") -if(WIN32) +# Linux and Windows follow ARROW_BUILD_STATIC. +# macOS always link statically. +if(NOT APPLE) if(ARROW_BUILD_STATIC) - # Static Arrow deps on Windows — self-contained ODBC DLL + # Static Arrow deps — self-contained ODBC library set(ARROW_FLIGHT_SQL_ODBC_SHARED_LINK_LIBS arrow_flight_sql_static arrow_odbc_spi_impl) set(ARROW_FLIGHT_SQL_ODBC_STATIC_LINK_LIBS arrow_flight_sql_static) @@ -85,8 +87,7 @@ if(WIN32) endif() list(APPEND ARROW_FLIGHT_SQL_ODBC_SHARED_PRIVATE_LINK_LIBS ODBC::ODBC ${ODBCINST}) else() - # Unix/macOS: driver dynamically links arrow_flight_sql so the driver and test - # binary share the same grpc/arrow_flight runtime. + # macOS: arrow_odbc_spi_impl always links Arrow statically. set(ARROW_FLIGHT_SQL_ODBC_SHARED_LINK_LIBS arrow_odbc_spi_impl) set(ARROW_FLIGHT_SQL_ODBC_STATIC_LINK_LIBS ODBC::ODBC ${ODBCINST}) endif() diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt index 17d2ee1ffeea..4b1bac5f90ab 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/CMakeLists.txt @@ -130,7 +130,8 @@ if(WIN32) win_system_dsn.cc) endif() -if(WIN32) +# On macOS, always link Arrow libraries statically. +if(NOT APPLE) find_package(ODBC REQUIRED) target_include_directories(arrow_odbc_spi_impl PUBLIC ${ODBC_INCLUDE_DIR}) if(ARROW_BUILD_STATIC) @@ -149,7 +150,7 @@ if(WIN32) ${ODBCINST}) endif() else() - # Unix + # macOS - always link Arrow statically to support sandbox env target_include_directories(arrow_odbc_spi_impl SYSTEM BEFORE PUBLIC ${ODBC_INCLUDE_DIR}) target_link_libraries(arrow_odbc_spi_impl PUBLIC arrow_flight_sql_static @@ -157,11 +158,6 @@ else() Boost::locale Boost::headers arrow::simdjson) - - if(NOT APPLE) - # Explicitly link to unix-odbc on Linux - target_link_libraries(arrow_odbc_spi_impl PUBLIC ${ODBCINST}) - endif() endif() # CLI @@ -173,18 +169,18 @@ target_link_libraries(arrow_odbc_spi_impl_cli arrow_odbc_spi_impl) # Unit tests -# On Windows, dynamic linking ODBC is supported. -# On unix systems, static linking ODBC is supported, thus the library linking is static. +# On Windows and Linux, dynamic linking ODBC is supported. +# On macOS, static linking ODBC is supported, thus the library linking is static. # Use STATIC_LINK_LIBS when Flight tests require static linkage to avoid mixing static/shared Arrow -if(WIN32 AND ARROW_FLIGHT_TEST_LINKAGE STREQUAL "static") +if(NOT APPLE AND ARROW_FLIGHT_TEST_LINKAGE STREQUAL "static") set(ODBC_SPI_IMPL_TEST_STATIC_LIBS arrow_odbc_spi_impl arrow_flight_testing_static ${ARROW_TEST_STATIC_LINK_LIBS}) set(ODBC_SPI_IMPL_TEST_EXTRA_LIBS "") -elseif(WIN32) +elseif(NOT APPLE) set(ODBC_SPI_IMPL_TEST_STATIC_LIBS "") set(ODBC_SPI_IMPL_TEST_EXTRA_LIBS arrow_odbc_spi_impl arrow_flight_testing_shared) else() - # Unix - always static + # macOS - always static set(ODBC_SPI_IMPL_TEST_STATIC_LIBS arrow_odbc_spi_impl arrow_flight_testing_static ${ARROW_TEST_STATIC_LINK_LIBS}) set(ODBC_SPI_IMPL_TEST_EXTRA_LIBS "") diff --git a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt index f3c345e2449f..6605cb84d9cf 100644 --- a/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt @@ -48,30 +48,22 @@ set(ARROW_FLIGHT_SQL_ODBC_TEST_LIBS ${ODBCINST} ${ODBC_LIBRARIES} ${SQLite3_LIBR # STATIC_LINK_LIBS replaces add_arrow_test's default Arrow test libraries, while # EXTRA_LINK_LIBS supplements them. -if(WIN32 AND ARROW_FLIGHT_TEST_LINKAGE STREQUAL "shared") +# Applies to Windows and Linux. +if(NOT APPLE AND ARROW_FLIGHT_TEST_LINKAGE STREQUAL "shared") set(ARROW_FLIGHT_SQL_ODBC_TEST_LINK_MODE EXTRA_LINK_LIBS) set(ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS arrow_odbc_spi_impl ${ARROW_FLIGHT_SQL_ODBC_TEST_LIBS}) -elseif(WIN32) +elseif(NOT APPLE) set(ARROW_FLIGHT_SQL_ODBC_TEST_LINK_MODE STATIC_LINK_LIBS) set(ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS arrow_odbc_spi_impl ${ARROW_FLIGHT_SQL_ODBC_TEST_LIBS} arrow_flight_sql_odbc_static ${ARROW_TEST_STATIC_LINK_LIBS}) -elseif(APPLE) +else() # GH-49651: Link the ODBC driver dynamically on macOS. set(ARROW_FLIGHT_SQL_ODBC_TEST_LINK_MODE STATIC_LINK_LIBS) set(ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS ${ARROW_FLIGHT_SQL_ODBC_TEST_LIBS} arrow_flight_sql_odbc_shared ${ARROW_TEST_SHARED_LINK_LIBS}) -else() - # GH-49651: Link the ODBC driver statically on Linux to avoid a segfault. - set(ARROW_FLIGHT_SQL_ODBC_TEST_LINK_MODE STATIC_LINK_LIBS) - set(ARROW_FLIGHT_SQL_ODBC_TEST_LINK_LIBS - ${ARROW_FLIGHT_SQL_ODBC_TEST_LIBS} - arrow_flight_sql_odbc_static - ${ARROW_TEST_STATIC_LINK_LIBS} - arrow_odbc_spi_impl - ${ARROW_PROTOBUF_LIBPROTOBUF}) endif() add_arrow_test(flight_sql_odbc_test