Skip to content

Attempting to build packaged libsqlite unexpectedly links against system libraries #639

@benjunmun

Description

@benjunmun

I have run into an issue installing this gem with the compiled native extension. When I run a build, if there are any sqlite3 headers and libraries installed on my system, the sqlite3_native.so library ends up being dynamically linked against that system library. This is the case even though I am not setting --enable-system-libraries or even if I set --disable-system-libraries explicitly. If I uninstall the library from the system, then the gem extension does link statically against the packaged libsqlite3 the way I expect.

Originally, I ran into this issue on Rocky Linux 9 with Ruby 3.0, sqlite3-ruby 2.0.4. Ancient ruby/rubygems mean that it can't use the precompiled gems, but I really needed the newer packaged version of libsqlite3. I have since been able to reproduce this issue with the latest version of sqlite3-ruby and ruby 3.3.7.

In my mind, this is unexpected behavior, since the gem is going to the trouble of building sqlite3, and since the default is --disable-system-libraries. For my own purposes I've hacked the extconf.rb to static link against the packaged libsqlite3 by default. I'm not an expert with ruby extension building or this gem; If this would be useful for the project, please let me know and I can open a pull request. Also willing to rework it if there is a better approach that anyone is aware of. benjunmun/sqlite3-ruby@31abd7c

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions