GH-49538: [C++][FlightRPC][ODBC] Use static linkage in Windows FlightSQL ODBC driver#49585
GH-49538: [C++][FlightRPC][ODBC] Use static linkage in Windows FlightSQL ODBC driver#49585amoeba wants to merge 35 commits intoapache:mainfrom
Conversation
|
Thanks for opening a pull request! If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project. Then could you also rename the pull request title in the following format? or See also: |
|
I have this building locally. Before this PR: After: |
74eb8f6 to
3320df2
Compare
This reverts commit 819f2fc.
Flight tests get statically linked no matter what when grpc or protobuf are static.
ca55ec8 to
7782c69
Compare
|
|
alinaliBQ
left a comment
There was a problem hiding this comment.
@amoeba I see the branch is about a week old, could we rebase on the latest main? I see there are no conflicts, but I am curious to see if the test code changes at odbc_impl in this PR can incidentally help with #49767 (not required for this PR)
I have tested the ODBC MSI installer manually, and can confirm I am able to retrieve data from Power BI using the installer and static linkage ODBC.
| void ODBCTestBase::TearDownTestSuite() { | ||
| if (connected) { | ||
| Disconnect(); | ||
| // TODO(XXX): Without commenting this out, Disconnect() makes this test |
There was a problem hiding this comment.
Could we link 49808 in the comment?
FYI - During Disconnect, the driver DLL is unloaded. Since Arrow libraries don't support unloading #47608 (comment), segmentation fault can occur.
| // TODO(XXX): Without commenting this out, Disconnect() makes this test | |
| // GH-49808 TODO: Without commenting this out, Disconnect() makes this test |
Rationale for this change
The FlightSQL ODBC driver was previously using dynamic linkage for the Arrow deps it relies on. This worked but prevented a challenge for code signing because (I think) we'd have to sign each DLL and signing costs money. We can use static linkage with a dynamically linked MSVC runtime so we only have one DLL to sign.
Ref: #49404
What changes are included in this PR?
Updates to CMake and CI for the build to allow static linkage with dynamic MSVC runtime (
x64-windows-static-md).Are these changes tested?
Yes.
Are there any user-facing changes?
No.