Skip to content

MacOS: libpq rpath doesn't work #405

@larskanis

Description

@larskanis

I noticed this in our CI on Github Actions.

If the libpq shared object is used from a non system location like in our CI:
https://github.com/larskanis/ruby-pg/runs/3784028158?check_suite_focus=true#step:8:8000

... then it's explicit added as an rpath to the ld command:
https://github.com/larskanis/ruby-pg/runs/3784028158?check_suite_focus=true#step:10:119

... but in the end this file isn't used but a libpq shared object from /usr/local/lib:
https://github.com/larskanis/ruby-pg/runs/3784028158?check_suite_focus=true#step:11:20

I solved a very similar issue on Windows, which doesn't recognize an rpath setting in #373 . It sets the path to be used at load time at require 'pg'. Maybe this solution can be extended to also give the dynamic loader a hint which directory should be used.

This issue hasn't stood out before, since we didn't do Macos tests for a long time and when we did, the system library was good enough.

I don't have much knowledge about Macos. @ged , @cbandy Can you help?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions