Skip to content

Conversation

@alinaliBQ
Copy link
Contributor

@alinaliBQ alinaliBQ commented Dec 17, 2025

Rationale for this change

#48575

What changes are included in this PR?

  • Add new ODBC workflow for macOS Intel 15 and 14 arm64.
  • Added ODBC build fixes to enable build on macOS CI.

Are these changes tested?

Tested in CI and local macOS Intel and M1 environments.

Are there any user-facing changes?

N/A

@github-actions
Copy link

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

alinaliBQ and others added 4 commits December 18, 2025 12:26
Co-Authored-By: justing-bq <justin.gossett@improving.com>
Co-Authored-By: Victor Tsang <victor.tsang@improving.com>
Co-Authored-By: Alina (Xi) Li <alina.li@improving.com>
Co-Authored-By: alinalibq <alina.li@improving.com>
Co-Authored-By: justing-bq <justin.gossett@improving.com>
added changes to build in MacOS
Co-authored-by: vic-tsang <victor.tsang@improving.com>
@alinaliBQ alinaliBQ force-pushed the gh-48575-macos-odbc-ci branch from f652cbb to 581bfcc Compare December 18, 2025 20:26
@alinaliBQ alinaliBQ changed the title GH-48575: [C++][FlightRPC] work-in-progress Standalone ODBC macOS CI GH-48575: [C++][FlightRPC] Standalone ODBC macOS CI Dec 19, 2025
@alinaliBQ alinaliBQ marked this pull request as ready for review December 19, 2025 19:42
Comment on lines 261 to 263
-DCMAKE_C_FLAGS="${CFLAGS:-}" \
-DCMAKE_CXX_FLAGS="${CXXFLAGS:-}" \
-DCMAKE_CXX_FLAGS="${CXXFLAGS:-} -I${ODBC_INCLUDE_DIR:-} -L${ODBC_LIB_DIR:-}" \
-DCMAKE_CXX_STANDARD="${CMAKE_CXX_STANDARD:-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.

I am open to suggestions for other locations for -I and -L 🙂

],
"displayName": "Debug build with tests and Flight SQL",
"cacheVariables": {}
},
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 can be built on Windows and macOS Intel/ARM but it is not available on Linux yet (we will add Linux support later), let me know if this change should be removed until Linux is also supported.

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Dec 19, 2025
Comment on lines +49 to +60
} catch (const arrow::flight::sql::odbc::AuthenticationException& ex) {
GetDiagnostics().AddError(arrow::flight::sql::odbc::DriverException(
ex.GetMessageText(), ex.GetSqlState(), ex.GetNativeError()));
} catch (const arrow::flight::sql::odbc::NullWithoutIndicatorException& ex) {
GetDiagnostics().AddError(arrow::flight::sql::odbc::DriverException(
ex.GetMessageText(), ex.GetSqlState(), ex.GetNativeError()));
}
// on mac, DriverException doesn't catch the subclass exceptions hence we added
// the following above.
// GH-48278 TODO investigate if there is a way to catch all the subclass exceptions
// under DriverException
catch (const arrow::flight::sql::odbc::DriverException& ex) {
Copy link
Member

Choose a reason for hiding this comment

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

This shouldn't happen...maybe clang is stricter than MSVC?

Copy link
Contributor Author

@alinaliBQ alinaliBQ Dec 22, 2025

Choose a reason for hiding this comment

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

Yes this is odd, it does seem like undefined behavior. clang being more strict is a possibility.
Without this change, on mac std::exception is caught instead of DriverException, so the exception is still caught but not under DriverException which is preferred

Comment on lines 20 to 24
if(WIN32)
include_directories(${ODBC_INCLUDE_DIRS})
else()
include_directories(${ODBC_INCLUDE_DIR})
endif()
Copy link
Member

Choose a reason for hiding this comment

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

target_include_directories would be preferable...also why is DIRS/DIR inconsistent between platforms?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replaced it with target_include_directories. Regarding DIRS/DIR, it has to do with FindODBC.cmake, on Windows, ODBC_INCLUDE_DIRS is set, and on unix systems ODBC_INCLUDE_DIR is set. ODBC_INCLUDE_DIR can be empty on Windows. I added a comment to indicate this.

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting committer review Awaiting committer review labels Dec 22, 2025
- Use `target_include_directories`
@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Dec 23, 2025
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.

3 participants