Repository navigation
Conversation
initial commit Default to dynamic linking Default to dynamic linking for ODBC if both shared and static libs are built, i.e., both `ARROW_BUILD_SHARED` and `ARROW_BUILD_STATIC` are set Update comments
ODBC has boost locale dependency
Verify that Arrow libraries are dynamically linked
| - name: Check ODBC Dependency | ||
| run: | | ||
| # The ODBC driver should link Arrow libraries dynamically on Linux | ||
| lib="$(pwd)/build/cpp/release/libarrow_flight_sql_odbc.so" | ||
| ldd "${lib}" | ||
| for arrow_lib in libarrow libarrow_compute libarrow_flight libarrow_flight_sql; do | ||
| ldd "${lib}" | grep -Fq "${arrow_lib}.so" || { | ||
| echo "Error: ${arrow_lib} is not dynamically linked to ${lib}" | ||
| exit 1 | ||
| } | ||
| done |
There was a problem hiding this comment.
We don't need this check here. Using shared library is important in deb/RPM packages not normal builds.
There was a problem hiding this comment.
ok, removed the check. On a separate note, I will add an ODBC Dependency check for Windows, because I realize we need verification to ensure Windows static ODBC.dll doesn't require other Arrow library dependencies (or else the installed ODBC won't work), this is same type of check we have for macOS ODBC.
| # On macOS, always link Arrow libraries statically. | ||
| # On Windows and Linux, link Arrow libraries dynamically if the shared libraries are | ||
| # built, and statically otherwise. | ||
| if(NOT APPLE) |
There was a problem hiding this comment.
How about using if(APPLE) ... else() ... endif() instead of if(NOT APPLE) ... else() ... endif() for readability? I want to avoid a negative condition such as if(NOT ...) as much as possible.
- Remove `Check ODBC Dependency` for Linux ODBC - Use `if(APPLE)` instead of `if(NOT APPLE)`
| - name: Check ODBC Dependency | ||
| run: | | ||
| # The ODBC driver should link Arrow libraries dynamically on Linux | ||
| lib="$(pwd)/build/cpp/release/libarrow_flight_sql_odbc.so" | ||
| ldd "${lib}" | ||
| for arrow_lib in libarrow libarrow_compute libarrow_flight libarrow_flight_sql; do | ||
| ldd "${lib}" | grep -Fq "${arrow_lib}.so" || { | ||
| echo "Error: ${arrow_lib} is not dynamically linked to ${lib}" | ||
| exit 1 | ||
| } | ||
| done |
There was a problem hiding this comment.
ok, removed the check. On a separate note, I will add an ODBC Dependency check for Windows, because I realize we need verification to ensure Windows static ODBC.dll doesn't require other Arrow library dependencies (or else the installed ODBC won't work), this is same type of check we have for macOS ODBC.
| # On macOS, always link Arrow libraries statically. | ||
| # On Windows and Linux, link Arrow libraries dynamically if the shared libraries are | ||
| # built, and statically otherwise. | ||
| if(NOT APPLE) |
Rationale for this change
See discussion in GH-55432
What changes are included in this PR?
libboost-locale-devtoci/docker/ubuntu-24.04-cpp.dockerfileas it is required dependency for ODBC. It is now required because we are no longer building the boost as bundle dependency in the CIAre these changes tested?
Yes. I tested with local docker to ensure Linux ODBC still works. Also tested in CI.
Are there any user-facing changes?
Yes, the ODBC driver will be linked dynamically to Arrow libraries on Arrow according to settings on
arrow.spec.in.Was AI used for this PR?
In accordance to the AI generation guidelines, please disclose below whether and how AI was used in this PR.
PR code and description written by:
Reviewed before submission by: