Skip to content

GH-55432: [C++][FlightRPC][ODBC] Link Arrow libraries dynamically to ODBC - #55604

Open
alinaliBQ wants to merge 9 commits into
apache:mainfrom
dremio:gh-55432-link-arrow-dyn
Open

alinaliBQ wants to merge 9 commits into
apache:mainfrom
dremio:gh-55432-link-arrow-dyn

Conversation

@alinaliBQ

@alinaliBQ alinaliBQ commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Rationale for this change

See discussion in GH-55432

What changes are included in this PR?

  • Remove static link default setting for Linux ODBC (macOS ODBC remains static default to workaround sandbox environment)
  • Change Linux ODBC CI to enable dynamic linking
  • Add libboost-locale-dev to ci/docker/ubuntu-24.04-cpp.dockerfile as it is required dependency for ODBC. It is now required because we are no longer building the boost as bundle dependency in the CI

Are 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:

  • Human
  • AI

Reviewed before submission by:

  • Human
  • AI
  • Not reviewed

@alinaliBQ

Copy link
Copy Markdown
Collaborator Author

Hi @kou @lidavidm PR is ready for review, the CI failures don't look related

@kou kou added the CI: Extra: Package: Linux Run extra Linux Packages CI label Nov 15, 2026
Comment thread .github/workflows/cpp_extra.yml Resolved

@alinaliBQ alinaliBQ left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks @kou, addressed comments

Comment thread .github/workflows/cpp_extra.yml Resolved
@alinaliBQ

Copy link
Copy Markdown
Collaborator Author

Seeing almalinux-8 build failures, I will look into this

alinaliBQ and others added 8 commits November 20, 2026 15:32
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
- Remove `Check ODBC Dependency` for Linux ODBC
- Use `if(APPLE)` instead of `if(NOT APPLE)`
- Add `boost::headers` back on Linux
@alinaliBQ
alinaliBQ force-pushed the gh-55432-link-arrow-dyn branch from 2c2e6f9 to 010087e Compare November 20, 2026 22:33
@alinaliBQ

Copy link
Copy Markdown
Collaborator Author

Seems the almalinux-8-amd64 failure is unrelated. @kou PR ready for second round of review

Comment thread compose.yaml Resolved
Comment thread .github/workflows/cpp_extra.yml Resolved
Comment thread .github/workflows/cpp_extra.yml Resolved
Comment thread .github/workflows/cpp_extra.yml Outdated
Comment on lines +846 to +853
- name: Check ODBC Dependency
shell: cmd
run: |
# ODBC dependency should not include other Arrow libraries
call "%VS_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 || exit /b 1
dumpbin /dependents build\cpp\%ARROW_BUILD_TYPE%\arrow_flight_sql_odbc.dll > odbc_dependents.txt || exit /b 1
type odbc_dependents.txt
bash -c "if grep -i '^ *arrow.*\.dll' odbc_dependents.txt; then echo 'Error: Flight SQL ODBC DLL depends on Arrow DLLs'; exit 1; fi"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It seems that we don't need this because we use ARROW_BUILD_SHARED: OFF. No Arrow DLL exists in this environment.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for educating me on this, removed the check

${ARROW_TEST_STATIC_LINK_LIBS})
elseif(APPLE)
# GH-49651: Link the ODBC driver dynamically on macOS.
else()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

deb/RPM packages build shared libraries but users may want to build without shared libraries. How about accepting the case by changing this else() to

Suggested change
else()
elseif(APPLE OR ARROW_BUILD_SHARED)

and keep the below removed else() block?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yup, that makes sense, done

- revert `Use `/arrow/build`` in compose.yaml
- remove C++ Extra CI comments
- Remove `Check ODBC Dependency` for MSVC

@alinaliBQ alinaliBQ left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@kou Ty, comments addressed

Comment thread .github/workflows/cpp_extra.yml Resolved
${ARROW_TEST_STATIC_LINK_LIBS})
elseif(APPLE)
# GH-49651: Link the ODBC driver dynamically on macOS.
else()

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yup, that makes sense, done

Comment thread compose.yaml Resolved
Comment thread .github/workflows/cpp_extra.yml Outdated
Comment on lines +846 to +853
- name: Check ODBC Dependency
shell: cmd
run: |
# ODBC dependency should not include other Arrow libraries
call "%VS_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 || exit /b 1
dumpbin /dependents build\cpp\%ARROW_BUILD_TYPE%\arrow_flight_sql_odbc.dll > odbc_dependents.txt || exit /b 1
type odbc_dependents.txt
bash -c "if grep -i '^ *arrow.*\.dll' odbc_dependents.txt; then echo 'Error: Flight SQL ODBC DLL depends on Arrow DLLs'; exit 1; fi"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for educating me on this, removed the check

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.

2 participants