Skip to content

Drivers are unusable when statically linked with CMake #2562

Open
@jtanx

Description

@jtanx

What happened?

Taking the postgres driver as an example:

  • The CMake package adbc_driver_postgresql links to adbc_driver_common and a few other vendored dependencies like nanoarrow. Only adbc_driver_postgresql is installed; the other libraries are missing. This leads to a linking error since the symbols provided in the other libraries are missing.
  • For reasons I do not understand, the driver unnecessarily redefines the entirety of the ADBC driver manager functions (e.g. AdbcDatabaseGetOption). This leads to a duplicate symbol error when you try to link both the ADBC driver manager library and the postgresql driver together.
  • Furthermore, PostgresqlDriverInit is not declared in any installed header (the driver does not install any headers?), which complicates using it with AdbcDriverManagerDatabaseSetInitFunc. This is less egregious as it's not that hard to just declare the function signature manually, but it is still odd that it's not provided.
  • The way vendored dependencies are handled is also problematic if linking statically - no attempt is made to first search for these packages before using the vendored dependencies. This can lead to conflicts if I am also using e.g. the fmt library myself from a third party source.

Stack Trace

No response

How can we reproduce the bug?

  • Use CMake
  • Build statically
  • Install the static libs
  • Try to use the libraries statically from another project

Environment/Setup

C driver version 1.4.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions