Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

Profpatsch
Copy link
Member

  • built on nixos
  • checked mssql .so with ldd
  • activated new functionality on system and tested various combinations
  • tested that the assertions fire

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).

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).
@mention-bot
Copy link

@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.
@Profpatsch
Copy link
Member Author

I added two more commits that change the interface somewhat. Some external input about the API would be nice nonetheless.

@Profpatsch
Copy link
Member Author

Anyone willing to review?

@knedlsepp
Copy link
Member

knedlsepp commented Sep 13, 2017

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 odbc.ini and odbcinst.ini to specify the drivers.
I think your effort is great! Do you think that this could also be done without nixOS-modules? I'd love to make this work also on non-nixOS.

Copy link
Member Author

@Profpatsch Profpatsch left a 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; };
Copy link
Member Author

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.

@Profpatsch
Copy link
Member Author

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.

@Profpatsch Profpatsch closed this Jan 13, 2019
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.

None yet

3 participants