Skip to content

Enable ODBC Build On Linux without unicode support#160

Open
alinaliBQ wants to merge 9 commits intoapache-odbcfrom
linux-ci-build-new
Open

Enable ODBC Build On Linux without unicode support#160
alinaliBQ wants to merge 9 commits intoapache-odbcfrom
linux-ci-build-new

Conversation

@alinaliBQ
Copy link

@alinaliBQ alinaliBQ commented Mar 11, 2026

Implements basic Linux build. The ODBC does not work properly due to lack of unicode support. Unicode support will be implemented in a separate PR.

  • Enable Linux ODBC build, place holder function is used for unicode conversion
  • Added docker-compose for Flight SQL ODBC
  • Register ODBC after build
  • Replaced boost::lexicographical_compare with std::lexicographical_compare
  • Fixed conversion bugs in SetAttributeSQLWCHAR

This PR doesn't include ODBC test build support.

@alinaliBQ alinaliBQ closed this Mar 11, 2026
@alinaliBQ alinaliBQ reopened this Mar 11, 2026
@alinaliBQ alinaliBQ force-pushed the linux-ci-build-new branch from d4e5463 to 8ac65b3 Compare March 12, 2026 19:26
@alinaliBQ alinaliBQ marked this pull request as ready for review March 12, 2026 19:33
@alinaliBQ alinaliBQ force-pushed the linux-ci-build-new branch from 8ac65b3 to 2afc5fd Compare March 12, 2026 19:35
- name: Register Flight SQL ODBC Driver
run: |
sudo cpp/src/arrow/flight/sql/odbc/install/mac/install_odbc.sh $(pwd)/build/cpp/${{ matrix.build-type }}/libarrow_flight_sql_odbc.dylib
sudo cpp/src/arrow/flight/sql/odbc/install/unix/install_odbc.sh $(pwd)/build/cpp/${{ matrix.build-type }}/libarrow_flight_sql_odbc.dylib

Choose a reason for hiding this comment

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

Don't we want this same "Register Flight SQL ODBC Driver" section for linux as well?

Copy link
Author

Choose a reason for hiding this comment

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

This section is inside compose.yaml:

arrow/compose.yaml

Lines 531 to 535 in 2afc5fd

command: >
/bin/bash -c "
/arrow/ci/scripts/cpp_build.sh /arrow /build &&
sudo /arrow/cpp/src/arrow/flight/sql/odbc/install/unix/install_odbc.sh /usr/local/lib/libarrow_flight_sql_odbc.so &&
/arrow/ci/scripts/cpp_test.sh /arrow /build"

Because Linux docker file has the test sessions etc inside the docker command, I added ODBC registration at the same place

Next: resolve the string conversion issues in tests. Write simple helper function to convert wstring (or wchar_t*) to `std::vector<SQLWCHAR>` should solve the issue.

Disable ODBC test build on Linux

- Building Linux test in ODBC will be in a separate PR
- Reducing dockerfile will be in a separate PR

Resolve sqlucode.h build issue

* Doesn't impact macOS. Check CI if it impacts Windows ODBC.

Resolve `sign-compare` warnings

- Need to have same type during comparison.
- Now `Built target arrow-odbc-spi-impl-test` is successful.

Add forward function header

Resolve system.cc build errors

Still have some wsigns stuff to fix later.

In-progress fix with unicode issues on system_dsn.cc

TODO - still need to make the `ToSqlWCharPtr` function safe.

Fix Linux build errors with configuration.cc

* Finish fixing wchar related build errors at configuration.cc
* Still have errors at `system_dsn.cc`

Remove some log messages

This partially reverts commit 568f72d.
All tests on macOS passing locally.

In-progress fix read SQLWCHAR string

In-progress Fix ODBC Build errors on Linux - Mar2 week

- Add `[[fallthrough]];` to indicate intentional fallthrough.
- Add `default` handling case.
- Add casts for `record_number` compares

Attempt to fix Windows build from odbc_statement.cc header change

In-progress Fix ODBC Build errors on Linux

- remove `std::move(options);`
- Remove `boost` library install and add boost::headers to cmake lists, which resolves a lot of the boost issues I think
- Continue on Monday.

Add wrappers for `reinterpret_cast<LPCWSTR>`

This was causing an issue on Linux

Replace `boost::lexicographical_compare` with `std::lexicographical_compare`

Restore boost usages and add `BOOST_NO_CXX98_FUNCTION_BASE`

Undo Set build level warning to production

It didn't resolve the build errors related to boost on Linux (or any other build errors)

Set build level warning to production

* If this acts as a workaround for boost, then we don't have to redo boost

In-progress Fix the `LPCWSTR` convert error on Linux

- Plus formatting fix
- Plus build fix for casting

More boost disables

I think the solution would be to replace boost completely. Now the build works on macOS.

Continue in-progress fix odbc build

Temp boost disables

In-progress fix ODBC build

- Add `unixodbc-dev` to dockerfile
- There are changes to macOS static build PR that I will need to incorporate back to `apache-odbc` later

Enable ODBC mac and Windows in case of errors

Enable ODBC build on Linux

Add ODBC=ON to dockerfile

Fix `arm64` cannot found error from typo

Add `DOCKER_VOLUME_PREFIX` and other environment settings

Add Linux docker to `compose.yaml`

Disable mac and Windows ODBC for faster build

More disable

Draft ODBC Linux implementation

Comment out non-ODBC items
* remove ODBC dockerfile as it is not needed.
* in-progress of register ODBC
* move unix odbc registration script to common place
* resolve the issue of ODBC APIs not exported on Linux
@alinaliBQ alinaliBQ force-pushed the linux-ci-build-new branch from 2afc5fd to 126bbe7 Compare March 13, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants