@@ -336,9 +336,76 @@ jobs:
336336 cd cpp/examples/minimal_build
337337 ../minimal_build.build/arrow-example
338338
339- odbc :
339+ odbc-macos :
340340 needs : check-labels
341- name : ODBC
341+ name : ODBC ${{ matrix.architecture }} macOS ${{ matrix.macos-version }}
342+ runs-on : macos-${{ matrix.macos-version }}
343+ if : >-
344+ needs.check-labels.outputs.force == 'true' ||
345+ contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') ||
346+ contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++')
347+ timeout-minutes : 75
348+ strategy :
349+ fail-fast : false
350+ matrix :
351+ include :
352+ - architecture : AMD64
353+ macos-version : " 15-intel"
354+ - architecture : ARM64
355+ macos-version : " 14"
356+ env :
357+ ARROW_BUILD_TESTS : ON
358+ ARROW_FLIGHT_SQL_ODBC : ON
359+ ARROW_HOME : /tmp/local
360+ steps :
361+ - name : Checkout Arrow
362+ uses : actions/checkout@v6.0.1
363+ with :
364+ fetch-depth : 0
365+ submodules : recursive
366+ - name : Install Dependencies
367+ run : |
368+ brew bundle --file=cpp/Brewfile
369+ - name : Setup ccache
370+ run : |
371+ ci/scripts/ccache_setup.sh
372+ - name : ccache info
373+ id : ccache-info
374+ run : |
375+ echo "cache-dir=$(ccache --get-config cache_dir)" >> $GITHUB_OUTPUT
376+ - name : Cache ccache
377+ uses : actions/cache@v5.0.2
378+ with :
379+ path : ${{ steps.ccache-info.outputs.cache-dir }}
380+ key : cpp-odbc-ccache-macos-${{ matrix.macos-version }}-${{ hashFiles('cpp/**') }}
381+ restore-keys : cpp-odbc-ccache-macos-${{ matrix.macos-version }}-
382+ - name : Build
383+ run : |
384+ # Homebrew uses /usr/local as prefix. So packages
385+ # installed by Homebrew also use /usr/local/include. We
386+ # want to include headers for packages installed by
387+ # Homebrew as system headers to ignore warnings in them.
388+ # But "-isystem /usr/local/include" isn't used by CMake
389+ # because /usr/local/include is marked as the default
390+ # include path. So we disable -Werror to avoid build error
391+ # by warnings from packages installed by Homebrew.
392+ export BUILD_WARNING_LEVEL=PRODUCTION
393+ LIBIODBC_DIR="$(brew --cellar libiodbc)/$(brew list --versions libiodbc | awk '{print $2}')"
394+ ODBC_INCLUDE_DIR=$LIBIODBC_DIR/include
395+ export ARROW_CMAKE_ARGS="-DODBC_INCLUDE_DIR=$ODBC_INCLUDE_DIR"
396+ export CXXFLAGS="$CXXFLAGS -I$ODBC_INCLUDE_DIR"
397+ ci/scripts/cpp_build.sh $(pwd) $(pwd)/build
398+ - name : Test
399+ shell : bash
400+ run : |
401+ sudo sysctl -w kern.coredump=1
402+ sudo sysctl -w kern.corefile=/tmp/core.%N.%P
403+ ulimit -c unlimited # must enable within the same shell
404+ ci/scripts/cpp_test.sh $(pwd) $(pwd)/build
405+
406+ odbc-msvc :
407+ needs : check-labels
408+ name : ODBC Windows
342409 runs-on : windows-2022
343410 if : >-
344411 needs.check-labels.outputs.force == 'true' ||
@@ -352,6 +419,9 @@ jobs:
352419 ARROW_BUILD_STATIC : OFF
353420 ARROW_BUILD_TESTS : ON
354421 ARROW_BUILD_TYPE : release
422+ # Turn Arrow CSV off to disable `find_package(Arrow)` check on MSVC CI.
423+ # GH-49050 TODO: enable `find_package(Arrow)` check on MSVC CI.
424+ ARROW_CSV : OFF
355425 ARROW_DEPENDENCY_SOURCE : VCPKG
356426 ARROW_FLIGHT_SQL_ODBC : ON
357427 ARROW_FLIGHT_SQL_ODBC_INSTALLER : ON
@@ -434,10 +504,15 @@ jobs:
434504 shell : cmd
435505 run : |
436506 call "cpp\src\arrow\flight\sql\odbc\tests\install_odbc.cmd" ${{ github.workspace }}\build\cpp\%ARROW_BUILD_TYPE%\arrow_flight_sql_odbc.dll
437- # GH-48270 TODO: Resolve segementation fault during Arrow library unload
438- # GH-48269 TODO: Enable Flight & Flight SQL testing in MSVC CI
439- # GH-48547 TODO: enable ODBC tests after GH-48270 and GH-48269 are resolved.
440-
507+ - name : Test
508+ shell : cmd
509+ run : |
510+ set VCPKG_ROOT_KEEP=%VCPKG_ROOT%
511+ call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
512+ set VCPKG_ROOT=%VCPKG_ROOT_KEEP%
513+ # Convert VCPKG Windows path to MSYS path
514+ for /f "usebackq delims=" %%I in (`bash -c "cygpath -u \"$VCPKG_ROOT_KEEP\""` ) do set VCPKG_ROOT=%%I
515+ bash -c "ci/scripts/cpp_test.sh $(pwd) $(pwd)/build"
441516 - name : Install WiX Toolset
442517 shell : pwsh
443518 run : |
@@ -455,11 +530,46 @@ jobs:
455530 uses : actions/upload-artifact@v6
456531 with :
457532 name : flight-sql-odbc-msi-installer
458- path : build/cpp/Apache Arrow Flight SQL ODBC-*-win64.msi
533+ path : build/cpp/Apache- Arrow- Flight- SQL- ODBC-*-win64.msi
459534 if-no-files-found : error
535+ - name : Install ODBC MSI
536+ run : |
537+ cd build/cpp
538+ $odbc_msi = Get-ChildItem -Filter "Apache-Arrow-Flight-SQL-ODBC-*-win64.msi"
539+ if (-not $odbc_msi) {
540+ Write-Error "ODBC MSI not found"
541+ exit 1
542+ }
543+
544+ foreach ($msi in $odbc_msi) {
545+ Write-Host "Installing $($msi.Name) with logs"
546+ $log = "odbc-install.log"
547+ Start-Process msiexec.exe -Wait -ArgumentList "/i `"$msi`"", "/qn", "/L*V `"$log`""
548+ Get-Content $log
549+ }
550+ - name : Check ODBC DLL installation
551+ run : |
552+ $dirs = Get-ChildItem "C:\Program Files" -Directory -Filter "Apache-Arrow-Flight-SQL-ODBC*"
553+
554+ foreach ($dir in $dirs) {
555+ $bin = Join-Path $dir.FullName "bin"
556+
557+ if (Test-Path $bin) {
558+ tree $bin /f
559+
560+ $dll = Join-Path $bin "arrow_flight_sql_odbc.dll"
561+ if (Test-Path $dll) {
562+ Write-Host "Found ODBC DLL: $dll"
563+ exit 0
564+ }
565+ }
566+ }
567+
568+ Write-Error "ODBC DLL not found"
569+ exit 1
460570
461571 odbc-nightly :
462- needs : odbc
572+ needs : odbc-msvc
463573 name : ODBC nightly
464574 runs-on : ubuntu-latest
465575 if : github.event_name == 'schedule' && github.repository == 'apache/arrow'
@@ -472,6 +582,16 @@ jobs:
472582 run : |
473583 mkdir odbc-installer
474584 mv *.msi odbc-installer/
585+
586+ # Add `dev-yyyy-mm-dd` to ODBC MSI before `win64.msi`:
587+ # Apache Arrow Flight SQL ODBC-24.0.0-win64.msi ->
588+ # Apache Arrow Flight SQL ODBC-24.0.0-dev-2026-02-06-win64.msi
589+ cd odbc-installer
590+ msi_name=$(ls *.msi)
591+ dev_msi_name=$(echo ${msi_name} | sed -e "s/win64\.msi$/dev-$(date +%Y-%m-%d)-win64.msi/")
592+ mv "${msi_name}" "${dev_msi_name}"
593+ cd ..
594+
475595 tree odbc-installer
476596 - name : Checkout Arrow
477597 uses : actions/checkout@v6
@@ -494,13 +614,47 @@ jobs:
494614 remote_key : ${{ secrets.NIGHTLIES_RSYNC_KEY }}
495615 remote_host_key : ${{ secrets.NIGHTLIES_RSYNC_HOST_KEY }}
496616
617+ odbc-release :
618+ needs : odbc-msvc
619+ name : ODBC release
620+ runs-on : ubuntu-latest
621+ if : ${{ startsWith(github.ref_name, 'apache-arrow-') && contains(github.ref_name, '-rc') }}
622+ permissions :
623+ # Upload to GitHub Release
624+ contents : write
625+ steps :
626+ - name : Checkout Arrow
627+ uses : actions/checkout@v6
628+ with :
629+ fetch-depth : 0
630+ submodules : recursive
631+ - name : Download the artifacts
632+ uses : actions/download-artifact@v7
633+ with :
634+ name : flight-sql-odbc-msi-installer
635+ - name : Wait for creating GitHub Release
636+ env :
637+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
638+ run : |
639+ dev/release/utils-watch-gh-workflow.sh \
640+ ${GITHUB_REF_NAME} \
641+ release_candidate.yml
642+ - name : Upload the artifacts to GitHub Release
643+ env :
644+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
645+ run : |
646+ gh release upload ${GITHUB_REF_NAME} \
647+ --clobber \
648+ Apache-Arrow-Flight-SQL-ODBC-*-win64.msi
649+
497650 report-extra-cpp :
498651 if : github.event_name == 'schedule' && always()
499652 needs :
500653 - docker
501654 - jni-linux
502655 - jni-macos
503656 - msvc-arm64
504- - odbc
657+ - odbc-macos
658+ - odbc-msvc
505659 uses : ./.github/workflows/report_ci.yml
506660 secrets : inherit
0 commit comments