Skip to content

Conversation

@alinaliBQ
Copy link
Contributor

@alinaliBQ alinaliBQ commented Nov 5, 2025

Rationale for this change

Enable ODBC in MSVC CI and disable ODBC in MinGW CI since MSVC is the main platform for ODBC.

What changes are included in this PR?

  • Enable ODBC in MSVC C++ CI .github/workflows/cpp_windows.yml
  • Remove boost-optional as it blocks ODBC from building in MSVC
  • Undefine ODBC macros that cause conflicts with SqlInfoOptions
  • Fix build issue with static linking for grouper benchmark

Are these changes tested?

Tested in CI

Are there any user-facing changes?

N/A

@github-actions
Copy link

github-actions bot commented Nov 5, 2025

⚠️ GitHub issue #48019 has been automatically assigned in GitHub to PR creator.

@github-actions github-actions bot added the awaiting review Awaiting review label Nov 5, 2025
@alinaliBQ alinaliBQ changed the title GH-48019 : [C++][FlightRPC] WIP: Enable ODBC in MSVC CI GH-48019 : [C++][FlightRPC] work-in-progress Enable ODBC in MSVC CI Nov 5, 2025
@alinaliBQ
Copy link
Contributor Author

Please note that I created this WIP PR to test the CI since Arrow's repo allows for longer runs

alinaliBQ and others added 20 commits November 14, 2025 13:24
Having static vs. shared issue
To make it easier to manage dependencies
windows-mingw also has timeout of 2hr
* reason: gtest can't be used with C++17. Arrow project doesn't support C++ 17 yet.
* Add back `CMAKE_CXX_STANDARD: "17"`
Borrowed from the Glib workflow
`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.
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
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
Since we need to use link to boost dynamically, we need to remove the bundled boost library flag.

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

apache#48084

Fix lint
Attempt to include Arrow headers before ODBC headers to avoid conflict with arrow/flight/sql/types.h
To avoid redefinition error
…fo.cc`

On some workflows, unity build is set to ON to make the build faster. This is an attempt to resolve the 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`
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.
Use `arrow_flight_sql_odbc.dll` instead of `libarrow_flight_sql_odbc.dll` which is the naming convention used on MinGW Windows
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.
@alinaliBQ alinaliBQ force-pushed the gh-48019-build-odbc-msvc branch from 11a2ab8 to 97b30d2 Compare November 14, 2025 21:47
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
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant