Skip to content

Conversation

@alinaliBQ
Copy link
Contributor

@alinaliBQ alinaliBQ commented Dec 3, 2025

Rationale for this change

#48312

What changes are included in this PR?

  • Add new ODBC workflow for Windows MSVC
  • Added build fixes to enable build on MSVC CI

Are these changes tested?

Tested in CI

Are there any user-facing changes?

N/A

@github-actions
Copy link

github-actions bot commented Dec 3, 2025

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


# bash -c "ci/scripts/cpp_test.sh $(pwd) $(pwd)/build"

# GH-47787 TODO Build ODBC installer
Copy link
Contributor Author

@alinaliBQ alinaliBQ Dec 3, 2025

Choose a reason for hiding this comment

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

Once this PR is merged, I can rebase and uncomment below code for GH-47787 in PR #48054

Copy link
Member

Choose a reason for hiding this comment

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

Could you remove this in this PR and add this in the separated PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, removed the comments here

@alinaliBQ alinaliBQ changed the title GH-48278 : [C++][FlightRPC] work-in-progress Standalone ODBC MSVC CI GH-48312 : [C++][FlightRPC] work-in-progress Standalone ODBC MSVC CI Dec 3, 2025
@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Dec 3, 2025
@github-actions
Copy link

github-actions bot commented Dec 3, 2025

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

@alinaliBQ alinaliBQ changed the title GH-48312 : [C++][FlightRPC] work-in-progress Standalone ODBC MSVC CI GH-48312 : [C++][FlightRPC] Standalone ODBC MSVC CI Dec 3, 2025
@alinaliBQ alinaliBQ marked this pull request as ready for review December 3, 2025 17:29
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@raulcd , @kou , @lidavidm If you have time, please have a look at this PR, thank you!

Copy link
Member

Choose a reason for hiding this comment

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

Could you move this content to cpp_extra.yml?
cpp_windows.yml was extracted to a separated file because it's reused from multiple jobs. But this job isn't reused.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kou Sure, I have moved the file to cpp_extra.yml, thanks for the context about cpp_windows.yml.

Copy link
Member

@raulcd raulcd left a comment

Choose a reason for hiding this comment

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

I'll try to take a look but as an initial comment is the commit about moving from boost::optional to std::optional required for this PR?
a696be3

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting committer review Awaiting committer review labels Dec 3, 2025
@alinaliBQ
Copy link
Contributor Author

alinaliBQ commented Dec 3, 2025

I'll try to take a look but as an initial comment is the commit about moving from boost::optional to std::optional required for this PR? a696be3

Yes I think so, previously when I was testing my changes on a different branch, the build was failing due to mixed usages of boost::optional and std::optional. Having this commit resolved the build failures

@lidavidm
Copy link
Member

lidavidm commented Dec 3, 2025

I'll try to take a look but as an initial comment is the commit about moving from boost::optional to std::optional required for this PR? a696be3

Yes I think so, previously when I was testing my changes on a different branch, the build was failing due to mixed usages of boost::optional and std::optional. Having this commit resolved the build failures

Do you want to submit this as another PR first?

@alinaliBQ
Copy link
Contributor Author

Do you want to submit this as another PR first?

Sure, I have extracted the std::optional change in #48323.

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

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

Why do we need separated workflow?

Comment on lines 36 to 37
schedule:
- cron: '0 13 * * *'
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since the workflow will only be run with ODBC related changes, making it run nightly will help catch any ODBC issues that occur when there are no ODBC changes merged into main.

Copy link
Member

Choose a reason for hiding this comment

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

moving it as a job inside the cpp_extra.yaml as @kou pointed on another comment allows us to run this as part of the nightlies and also trigger it on demand via adding the CI: extra label so we can always run it as part of a job if we think it might be relevant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @raulcd and @kou for pointing me to cpp_extra.yml. I have tried to move the ODBC workflow to cpp_extra.yml. Currently it is building, will fix any build issues as I see them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see ODBC was able to build successfully here: C++ Extra / C++ ODBC / windows (pull_request)

# GH-47787 TODO Build ODBC installer
# ARROW_FLIGHT_SQL_ODBC_INSTALLER: ON
ARROW_SIMD_LEVEL: AVX2
CMAKE_CXX_STANDARD: "17"
Copy link
Member

Choose a reason for hiding this comment

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

Should we use 20?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ODBC is using CMAKE_CXX_STANDARD 20, but I am not sure if Arrow Flight and Flight SQL support 20 yet, so I used 17 in the workflow to be safe.

@github-actions github-actions bot removed the awaiting change review Awaiting change review label Dec 4, 2025
@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting change review Awaiting change review labels Dec 14, 2025
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

* Add ODBC installer MSVC CI
- Use newest `actions/checkout`

Co-Authored-By: alinalibq <alina.li@improving.com>
Copy link
Contributor Author

@alinaliBQ alinaliBQ left a comment

Choose a reason for hiding this comment

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

@kou Thanks for the review! Addressed all comments.

Comment on lines 28 to 29
ARROW_BUILD_SHARED: ON
ARROW_BUILD_STATIC: ON
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed static libraries here


# bash -c "ci/scripts/cpp_test.sh $(pwd) $(pwd)/build"

# GH-47787 TODO Build ODBC installer
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, removed the comments here

#
# ARROW-2986: Without /EHsc we get C4530 warning
set(CXX_COMMON_FLAGS "/W3 /EHsc")
string(APPEND CMAKE_CXX_FLAGS " /EHsc")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I found this line was needed when I was working on a separate build. Locally on MSVC Visual Studio I didn't need this line, but on CI using Ninja I get C4530 warning when building GTestAlt, which was treated as an error. Adding this line resolved the issue below at FindGTestAlt.cmake.

Issue Log:

C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\include\__msvc_ostream.hpp(781): error C2220: the following warning is treated as an error
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\include\__msvc_ostream.hpp(781): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc

GitHub Action Run Log: https://github.com/apache/arrow/actions/runs/19112837562/job/54614206545

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kou Sure, I have moved the file to cpp_extra.yml, thanks for the context about cpp_windows.yml.

@github-actions github-actions bot added awaiting change review Awaiting change review awaiting changes Awaiting changes and removed awaiting changes Awaiting changes awaiting change review Awaiting change review labels Dec 15, 2025
Move `include(ThirdpartyToolchain)`
@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Dec 16, 2025
Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

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

+1

@kou kou merged commit c58bfe5 into apache:main Dec 17, 2025
46 of 50 checks passed
@kou kou removed the awaiting change review Awaiting change review label Dec 17, 2025
@github-actions github-actions bot added the awaiting merge Awaiting merge label Dec 17, 2025
@pitrou
Copy link
Member

pitrou commented Dec 18, 2025

These builds always take very long (around 1h40), 1) are we sure vcpkg cacking is working? 2) can we stop building large unused dependencies such as aws-sdk-cpp and google-cloud-cpp?

@raulcd
Copy link
Member

raulcd commented Dec 18, 2025

Just noticed this too on my PR, caching does not seem to be working, there seems to have some credential issues:

 WARNING: Your request could not be authenticated by the GitHub Packages service. Please ensure your access token is valid and has the appropriate scopes configured.
  Forbidden https://nuget.pkg.github.com/apache/ 7052ms
Response status code does not indicate success: 403 (Forbidden).
System.Net.Http.HttpRequestException: Response status code does not indicate success: 403 (Forbidden).

@raulcd
Copy link
Member

raulcd commented Dec 18, 2025

I can also see some timeouts and I've seen some problems on other jobs connecting to github to download packages so I am unsure whether the problem is that GitHub is having issues or if there's really a problem with credentials:

Starting submission of google-cloud-cpp[core,rest-common,storage]:x64-windows@2.36.0 to 1 binary cache(s) in the background
Elapsed time to handle google-cloud-cpp:x64-windows: 5 min
google-cloud-cpp:x64-windows package ABI: 8e20db0777ec996c988874fe6425f50651387f6a355a4326a6678c64f235d355
error: "C:\ProgramData\Chocolatey\bin\nuget.exe" push -ForceEnglishOutput -Verbosity detailed -NonInteractive "D:\a\arrow\arrow\vcpkg\buildtrees\crc32c_x64-windows.1.1.2-vcpkg1b2e2cd4d288cef27d01ba4088df517007c115d52a20222fe4f7aa2621a85739.nupkg" -Timeout 100 -Source GitHub failed with exit code 1
NuGet Version: 7.0.1.1

@alinaliBQ
Copy link
Contributor Author

Sorry, seems there is an issue with the caching, let me look into this issue today.

@conbench-apache-arrow
Copy link

After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit c58bfe5.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 8 possible false positives for unstable benchmarks that are known to sometimes produce them.

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.

5 participants