Skip to content

Commit 3a5022d

Browse files
committed
investigate
1 parent 9e1beaa commit 3a5022d

File tree

2 files changed

+168
-153
lines changed

2 files changed

+168
-153
lines changed

.github/workflows/cpp_extra.yml

Lines changed: 150 additions & 151 deletions
Original file line numberDiff line numberDiff line change
@@ -423,156 +423,155 @@ jobs:
423423
ulimit -c unlimited # must enable within the same shell
424424
sudo ci/scripts/cpp_test.sh $(pwd) $(pwd)/build
425425
426-
odbc-msvc:
427-
needs: check-labels
428-
name: ODBC Windows
429-
runs-on: windows-2022
430-
if: >-
431-
needs.check-labels.outputs.force == 'true' ||
432-
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') ||
433-
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++') ||
434-
contains(join(github.event.pull_request.changed_files, ' '), 'cpp/src/arrow/flight/sql/odbc/')
435-
timeout-minutes: 240
436-
permissions:
437-
packages: write
438-
env:
439-
ARROW_BUILD_SHARED: ON
440-
ARROW_BUILD_STATIC: OFF
441-
ARROW_BUILD_TESTS: ON
442-
ARROW_BUILD_TYPE: release
443-
ARROW_DEPENDENCY_SOURCE: VCPKG
444-
ARROW_FLIGHT_SQL_ODBC: ON
445-
ARROW_FLIGHT_SQL_ODBC_INSTALLER: ON
446-
ARROW_HOME: /usr
447-
CMAKE_GENERATOR: Ninja
448-
CMAKE_INSTALL_PREFIX: /usr
449-
VCPKG_BINARY_SOURCES: 'clear;nugettimeout,600;nuget,GitHub,readwrite'
450-
VCPKG_DEFAULT_TRIPLET: x64-windows
451-
CMAKE_CXX_STANDARD: "20"
452-
steps:
453-
- name: Disable Crash Dialogs
454-
run: |
455-
reg add `
456-
"HKCU\SOFTWARE\Microsoft\Windows\Windows Error Reporting" `
457-
/v DontShowUI `
458-
/t REG_DWORD `
459-
/d 1 `
460-
/f
461-
- name: Checkout Arrow
462-
uses: actions/checkout@v6
463-
with:
464-
fetch-depth: 0
465-
submodules: recursive
466-
- name: Download Timezone Database
467-
shell: bash
468-
run: ci/scripts/download_tz_database.sh
469-
- name: Install ccache
470-
shell: bash
471-
run: |
472-
ci/scripts/install_ccache.sh 4.12.1 /usr
473-
- name: Setup ccache
474-
shell: bash
475-
run: |
476-
ci/scripts/ccache_setup.sh
477-
- name: ccache info
478-
id: ccache-info
479-
shell: bash
480-
run: |
481-
echo "cache-dir=$(ccache --get-config cache_dir)" >> $GITHUB_OUTPUT
482-
- name: Cache ccache
483-
uses: actions/cache@v5
484-
with:
485-
path: ${{ steps.ccache-info.outputs.cache-dir }}
486-
key: cpp-odbc-ccache-windows-x64-${{ hashFiles('cpp/**') }}
487-
restore-keys: cpp-odbc-ccache-windows-x64-
488-
- name: Checkout vcpkg
489-
uses: actions/checkout@v6
490-
with:
491-
fetch-depth: 0
492-
path: vcpkg
493-
repository: microsoft/vcpkg
494-
- name: Bootstrap vcpkg
495-
run: |
496-
vcpkg\bootstrap-vcpkg.bat
497-
$VCPKG_ROOT = $(Resolve-Path -LiteralPath "vcpkg").ToString()
498-
Write-Output ${VCPKG_ROOT} | `
499-
Out-File -FilePath ${Env:GITHUB_PATH} -Encoding utf8 -Append
500-
Write-Output "VCPKG_ROOT=${VCPKG_ROOT}" | `
501-
Out-File -FilePath ${Env:GITHUB_ENV} -Encoding utf8 -Append
502-
- name: Setup NuGet credentials for vcpkg caching
503-
shell: bash
504-
run: |
505-
$(vcpkg fetch nuget | tail -n 1) \
506-
sources add \
507-
-source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json" \
508-
-storepasswordincleartext \
509-
-name "GitHub" \
510-
-username "$GITHUB_REPOSITORY_OWNER" \
511-
-password "${{ secrets.GITHUB_TOKEN }}"
512-
$(vcpkg fetch nuget | tail -n 1) \
513-
setapikey "${{ secrets.GITHUB_TOKEN }}" \
514-
-source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json"
515-
- name: Build
516-
shell: cmd
517-
run: |
518-
set VCPKG_ROOT_KEEP=%VCPKG_ROOT%
519-
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
520-
set VCPKG_ROOT=%VCPKG_ROOT_KEEP%
521-
bash -c "ci/scripts/cpp_build.sh $(pwd) $(pwd)/build"
522-
- name: Register Arrow Flight SQL ODBC Driver
523-
shell: cmd
524-
run: |
525-
call "cpp\src\arrow\flight\sql\odbc\tests\install_odbc.cmd" ${{ github.workspace }}\build\cpp\%ARROW_BUILD_TYPE%\arrow_flight_sql_odbc.dll
526-
# GH-48270 TODO: Resolve segementation fault during Arrow library unload, segementation fault is caught with `ci/scripts/cpp_test.sh`
527-
# GH-48269 TODO: Enable Flight & Flight SQL testing in MSVC CI and run tests with `ci/scripts/cpp_test.sh` instead
528-
# GH-48547 TODO: enable ODBC tests after GH-48270 and GH-48269 are resolved.
529-
- name: Run ODBC Unit Tests
530-
shell: cmd
531-
run: |
532-
build\cpp\%ARROW_BUILD_TYPE%\arrow-odbc-spi-impl-test.exe
533-
- name: Run ODBC Driver Tests
534-
shell: cmd
535-
run: |
536-
build\cpp\%ARROW_BUILD_TYPE%\arrow-flight-sql-odbc-test.exe
537-
- name: Install WiX Toolset
538-
shell: pwsh
539-
run: |
540-
Invoke-WebRequest -Uri https://github.com/wixtoolset/wix/releases/download/v6.0.0/wix-cli-x64.msi -OutFile wix-cli-x64.msi
541-
Start-Process -FilePath wix-cli-x64.msi -ArgumentList '/quiet', 'Include_freethreaded=1' -Wait
542-
echo "C:\Program Files\WiX Toolset v6.0\bin\" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
543-
- name: Build MSI ODBC installer
544-
shell: pwsh
545-
run: |
546-
# Verify WiX version
547-
wix --version
548-
cd build/cpp
549-
cpack
550-
- name: Upload the artifacts to the job
551-
uses: actions/upload-artifact@v6
552-
with:
553-
name: flight-sql-odbc-msi-installer
554-
path: build/cpp/Apache Arrow Flight SQL ODBC-*-win64.msi
555-
if-no-files-found: error
556-
# Upload ODBC installer as nightly release in scheduled runs
557-
- name: Prepare ODBC installer for sync
558-
if: github.event_name == 'schedule'
559-
run: |
560-
mkdir odbc-installer
561-
Move-Item "build/cpp/Apache Arrow Flight SQL ODBC-*-win64.msi" odbc-installer/
562-
tree odbc-installer /f
563-
- name: Sync to Remote
564-
if: github.event_name == 'schedule'
565-
uses: ./.github/actions/sync-nightlies
566-
with:
567-
upload: true
568-
switches: -avzh --update --delete --progress
569-
local_path: odbc-installer
570-
remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/arrow/odbc
571-
remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }}
572-
remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }}
573-
remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }}
574-
remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }}
575-
remote_host_key: ${{ secrets.NIGHTLIES_RSYNC_HOST_KEY }}
426+
# odbc-msvc:
427+
# needs: check-labels
428+
# name: ODBC Windows
429+
# runs-on: windows-2022
430+
# if: >-
431+
# needs.check-labels.outputs.force == 'true' ||
432+
# contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') ||
433+
# contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++') ||
434+
# contains(join(github.event.pull_request.changed_files, ' '), 'cpp/src/arrow/flight/sql/odbc/')
435+
# timeout-minutes: 240
436+
# permissions:
437+
# packages: write
438+
# env:
439+
# ARROW_BUILD_SHARED: ON
440+
# ARROW_BUILD_STATIC: OFF
441+
# ARROW_BUILD_TESTS: ON
442+
# ARROW_BUILD_TYPE: release
443+
# ARROW_DEPENDENCY_SOURCE: VCPKG
444+
# ARROW_FLIGHT_SQL_ODBC: ON
445+
# ARROW_FLIGHT_SQL_ODBC_INSTALLER: ON
446+
# ARROW_HOME: /usr
447+
# CMAKE_GENERATOR: Ninja
448+
# CMAKE_INSTALL_PREFIX: /usr
449+
# VCPKG_BINARY_SOURCES: 'clear;nugettimeout,600;nuget,GitHub,readwrite'
450+
# VCPKG_DEFAULT_TRIPLET: x64-windows
451+
# steps:
452+
# - name: Disable Crash Dialogs
453+
# run: |
454+
# reg add `
455+
# "HKCU\SOFTWARE\Microsoft\Windows\Windows Error Reporting" `
456+
# /v DontShowUI `
457+
# /t REG_DWORD `
458+
# /d 1 `
459+
# /f
460+
# - name: Checkout Arrow
461+
# uses: actions/checkout@v6
462+
# with:
463+
# fetch-depth: 0
464+
# submodules: recursive
465+
# - name: Download Timezone Database
466+
# shell: bash
467+
# run: ci/scripts/download_tz_database.sh
468+
# - name: Install ccache
469+
# shell: bash
470+
# run: |
471+
# ci/scripts/install_ccache.sh 4.12.1 /usr
472+
# - name: Setup ccache
473+
# shell: bash
474+
# run: |
475+
# ci/scripts/ccache_setup.sh
476+
# - name: ccache info
477+
# id: ccache-info
478+
# shell: bash
479+
# run: |
480+
# echo "cache-dir=$(ccache --get-config cache_dir)" >> $GITHUB_OUTPUT
481+
# - name: Cache ccache
482+
# uses: actions/cache@v5
483+
# with:
484+
# path: ${{ steps.ccache-info.outputs.cache-dir }}
485+
# key: cpp-odbc-ccache-windows-x64-${{ hashFiles('cpp/**') }}
486+
# restore-keys: cpp-odbc-ccache-windows-x64-
487+
# - name: Checkout vcpkg
488+
# uses: actions/checkout@v6
489+
# with:
490+
# fetch-depth: 0
491+
# path: vcpkg
492+
# repository: microsoft/vcpkg
493+
# - name: Bootstrap vcpkg
494+
# run: |
495+
# vcpkg\bootstrap-vcpkg.bat
496+
# $VCPKG_ROOT = $(Resolve-Path -LiteralPath "vcpkg").ToString()
497+
# Write-Output ${VCPKG_ROOT} | `
498+
# Out-File -FilePath ${Env:GITHUB_PATH} -Encoding utf8 -Append
499+
# Write-Output "VCPKG_ROOT=${VCPKG_ROOT}" | `
500+
# Out-File -FilePath ${Env:GITHUB_ENV} -Encoding utf8 -Append
501+
# - name: Setup NuGet credentials for vcpkg caching
502+
# shell: bash
503+
# run: |
504+
# $(vcpkg fetch nuget | tail -n 1) \
505+
# sources add \
506+
# -source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json" \
507+
# -storepasswordincleartext \
508+
# -name "GitHub" \
509+
# -username "$GITHUB_REPOSITORY_OWNER" \
510+
# -password "${{ secrets.GITHUB_TOKEN }}"
511+
# $(vcpkg fetch nuget | tail -n 1) \
512+
# setapikey "${{ secrets.GITHUB_TOKEN }}" \
513+
# -source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json"
514+
# - name: Build
515+
# shell: cmd
516+
# run: |
517+
# set VCPKG_ROOT_KEEP=%VCPKG_ROOT%
518+
# call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
519+
# set VCPKG_ROOT=%VCPKG_ROOT_KEEP%
520+
# bash -c "ci/scripts/cpp_build.sh $(pwd) $(pwd)/build"
521+
# - name: Register Arrow Flight SQL ODBC Driver
522+
# shell: cmd
523+
# run: |
524+
# call "cpp\src\arrow\flight\sql\odbc\tests\install_odbc.cmd" ${{ github.workspace }}\build\cpp\%ARROW_BUILD_TYPE%\arrow_flight_sql_odbc.dll
525+
# # GH-48270 TODO: Resolve segementation fault during Arrow library unload, segementation fault is caught with `ci/scripts/cpp_test.sh`
526+
# # GH-48269 TODO: Enable Flight & Flight SQL testing in MSVC CI and run tests with `ci/scripts/cpp_test.sh` instead
527+
# # GH-48547 TODO: enable ODBC tests after GH-48270 and GH-48269 are resolved.
528+
# - name: Run ODBC Unit Tests
529+
# shell: cmd
530+
# run: |
531+
# build\cpp\%ARROW_BUILD_TYPE%\arrow-odbc-spi-impl-test.exe
532+
# - name: Run ODBC Driver Tests
533+
# shell: cmd
534+
# run: |
535+
# build\cpp\%ARROW_BUILD_TYPE%\arrow-flight-sql-odbc-test.exe
536+
# - name: Install WiX Toolset
537+
# shell: pwsh
538+
# run: |
539+
# Invoke-WebRequest -Uri https://github.com/wixtoolset/wix/releases/download/v6.0.0/wix-cli-x64.msi -OutFile wix-cli-x64.msi
540+
# Start-Process -FilePath wix-cli-x64.msi -ArgumentList '/quiet', 'Include_freethreaded=1' -Wait
541+
# echo "C:\Program Files\WiX Toolset v6.0\bin\" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
542+
# - name: Build MSI ODBC installer
543+
# shell: pwsh
544+
# run: |
545+
# # Verify WiX version
546+
# wix --version
547+
# cd build/cpp
548+
# cpack
549+
# - name: Upload the artifacts to the job
550+
# uses: actions/upload-artifact@v6
551+
# with:
552+
# name: flight-sql-odbc-msi-installer
553+
# path: build/cpp/Apache Arrow Flight SQL ODBC-*-win64.msi
554+
# if-no-files-found: error
555+
# # Upload ODBC installer as nightly release in scheduled runs
556+
# - name: Prepare ODBC installer for sync
557+
# if: github.event_name == 'schedule'
558+
# run: |
559+
# mkdir odbc-installer
560+
# Move-Item "build/cpp/Apache Arrow Flight SQL ODBC-*-win64.msi" odbc-installer/
561+
# tree odbc-installer /f
562+
# - name: Sync to Remote
563+
# if: github.event_name == 'schedule'
564+
# uses: ./.github/actions/sync-nightlies
565+
# with:
566+
# upload: true
567+
# switches: -avzh --update --delete --progress
568+
# local_path: odbc-installer
569+
# remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/arrow/odbc
570+
# remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }}
571+
# remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }}
572+
# remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }}
573+
# remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }}
574+
# remote_host_key: ${{ secrets.NIGHTLIES_RSYNC_HOST_KEY }}
576575

577576
report-extra-cpp:
578577
if: github.event_name == 'schedule' && always()
@@ -582,6 +581,6 @@ jobs:
582581
- jni-macos
583582
- msvc-arm64
584583
- odbc-macos
585-
- odbc-msvc
584+
# - odbc-msvc
586585
uses: ./.github/workflows/report_ci.yml
587586
secrets: inherit

cpp/src/arrow/flight/sql/odbc/odbc_impl/system_dsn.cc

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "arrow/result.h"
2121
#include "arrow/util/utf8.h"
2222

23+
#include <iostream>
2324
#include <sstream>
2425

2526
namespace arrow::flight::sql::odbc {
@@ -47,6 +48,9 @@ void PostLastInstallerError() {
4748
wchar_t msg[BUFFER_SIZE];
4849
SQLInstallerError(1, &code, msg, BUFFER_SIZE, NULL);
4950

51+
std::wcout << L"TestLog: Installer error code: " << code
52+
<< L", message: " << msg << std::endl;
53+
5054
std::wstringstream buf;
5155
buf << L"Message: \"" << msg << L"\", Code: " << code;
5256
std::wstring error_msg = buf.str();
@@ -77,15 +81,24 @@ bool UnregisterDsn(const std::wstring& dsn) {
7781
* @return True on success and false on fail.
7882
*/
7983
bool RegisterDsn(const Configuration& config, LPCWSTR driver) {
84+
std::cout << "TestLog: Registering DSN: " << config.Get(FlightSqlConnection::DSN)
85+
<< std::endl;
86+
8087
const std::string& dsn = config.Get(FlightSqlConnection::DSN);
88+
std::cout << "TestLog: Using dsn = " << dsn << std::endl;
89+
8190
auto wdsn_result = arrow::util::UTF8ToWideString(dsn);
91+
std::cout << "TestLog: Converted wdsn_result" << std::endl;
8292
if (!wdsn_result.status().ok()) {
93+
std::cout << "TestLog: Error converting wdsn_result" << std::endl;
8394
PostArrowUtilError(wdsn_result.status());
8495
return false;
8596
}
86-
std::wstring wdsn = wdsn_result.ValueOrDie();
8797

98+
std::wstring wdsn = wdsn_result.ValueOrDie();
99+
std::wcout << "TestLog: Converted wdsn = " << wdsn << std::endl;
88100
if (!SQLWriteDSNToIni(wdsn.c_str(), driver)) {
101+
std::cout << "TestLog: Error writing DSN to ini" << std::endl;
89102
PostLastInstallerError();
90103
return false;
91104
}
@@ -100,25 +113,28 @@ bool RegisterDsn(const Configuration& config, LPCWSTR driver) {
100113

101114
auto wkey_result = arrow::util::UTF8ToWideString(key);
102115
if (!wkey_result.status().ok()) {
116+
std::cout << "TestLog: Error converting wkey_result = " << wkey_result.status().message() << std::endl;
103117
PostArrowUtilError(wkey_result.status());
104118
return false;
105119
}
106120
std::wstring wkey = wkey_result.ValueOrDie();
107121

108122
auto wvalue_result = arrow::util::UTF8ToWideString(it->second);
109123
if (!wvalue_result.status().ok()) {
124+
std::cout << "TestLog: Error converting wvalue_result = " << wvalue_result.status().message() << std::endl;
110125
PostArrowUtilError(wvalue_result.status());
111126
return false;
112127
}
113128
std::wstring wvalue = wvalue_result.ValueOrDie();
114-
115129
if (!SQLWritePrivateProfileString(wdsn.c_str(), wkey.c_str(), wvalue.c_str(),
116130
L"ODBC.INI")) {
131+
std::cout << "TestLog: Error writing private profile string" << std::endl;
117132
PostLastInstallerError();
118133
return false;
119134
}
120135
}
121136

137+
std::cout << "TestLog: Successfully registered DSN" << std::endl;
122138
return true;
123139
}
124140
} // namespace arrow::flight::sql::odbc

0 commit comments

Comments
 (0)