ci: relocate pg_client libpq dependency on macOS before packaging - #792
Merged
Conversation
pg_client links against the keg-only standalone 'libpq' Homebrew formula in CI, which records /opt/homebrew/opt/libpq/lib/libpq.5.dylib in the released binary. Machines that install libpq via 'brew install postgresql@18' only cannot resolve that path and fail to LOAD EXTENSION (LadybugDB/extensions#48). After the macOS extension build, run the extension repo's scripts/relocate-macos-libpq.sh + verify-macos-libpq-rpaths.sh on the built pg_client extension so the dependency is rewritten to @rpath/libpq.5.dylib with the common Homebrew locations as LC_RPATH fallbacks. Bump the extension submodule (which carries those scripts) from 4bd1dc1 to 5ffb349.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wiring for LadybugDB/extensions#48 (macOS arm64
pg_client0.19.0 fails to load on machines with onlypostgresql@18installed).Changes
After the macOS extension build, relocate and verify the built pg_client extension before
collect-extensions.pypackages the artifacts:The new macOS step rewrites the libpq install name recorded by the keg-only standalone
libpqformula (/opt/homebrew/opt/libpq/lib/libpq.5.dylib) to@rpath/libpq.5.dylibwith the common Homebrew locations (standalonelibpq+ bundledpostgresql@18,/opt/homebrewand/usr/local) asLC_RPATHfallbacks, so the released binary loads in either layout.Also bumps the
extensionsubmodule from4bd1dc1to5ffb349, which pulls in the two relocation scripts from LadybugDB/extensions#49 (plus the 5 extensions commits on main since the previous pin).Notes
5ffb349, which stays valid regardless of merge order; once that PR merges, the pin can be advanced to the new extensions main SHA.if: runner.os == 'macOS'), matching where the standalone-libpq link path is recorded.@rpath+ 6 rpaths, verify passes, idempotent, and a simulated postgresql@18-only machine loads the patched binary.