New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
odbc: begin generalizing over different driver managers #20960
Conversation
ODBC drivers are managed by driver managers. Driver managers provide the same ABI, but driver’s shared objects need to have their dm’s .so baked in. The nixos module is changed to allow choosing between the older unixODBC dm and libiodbc. The drivers are then compiled with the correct references. Additionally, this adds the non-free mssql driver (too many changes, it’s hard to put in a separate commit).
@Profpatsch, thanks for your PR! By analyzing the history of the files in this pull request, we identified @abbradar, @edolstra and @MarcWeber to be potential reviewers. |
odbcDrivers now take a string describing the driver manager and the driver manager itself. The string is for them to check whether they are called with a driver manager supported by them and throw a warning if not. We also add the Microsoft variant of unixODBC that should be more compatible with the mssql driver.
It’s a pretty dirty hack, but the resulting modified .so seems to work just fine. Somebody should lobby Microsoft about open-sourcing the damn thing.
I added two more commits that change the interface somewhat. Some external input about the API would be nice nonetheless. |
Anyone willing to review? |
I'm also currently coming to the conclusion that there is a bit of a mixture of usage of libiodbc and unixodbc, which causes me pain on a non-NixOS installation, since they are based on different environment variables and formats of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think that this could also be done without nixOS-modules?
It’s been a while so I don’t remember the whole setup in this PR, but e.g. in the last argument of the MS ODBC package you can see there is a way to override the driver on a package level (aka. a level that doesn’t need modules).
# the driver manager and import them here | ||
{ | ||
mssql = callPackage ./msodbcsql { odbcDriverManager = "unixODBC-MSSQL"; | ||
odbcDriverManagerDrv = unixODBC-MSSQL; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not sure about that interface. It was the best solution I could come up with; The strings are used as a kind of open enumeration and the drivers should check for the driver managers they are incompatible with.
I’m sad to see this work go to waste, but I don’t use ODBC at the moment, so let’s close this PR for now. |
ldd
ODBC drivers are managed by driver managers. Driver managers provide the same
ABI, but driver’s shared objects need to have their dm’s .so baked in.
The nixos module is changed to allow choosing between the older unixODBC dm and
libiodbc. The drivers are then compiled with the correct references.
Additionally, this adds the non-free mssql driver (too many changes, it’s hard
to put in a separate commit).