Skip to content

ODBC Standalone MSVC Build CI - #140

Merged
alinaliBQ merged 2 commits into
apache-odbcfrom
odbc-standalone-ci
Dec 2, 2025
Merged

alinaliBQ merged 2 commits into
apache-odbcfrom
odbc-standalone-ci

Conversation

@alinaliBQ

@alinaliBQ alinaliBQ commented Nov 25, 2025

Copy link
Copy Markdown

CI for building ODBC only on Windows, the new workflow is named C++ ODBC / windows. It builds and registers the ODBC driver, but the tests are not enabled yet due to

blocker 1) apache#48270 Support Unloading For Arrow Libraries Used by Flight SQL ODBC in MSVC
blocker 2) apache#48269 Enable Flight & Flight SQL tests in MSVC CI

@alinaliBQ
alinaliBQ force-pushed the odbc-standalone-ci branch 2 times, most recently from d7a482e to eb52920 Compare November 25, 2025 20:07
@alinaliBQ alinaliBQ changed the title ODBC Single Build CI ODBC Standalone MSVC Build CI Nov 26, 2025
@alinaliBQ
alinaliBQ force-pushed the odbc-standalone-ci branch 2 times, most recently from 2281e9d to 53993c7 Compare November 27, 2025 18:39
@alinaliBQ
alinaliBQ marked this pull request as ready for review November 27, 2025 18:42
# specific language governing permissions and limitations
# under the License.

name: C++ ODBC

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the idea to move all of our ODBC CI stuff in here (including MacOS)?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depends on where the community would like to see things go. If our ODBC stuff works on the current macOS CI without extra changes, then I think it's ok to leave ODBC in macOS in cpp.yml, so we wil see.

We needed a new ODBC workflow for Windows because there isn't a release Windows build in the CIs, and ODBC tests in CI are blocked right now

alinaliBQ and others added 2 commits December 1, 2025 11:35
Remove DataSet

Fix cache key

Use odbc-specific cache key

Fix Lint and Add odbc registration step

Link appropriate GitHub issues that blocks ODBC tests

Disable test phase and add schedule

Run everyday 7 am Vancouver time

Enable ODBC build on MSVC CI

Code Clean up and enable ODBC tests in CI

Still need to modify ODBCUtilEnvironment if we decide to use it. Still need to add ODBC V2 support so a different env and conn is used for ODBC 2 tests.

Draft enable ODBC global setup/teardown

Run ODBC test once outside of test script

If ODBC test is run using MinGW Shell, segfault occurs.
I am not getting any seg fault on my local MSVC Windows when I run the tests without the bash script. But if Windows CI breaks from running the standalone exe then I will look into this

Prepend vcpkg to search vcpkg before `<prefix>/lib/cmake`

Since we are installing dependencies on vcpkg, if `lib/cmake` is searched first, then cmake will look into that directory and use the wrong paths.

Convert VCPKG Windows path to MSYS path

Set `VCPKG_ROOT` in test phase

Fix ODBC dll name

Use `arrow_flight_sql_odbc.dll` instead of `libarrow_flight_sql_odbc.dll` which is the naming convention used on MinGW Windows

Link ODBC library on all platforms

On my local MSVC Windows machine, Visual Studio is used to build without needing to link ` ${ODBCINST}` explicitly, its behavior might be different from Ninja which is what CI uses.
`${ODBCINST}` is likely needed by Linux as well, so adding it for all platforms.

Attempt to resolve `arrow-compute-grouper-benchmark` build issue

I think `if(ARROW_FLIGHT_TEST_LINKAGE STREQUAL "static")` might be more appropriate here, as I am seeing build issues due to both dynamic and static linking occurring. I see in apache@59903d0, this check is used for `arrow-filesystem-s3fs-benchmark`

Disable `UNITY_BUILD` for ODBC test due to conflict on `sqlite_sql_info.cc`

On some workflows, unity build is set to ON to make the build faster. This is an attempt to resolve the build issue.

Remove debug messages

Fix lint

Add `sql_info_undef.h` to sqlite_sql_info.cc

Undefine duplicates in SQLGetInfo

Add `#pragma once` to odbc_test_suite.h

To avoid redefinition error

Attempt to resolve conflict with sql/types.h

Attempt to include Arrow headers before ODBC headers to avoid conflict with arrow/flight/sql/types.h

[apacheGH-48084] Replace boost::optional with std::optional

Addresses comment apache#40939 (comment)
Replace boost::optional with std::optional in ODBC codebase

apache#48084

Fix lint

Remove `BOOST_SOURCE=BUNDLED` to use vcpkg's dynamic link to boost

Since we need to use link to boost dynamically, we need to remove the bundled boost library flag.

Add debug messages.

Remove `ARROW_BOOST_USE_SHARED = OFF`

Since we have a release build, can enable boost as shared.

With `ARROW_BOOST_USE_SHARED = OFF`, I am getting error
```
D:\a\arrow\arrow\build\cpp\vcpkg_installed\x64-windows\include\boost/filesystem/config.hpp(96): fatal error C1189: #error:  Must not define both BOOST_FILESYSTEM_DYN_LINK and BOOST_FILESYSTEM_STATIC_LINK
```

Also increased time limit, since 2 hours don't seem to be enough to finish the vcpkg build

Change to release build

Getting
```
orc.lib(Exceptions.cc.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in unity_2_cxx.cxx.obj
orc.lib(Exceptions.cc.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in unity_2_cxx.cxx.obj
```
when building with debug and presumably ARROW_ORC

Set ARROW_BOOST_USE_SHARED to OFF

`ARROW_BOOST_USE_SHARED` is restored to `OFF`, which according to Windows doc should help with the debug build now.

Retore value of `ARROW_BUILD_BENCHMARKS`, though noting it is set to `OFF` in GLib MSVC workflow.

Add VCPKG set up

Borrowed from the Glib workflow

Add `/EHsc` flag

* Add back `CMAKE_CXX_STANDARD: "17"`

Remove `CMAKE_CXX_STANDARD` 17

* reason: gtest can't be used with C++17. Arrow project doesn't support C++ 17 yet.

Extend run-time to 2hr

windows-mingw also has timeout of 2hr

Empty commit to trigger CI

Specify `VCPKG_BINARY_SOURCES` and `VCPKG_DEFAULT_TRIPLET`

Specify VCPKG_TARGET_TRIPLET as x64 windows

Set ARROW_DEPENDENCY_SOURCE to VCPKG

To make it easier to manage dependencies

Enable static build on MSVC

`ARROW_BUILD_BENCHMARKS` prevents Flight from being built

Remove `ARROW_BOOST_USE_SHARED`

Having static vs. shared issue

Enable Flight & Flight SQL for ODBC

Enable ODBC build on MSVC CI

Enable regular ctest tests

Remove undef items

Add concurrency and permissions to odbc yml

Create cpp_odbc.yml

Fix architecture in CI
@alinaliBQ
alinaliBQ merged commit 13002cf into apache-odbc Dec 2, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants